usb: gadget: uvc: allow zero bytesused for rockchip uvc

For rockchip platforms, the userspace uvc application use
bytesused == 0 as a way to indicate that the data is all
zero and unused. In that case, the uvc driver should use
the allow_zero_bytesused flag to keep bytesused 0 rather
than use the buf actual size instead. This can help to
preview 1080P@MJPG faster.

Change-Id: Ic4d561f18e85d759b5a2405db4f6fb48533e1781
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2020-06-18 18:26:35 +08:00
committed by Tao Huang
parent c7dc380f57
commit 124b7feb0e

View File

@@ -124,6 +124,14 @@ int uvcg_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type,
queue->queue.mem_ops = &vb2_vmalloc_memops;
queue->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
| V4L2_BUF_FLAG_TSTAMP_SRC_EOF;
/*
* For rockchip platform, the userspace uvc application
* use bytesused == 0 as a way to indicate that the data
* is all zero and unused.
*/
#ifdef CONFIG_ARCH_ROCKCHIP
queue->queue.allow_zero_bytesused = 1;
#endif
ret = vb2_queue_init(&queue->queue);
if (ret)
return ret;