Commit b92ac325 authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Dan Vacura
Browse files

FROMGIT: usb: gadget: uvc: calculate the number of request depending on framesize



The current limitation of possible number of requests being handled is
dependent on the gadget speed. It makes more sense to depend on the
typical frame size when calculating the number of requests. This patch
is changing this and is using the previous limits as boundaries for
reasonable minimum and maximum number of requests.

For a 1080p jpeg encoded video stream with a maximum imagesize of
e.g. 800kB with a maxburst of 8 and an multiplier of 1 the resulting
number of requests is calculated to 49.

        800768         1
nreqs = ------ * -------------- ~= 49
          2      (1024 * 8 * 1)

Tested-by: default avatarDan Vacura <w36195@motorola.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220529223848.105914-2-m.grzeschik@pengutronix.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 234757296
(cherry picked from commit 87d76b5f
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git

 usb-next)
Change-Id: I0228cbaa56d4e75bed33e1ef721ae3127d779faf
Signed-off-by: default avatarDan Vacura <w36195@motorola.com>
parent 59d057a3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment