Commit c93d73c9 authored by Hans Verkuil's avatar Hans Verkuil
Browse files

media: uvcvideo: Use vb2 ioctl and fop helpers



When uvc was written the vb2 ioctl and file operation helpers didn't exist.

This patch switches uvc over to those helpers, which removes a lot of
boilerplate code and allows us to drop the 'privileges' scheme, since
that's now handled inside the vb2 helpers.

This makes it possible for uvc to fix the v4l2-compliance streaming tests:
 warn: v4l2-test-formats.cpp(1075): Could not set fmt2

This patch introduces a change on behavior on the uvcdriver to be
aligned with the rest of the subsystem. Now S_INPUT, S_PARM and
S_FORMAT do no grant exclusive ownership of the device.

There are other side effects, some better than others:
- Locking is now more coarse than before, the queue is locked for almost
  every ioctl.
- vidioc_querybuf() can now work when the queue is busy.

Future patches should look into the locking architecture of UVC to
remove one of stream->mutex or queue->mutex.

Reviewed-by: default avatarHans de Goede <hansg@kernel.org>
Reviewed-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Co-developed-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20250616-uvc-fop-v4-1-250286570ee7@chromium.org


Signed-off-by: default avatarHans de Goede <hansg@kernel.org>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
parent cee06ca7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment