diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2024-10-16 15:58:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 08:42:23 +0200 |
commit | 1dc2527ce89273b56b43dbe1193c679f00cfc153 (patch) | |
tree | d12e3dd3dd8450876cbd3e4233f383515e719756 /drivers/usb/gadget/function/uvc_queue.c | |
parent | 98ad0329156094a63c5191bb0f57b7bae9659f18 (diff) | |
download | linux-1dc2527ce89273b56b43dbe1193c679f00cfc153.tar.gz linux-1dc2527ce89273b56b43dbe1193c679f00cfc153.tar.bz2 linux-1dc2527ce89273b56b43dbe1193c679f00cfc153.zip |
usb: gadget: uvc: set nbuffers to minimum STREAMING_MIN_BUFFERS in uvc_queue_setup
We set the minimum amount of v4l2 buffers that is possibly be pending
to UVCG_STREAMING_MIN_BUFFERS which is two. This way the driver will
always have at least one frame pending to be encoded while the other
is being enqueued in the hardware.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20240403-uvc_request_length_by_interval-v7-7-e224bb1035f0@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/function/uvc_queue.c')
-rw-r--r-- | drivers/usb/gadget/function/uvc_queue.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c index 6757a4e25a74..5eaeae3e2441 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c @@ -21,6 +21,7 @@ #include <media/videobuf2-vmalloc.h> #include "uvc.h" +#include "uvc_video.h" /* ------------------------------------------------------------------------ * Video buffers queue management. @@ -47,6 +48,8 @@ static int uvc_queue_setup(struct vb2_queue *vq, if (*nbuffers > UVC_MAX_VIDEO_BUFFERS) *nbuffers = UVC_MAX_VIDEO_BUFFERS; + if (*nbuffers < UVCG_STREAMING_MIN_BUFFERS) + *nbuffers = UVCG_STREAMING_MIN_BUFFERS; *nplanes = 1; |