linux/drivers/media/common/videobuf2
Hans Verkuil c592b46907 media: videobuf2-core: dequeue if start_streaming fails
If a vb2_queue sets q->min_buffers_needed then when the number of
queued buffers reaches q->min_buffers_needed, vb2_core_qbuf() will call
the start_streaming() callback. If start_streaming() returns an error,
then that error was just returned by vb2_core_qbuf(), but the buffer
was still queued. However, userspace expects that if VIDIOC_QBUF fails,
the buffer is returned dequeued.

So if start_streaming() fails, then remove the buffer from the queue,
thus avoiding this unwanted side-effect.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Fixes: b3379c6201 ("[media] vb2: only call start_streaming if sufficient buffers are queued")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-07-30 13:01:03 +02:00
..
frame_vector.c media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
Kconfig media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
Makefile media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
vb2-trace.c media: videobuf2: fix build issues with vb2-trace 2018-02-23 05:13:53 -05:00
videobuf2-core.c media: videobuf2-core: dequeue if start_streaming fails 2021-07-30 13:01:03 +02:00
videobuf2-dma-contig.c drm-misc-next for 5.11: 2020-11-04 11:49:10 +10:00
videobuf2-dma-sg.c media: videobuf2: Exit promptly if size = 0 2021-03-22 13:03:24 +01:00
videobuf2-dvb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
videobuf2-memops.c mm/frame-vector: Use FOLL_LONGTERM 2021-01-12 14:15:17 +01:00
videobuf2-v4l2.c media: videobuf2-v4l2.c: add vb2_queue_change_type() helper 2021-06-08 12:04:08 +02:00
videobuf2-vmalloc.c drm-misc-next for 5.11: 2020-11-04 11:49:10 +10:00