]> git.ipfire.org Git - thirdparty/linux.git/commit
media: uvcvideo: Allow userspace to increase the meta buffersize
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 9 Mar 2026 15:01:56 +0000 (15:01 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 25 Mar 2026 08:40:28 +0000 (09:40 +0100)
commit2ac27db04608a7ce4d46a3bf23d2262c7b20db38
tree572fd1194db32c486e088ef41fd05ee7108b38d8
parent33dd4bb261bd4e539551d60511574cd64845bf84
media: uvcvideo: Allow userspace to increase the meta buffersize

Now we have the metadata size hardcoded to 10 KiB, this is a value that
works fine for bulk cameras or frames with no extra metadata. But not
for all usecases.

We have seen some cameras that produce more metadata per frame. Eg:
Frame 1 captured (Bytes: 11154)
Frame 2 captured (Bytes: 11616)
Frame 3 captured (Bytes: 11374)
Frame 4 captured (Bytes: 11132)
Frame 5 captured (Bytes: 11594)
Frame 6 captured (Bytes: 11352)
Frame 7 captured (Bytes: 11110)
Frame 8 captured (Bytes: 11572)
Frame 9 captured (Bytes: 11308)

When this happens, the driver (correctly) marks the metadata as ERROR.

This patch let userspace set bigger buffersize via S_FMT.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20260309-uvc-metadata-dmabuf-v1-3-fc8b87bd29c5@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/usb/uvc/uvc_metadata.c
drivers/media/usb/uvc/uvc_queue.c
drivers/media/usb/uvc/uvcvideo.h