mbox series

[v2,0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize

Message ID 20240403-uvc_request_length_by_interval-v2-0-12690f7a2eff@pengutronix.de
Headers show
Series usb: gadget: uvc: allocate requests based on frame interval length and buffersize | expand

Message

Michael Grzeschik June 22, 2024, 11:48 p.m. UTC
This patch series is improving the size calculation and allocation of
the uvc requests. Using the selected frame duration of the stream it is
possible to calculate the number of requests based on the interval
length.

This is an preperation to precalculate the request length based
on the actual per frame size for compressed formats.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes in v2:
- added header size into calculation of request size
- Link to v1: https://lore.kernel.org/r/20240403-uvc_request_length_by_interval-v1-0-9436c4716233@pengutronix.de

---
Michael Grzeschik (3):
      usb: gadget: function: uvc: set req_size once when the vb2 queue is calculated
      usb: gadget: uvc: add g_parm and s_parm for frame interval
      usb: gadget: uvc: set req_size and n_requests based on the frame interval

 drivers/usb/gadget/function/uvc.h       |  1 +
 drivers/usb/gadget/function/uvc_queue.c | 32 +++++++++++++++-----
 drivers/usb/gadget/function/uvc_v4l2.c  | 52 +++++++++++++++++++++++++++++++++
 drivers/usb/gadget/function/uvc_video.c | 17 ++---------
 4 files changed, 81 insertions(+), 21 deletions(-)
---
base-commit: 819984a0dd3606b7c46fe156cd56a0dc0d604788
change-id: 20240403-uvc_request_length_by_interval-a7efd587d963

Best regards,