[media] uvcvideo: improve urb buffer allocation
authorHenry Lin <henryl@nvidia.com>
Wed, 21 Sep 2016 16:02:03 +0000 (00:02 +0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Mon, 21 Nov 2016 17:04:40 +0000 (09:04 -0800)
commit3d96f9a8e9f50e08a8306b94378c08dcdfa83abc
tree7b76779c7c8a3520a9ae5fdd1104f5f667c1916d
parent3deffe743d3d63b57f1dcc6b7e93c447b98ad132
[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>
Reviewed-on: http://git-master/r/1225266
Reviewed-by: WK Tsai <wtsai@nvidia.com>
Reviewed-by: Hans Yang <hansy@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 4797f84301fe6ff42313c688e72e4f7c0d52b2e6)
Reviewed-on: http://git-master/r/1239557
Reviewed-by: Peter Yu <pyu@nvidia.com>
Tested-by: Peter Yu <pyu@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
drivers/media/usb/uvc/uvc_video.c
drivers/media/usb/uvc/uvcvideo.h