[media] uvcvideo: improve urb buffer allocation
authorHenry Lin <henryl@nvidia.com>
Wed, 21 Sep 2016 16:02:03 +0000 (00:02 +0800)
committerWinnie Hsu <whsu@nvidia.com>
Fri, 5 May 2017 22:05:41 +0000 (15:05 -0700)
commit8f3f81d09b75211339ebf24e89f26d8ea4ecb158
treef8e47a7d592c10d4fa3f26dfc178fc53c5157bc9
parent5070cd436582d325164d2c3a2be1afe0f850b851
[media] uvcvideo: improve urb buffer allocation

Some UVC device (e.g. StereoLabs ZED camera) may have strict timing
requirement for transferring video payload. This change improves URB
buffer allocation for UVC device with bulk VideoStreaming interface. The
criteria for buffer allocation are:
- Let an URB able to receive a complete UVC payload
- Prepare and submit URBs for a complete video frame

If system memory is large enough, URB buffers will consume memory size
up to a complete video frame.

Bug 1674178

Change-Id: If5f366582ee1c1cb559e890176d74484634dccef
Signed-off-by: Henry Lin <henryl@nvidia.com>
Signed-off0by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/1225266
(cherry picked from commit 4797f84301fe6ff42313c688e72e4f7c0d52b2e6)
Reviewed-on: http://git-master/r/1239557
(cherry picked from commit 3d96f9a8e9f50e08a8306b94378c08dcdfa83abc)
Reviewed-on: http://git-master/r/1281090
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
drivers/media/usb/uvc/uvc_video.c
drivers/media/usb/uvc/uvcvideo.h