]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-mem2mem: support held capture buffers
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 11 Oct 2019 09:32:41 +0000 (06:32 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 21 Oct 2019 10:39:10 +0000 (07:39 -0300)
commitab444a96881129a5e477213ba4bb7e9e497e1fe8
treebad32414191b8dfb2242ffbddaf7a9daf9e26082
parent0a6cd73fba64eef10f0b8f4fec6c27e2168c8146
media: v4l2-mem2mem: support held capture buffers

Check for held buffers that are ready to be returned to vb2 in
__v4l2_m2m_try_queue(). This avoids drivers having to handle this
case.

Add v4l2_m2m_buf_done_and_job_finish() to correctly return source
and destination buffers and mark the job as finished while taking
a held destination buffer into account (i.e. that buffer won't be
returned). This has to be done while job_spinlock is held to avoid
race conditions.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-mem2mem.c
include/media/v4l2-mem2mem.h