summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-12-08 17:01:28 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 23:00:33 +0300
commit327553ae8eb87a66b2c9e041e890ea66f21009b2 (patch)
tree7b2f99446ae015fb519848fd4f3eac46243efe02 /drivers/media/v4l2-core
parent645838b51962e457250569d0fbe435d13792b93f (diff)
downloadlinux-327553ae8eb87a66b2c9e041e890ea66f21009b2.tar.xz
media: vb2: clear V4L2_BUF_FLAG_LAST when filling vb2_buffer
V4L2_BUF_FLAG_LAST is a signal from the driver to userspace for buffers on the capture queue. When userspace queues back a capture buffer with the flag set, we should clear it. Otherwise, if userspace restarts streaming after EOS, without reallocating the buffers, mem2mem devices will erroneously signal EOS prematurely, as soon as the already flagged buffer is dequeued. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/videobuf2-v4l2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c
index 4075314a6989..fac3cd6f901d 100644
--- a/drivers/media/v4l2-core/videobuf2-v4l2.c
+++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
@@ -434,6 +434,8 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb,
} else {
/* Zero any output buffer flags as this is a capture buffer */
vbuf->flags &= ~V4L2_BUFFER_OUT_FLAGS;
+ /* Zero last flag, this is a signal from driver to userspace */
+ vbuf->flags &= ~V4L2_BUF_FLAG_LAST;
}
return 0;