Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: vb2/au0828: move the v4l_vb2q_enable_media_source to the au0828 driver

With the new prepare_streaming op it is possible to move the ugly
v4l_vb2q_enable_media_source() call in vb2_core_streamon to the
driver. It was called incorrectly in vb2 as well: it was only
called if sufficient buffers were queued at STREAMON time, but not
if more buffers were queued later. This was not an issue with the
au0828 driver since it never set min_buffers_needed.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
c4cd4c8b a10b2153

+3 -3
-3
drivers/media/common/videobuf2/videobuf2-core.c
··· 2121 2121 * are available. 2122 2122 */ 2123 2123 if (q->queued_count >= q->min_buffers_needed) { 2124 - ret = v4l_vb2q_enable_media_source(q); 2125 - if (ret) 2126 - goto unprepare; 2127 2124 ret = vb2_start_streaming(q); 2128 2125 if (ret) 2129 2126 goto unprepare;
+2
drivers/media/usb/au0828/au0828-vbi.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/init.h> 16 16 #include <linux/slab.h> 17 + #include <media/v4l2-mc.h> 17 18 18 19 /* ------------------------------------------------------------------ */ 19 20 ··· 71 70 .queue_setup = vbi_queue_setup, 72 71 .buf_prepare = vbi_buffer_prepare, 73 72 .buf_queue = vbi_buffer_queue, 73 + .prepare_streaming = v4l_vb2q_enable_media_source, 74 74 .start_streaming = au0828_start_analog_streaming, 75 75 .stop_streaming = au0828_stop_vbi_streaming, 76 76 .wait_prepare = vb2_ops_wait_prepare,
+1
drivers/media/usb/au0828/au0828-video.c
··· 915 915 .queue_setup = queue_setup, 916 916 .buf_prepare = buffer_prepare, 917 917 .buf_queue = buffer_queue, 918 + .prepare_streaming = v4l_vb2q_enable_media_source, 918 919 .start_streaming = au0828_start_analog_streaming, 919 920 .stop_streaming = au0828_stop_streaming, 920 921 .wait_prepare = vb2_ops_wait_prepare,