usb: gadget: uvc: prepare buffer with data offset for rockchip platform

For some Rockchip platforms (e.g. RV1106 UVC), it needs to
get the offset in the plane which used for the start of data
in the uvc buffer.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I0144709f33b1d3ca955779be487134901468923f
This commit is contained in:
William Wu
2022-04-23 11:02:28 +08:00
committed by Tao Huang
parent f93c20fa43
commit b0cf5382ef

View File

@@ -70,7 +70,11 @@ static int uvc_buffer_prepare(struct vb2_buffer *vb)
return -ENODEV;
buf->state = UVC_BUF_STATE_QUEUED;
#ifdef CONFIG_ARCH_ROCKCHIP
buf->mem = vb2_plane_vaddr(vb, 0) + vb2_plane_data_offset(vb, 0);
#else
buf->mem = vb2_plane_vaddr(vb, 0);
#endif
buf->length = vb2_plane_size(vb, 0);
if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
buf->bytesused = 0;