* [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata
@ 2026-03-09 15:01 Ricardo Ribalda
2026-03-09 15:01 ` [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream Ricardo Ribalda
2026-03-16 12:05 ` [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Hans de Goede
0 siblings, 2 replies; 6+ messages in thread
From: Ricardo Ribalda @ 2026-03-09 15:01 UTC (permalink / raw)
To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab,
Guennadi Liakhovetski
Cc: linux-media, linux-kernel, Yunke Cao, Ricardo Ribalda, stable
This series introduces some improvements for UVC metadata:
- Allow bigger sizes of metadata.
- Refactor the code to avoid invalid pointer arithmetic.
- Add support for DMABUF
Cheers!
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Ricardo Ribalda (3):
media: uvcvideo: Enable VB2_DMABUF for metadata stream
media: uvcvideo: uvc_queue_to_stream(): Support meta queues
media: uvcvideo: Allow userspace to increase the meta buffersize
drivers/media/usb/uvc/uvc_isight.c | 3 ++-
drivers/media/usb/uvc/uvc_metadata.c | 9 +++++++--
drivers/media/usb/uvc/uvc_queue.c | 18 ++++++++----------
drivers/media/usb/uvc/uvcvideo.h | 7 +++++--
4 files changed, 22 insertions(+), 15 deletions(-)
---
base-commit: a7da7fb57f2a787412da1a62292a17fa00fbfbdf
change-id: 20260309-uvc-metadata-dmabuf-b98359eec8dd
Best regards,
--
Ricardo Ribalda <ribalda@chromium.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream
2026-03-09 15:01 [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Ricardo Ribalda
@ 2026-03-09 15:01 ` Ricardo Ribalda
2026-03-16 11:47 ` Hans de Goede
2026-03-18 19:15 ` Laurent Pinchart
2026-03-16 12:05 ` [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Hans de Goede
1 sibling, 2 replies; 6+ messages in thread
From: Ricardo Ribalda @ 2026-03-09 15:01 UTC (permalink / raw)
To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab,
Guennadi Liakhovetski
Cc: linux-media, linux-kernel, Yunke Cao, Ricardo Ribalda, stable
The UVC driver has two video streams, one for the frames and another one
for the metadata. Both streams share most of the codebase, but only the
data stream declares support for DMABUF transfer mode.
I have tried the DMABUF transfer mode with CONFIG_DMABUF_HEAPS_SYSTEM
and the frames looked correct.
This patch announces the support for DMABUF for the metadata stream.
This is useful for apps/HALs that only want to support DMABUF.
Cc: stable@vger.kernel.org
Fixes: 088ead2552458 ("media: uvcvideo: Add a metadata device node")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
drivers/media/usb/uvc/uvc_queue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
index 8b8f44b4a045..0eddd4f872ca 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -243,7 +243,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
int ret;
queue->queue.type = type;
- queue->queue.io_modes = VB2_MMAP | VB2_USERPTR;
+ queue->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
queue->queue.drv_priv = queue;
queue->queue.buf_struct_size = sizeof(struct uvc_buffer);
queue->queue.mem_ops = &vb2_vmalloc_memops;
@@ -256,7 +256,6 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
queue->queue.ops = &uvc_meta_queue_qops;
break;
default:
- queue->queue.io_modes |= VB2_DMABUF;
queue->queue.ops = &uvc_queue_qops;
break;
}
--
2.53.0.473.g4a7958ca14-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream
2026-03-09 15:01 ` [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream Ricardo Ribalda
@ 2026-03-16 11:47 ` Hans de Goede
2026-03-18 19:15 ` Laurent Pinchart
1 sibling, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2026-03-16 11:47 UTC (permalink / raw)
To: Ricardo Ribalda, Laurent Pinchart, Mauro Carvalho Chehab,
Guennadi Liakhovetski
Cc: linux-media, linux-kernel, Yunke Cao, stable
Hi,
On 9-Mar-26 4:01 PM, Ricardo Ribalda wrote:
> The UVC driver has two video streams, one for the frames and another one
> for the metadata. Both streams share most of the codebase, but only the
> data stream declares support for DMABUF transfer mode.
>
> I have tried the DMABUF transfer mode with CONFIG_DMABUF_HEAPS_SYSTEM
> and the frames looked correct.
>
> This patch announces the support for DMABUF for the metadata stream.
> This is useful for apps/HALs that only want to support DMABUF.
>
> Cc: stable@vger.kernel.org
> Fixes: 088ead2552458 ("media: uvcvideo: Add a metadata device node")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Regards,
Hans
> ---
> drivers/media/usb/uvc/uvc_queue.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
> index 8b8f44b4a045..0eddd4f872ca 100644
> --- a/drivers/media/usb/uvc/uvc_queue.c
> +++ b/drivers/media/usb/uvc/uvc_queue.c
> @@ -243,7 +243,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
> int ret;
>
> queue->queue.type = type;
> - queue->queue.io_modes = VB2_MMAP | VB2_USERPTR;
> + queue->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
> queue->queue.drv_priv = queue;
> queue->queue.buf_struct_size = sizeof(struct uvc_buffer);
> queue->queue.mem_ops = &vb2_vmalloc_memops;
> @@ -256,7 +256,6 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
> queue->queue.ops = &uvc_meta_queue_qops;
> break;
> default:
> - queue->queue.io_modes |= VB2_DMABUF;
> queue->queue.ops = &uvc_queue_qops;
> break;
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata
2026-03-09 15:01 [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Ricardo Ribalda
2026-03-09 15:01 ` [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream Ricardo Ribalda
@ 2026-03-16 12:05 ` Hans de Goede
2026-03-18 19:23 ` Laurent Pinchart
1 sibling, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2026-03-16 12:05 UTC (permalink / raw)
To: Ricardo Ribalda, Laurent Pinchart, Mauro Carvalho Chehab,
Guennadi Liakhovetski
Cc: linux-media, linux-kernel, Yunke Cao, stable
Hi,
On 9-Mar-26 4:01 PM, Ricardo Ribalda wrote:
> This series introduces some improvements for UVC metadata:
>
> - Allow bigger sizes of metadata.
> - Refactor the code to avoid invalid pointer arithmetic.
> - Add support for DMABUF
>
> Cheers!
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Thank you.
This entire series seems simple/safe enough and looks good to me
from a review pov, so I've pushed this to uvc/for-next now.
While it also rebasing uvc/for-next on top of the latest
media-committers/next .
Regards,
Hans
> ---
> Ricardo Ribalda (3):
> media: uvcvideo: Enable VB2_DMABUF for metadata stream
> media: uvcvideo: uvc_queue_to_stream(): Support meta queues
> media: uvcvideo: Allow userspace to increase the meta buffersize
>
> drivers/media/usb/uvc/uvc_isight.c | 3 ++-
> drivers/media/usb/uvc/uvc_metadata.c | 9 +++++++--
> drivers/media/usb/uvc/uvc_queue.c | 18 ++++++++----------
> drivers/media/usb/uvc/uvcvideo.h | 7 +++++--
> 4 files changed, 22 insertions(+), 15 deletions(-)
> ---
> base-commit: a7da7fb57f2a787412da1a62292a17fa00fbfbdf
> change-id: 20260309-uvc-metadata-dmabuf-b98359eec8dd
>
> Best regards,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream
2026-03-09 15:01 ` [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream Ricardo Ribalda
2026-03-16 11:47 ` Hans de Goede
@ 2026-03-18 19:15 ` Laurent Pinchart
1 sibling, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2026-03-18 19:15 UTC (permalink / raw)
To: Ricardo Ribalda
Cc: Hans de Goede, Mauro Carvalho Chehab, Guennadi Liakhovetski,
linux-media, linux-kernel, Yunke Cao, stable
On Mon, Mar 09, 2026 at 03:01:54PM +0000, Ricardo Ribalda wrote:
> The UVC driver has two video streams, one for the frames and another one
> for the metadata. Both streams share most of the codebase, but only the
> data stream declares support for DMABUF transfer mode.
>
> I have tried the DMABUF transfer mode with CONFIG_DMABUF_HEAPS_SYSTEM
> and the frames looked correct.
>
> This patch announces the support for DMABUF for the metadata stream.
> This is useful for apps/HALs that only want to support DMABUF.
Is that something you plan to use in Android ?
> Cc: stable@vger.kernel.org
> Fixes: 088ead2552458 ("media: uvcvideo: Add a metadata device node")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> drivers/media/usb/uvc/uvc_queue.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
> index 8b8f44b4a045..0eddd4f872ca 100644
> --- a/drivers/media/usb/uvc/uvc_queue.c
> +++ b/drivers/media/usb/uvc/uvc_queue.c
> @@ -243,7 +243,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
> int ret;
>
> queue->queue.type = type;
> - queue->queue.io_modes = VB2_MMAP | VB2_USERPTR;
> + queue->queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
One day we should start warning about USERPTR being deprecated.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> queue->queue.drv_priv = queue;
> queue->queue.buf_struct_size = sizeof(struct uvc_buffer);
> queue->queue.mem_ops = &vb2_vmalloc_memops;
> @@ -256,7 +256,6 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
> queue->queue.ops = &uvc_meta_queue_qops;
> break;
> default:
> - queue->queue.io_modes |= VB2_DMABUF;
> queue->queue.ops = &uvc_queue_qops;
> break;
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata
2026-03-16 12:05 ` [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Hans de Goede
@ 2026-03-18 19:23 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2026-03-18 19:23 UTC (permalink / raw)
To: Hans de Goede
Cc: Ricardo Ribalda, Mauro Carvalho Chehab, Guennadi Liakhovetski,
linux-media, linux-kernel, Yunke Cao, stable
On Mon, Mar 16, 2026 at 01:05:30PM +0100, Hans de Goede wrote:
> On 9-Mar-26 4:01 PM, Ricardo Ribalda wrote:
> > This series introduces some improvements for UVC metadata:
> >
> > - Allow bigger sizes of metadata.
> > - Refactor the code to avoid invalid pointer arithmetic.
> > - Add support for DMABUF
> >
> > Cheers!
> >
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
>
> Thank you.
>
> This entire series seems simple/safe enough and looks good to me
> from a review pov, so I've pushed this to uvc/for-next now.
I'd like a small change in 2/3. Ricardo, if you submit a new version of
2/3, I can merge it and handle the rebase.
> While it also rebasing uvc/for-next on top of the latest
> media-committers/next .
>
> > ---
> > Ricardo Ribalda (3):
> > media: uvcvideo: Enable VB2_DMABUF for metadata stream
> > media: uvcvideo: uvc_queue_to_stream(): Support meta queues
> > media: uvcvideo: Allow userspace to increase the meta buffersize
> >
> > drivers/media/usb/uvc/uvc_isight.c | 3 ++-
> > drivers/media/usb/uvc/uvc_metadata.c | 9 +++++++--
> > drivers/media/usb/uvc/uvc_queue.c | 18 ++++++++----------
> > drivers/media/usb/uvc/uvcvideo.h | 7 +++++--
> > 4 files changed, 22 insertions(+), 15 deletions(-)
> > ---
> > base-commit: a7da7fb57f2a787412da1a62292a17fa00fbfbdf
> > change-id: 20260309-uvc-metadata-dmabuf-b98359eec8dd
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-18 19:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 15:01 [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Ricardo Ribalda
2026-03-09 15:01 ` [PATCH 1/3] media: uvcvideo: Enable VB2_DMABUF for metadata stream Ricardo Ribalda
2026-03-16 11:47 ` Hans de Goede
2026-03-18 19:15 ` Laurent Pinchart
2026-03-16 12:05 ` [PATCH 0/3] media: uvcvideo: Improvements for UVC metadata Hans de Goede
2026-03-18 19:23 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox