Skip to content

media: uvcvideo: Map known XU controls

Ricardo Ribalda linux-media linux-usb lkml 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20251117-uvcdynctrl-7b80f5bfbb41

Versions newest first

  1. v3 Latest4 patches 15 repliesIn review
  2. v26 patches 14 repliesSuperseded
  3. v14 patches 18 repliesSuperseded

Changes in v3 from the cover letter

- s/param/module parameter/ (Thanks HdG)
- Rebase to lastest media-committers/next and remove merged patches.
- Link to v2: https://lore.kernel.org/r/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4media: uvcvideo: Import standard controls from uvcdynctrldrivers/media/usb/uvc/uvc_ctrl.c include/linux/usb/uvc.h+180 -01 reply
2/4media: uvcvideo: Announce deprecation intentions for UVCIOC_CTRL_MAPDocumentation/userspace-api/media/drivers/uvcvideo.rst drivers/media/usb/uvc/uvc_v4l2.c+6 -01 reply
3/4media: uvcvideo: Introduce allow_privacy_override module parameterdrivers/media/usb/uvc/uvc_ctrl.c drivers/media/usb/uvc/uvc_driver.c drivers/media/usb/uvc/uvc_v4l2.c +2 more+71 -09 replies
4/4media: uvcvideo: RFC: Convert allow_privacy_override into Kconfigdrivers/media/usb/uvc/Kconfig drivers/media/usb/uvc/uvc_ctrl.c drivers/media/usb/uvc/uvc_driver.c +2 more+15 -254 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchLaurent Pinchart
1/4R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] media: uvcvideo: Map known XU controls

The UVC driver uses a custom ioctl UVCIOC_CTRL_MAP to map XU controls into v4l2 controls. The most well know user of this feature is the uvcdynctrl app.

This app has a set of XML files which contains the list of mappings. Some of these mappings are standard and other ones are custom.

This series move the standard mappings to the kernel driver, so userspace do not need to depend on external apps to use them.

While we are at it we realized that some of the mappings can be harmful for the privacy of the user. This series introduce a mechanism to block those mappings.

While we are at it, we complete the deprecation of the nodrop parameter. Ideally, this patch should belong in a different series, but then we will have conflicts... and who wants to works twice?

I have tried this series with a Logitech Webcam Pro 9000, that has been donated by Hans de Goede (Thanks Hans!!!).

Without this patch and uvcdynctrl the device has 14 controls. (Ctrls A)

With this patch the device has 15 controls (Ctrls B):
Ctrls A
+
control 0x009a090a `Focus, Absolute' min 0 max 255 step 0 default 0 current 0

With uvcdynctrl and this patch the device has 17 controls (Ctrls C):
Ctrls B
+
control 0x0a046d71 Disable video processing' min 0 max 1 step 1 default 0 current 0 control 0x0a046d72 Raw bits per pixel' min 0 max 1 step 1 default 0 current 0

With uvcdynctrl and without this patch the device has 19 controls:
Ctrls C
+
control 0x0a046d05 `LED1 Mode' min 0 max 3 step 1 default 3 current 3
0: Off
1: On
2: Blinking
3: Auto (*)
control 0x0a046d06 `LED1 Frequency' min 0 max 255 step 1 default 0 current 0

BTW, Driver tested with virtme-ng. First time that I use it for uvc development, and it works like a charm :).

virtme-run --kimg arch/x86/boot/bzImage --mods auto --show-command \
	--show-boot-console --verbose --qemu-opts -usb -device qemu-xhci \
	-device usb-host,hostbus=1,hostport=4

---
Changes in v3:
- s/param/module parameter/ (Thanks HdG)
- Rebase to lastest media-committers/next and remove merged patches.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Document how to get GUIDs
- Show clear deprecation intentions to the user.
- Add new patch for the Kconfig approach (Thanks Mauro).
- Remove duplicated control in commit message, provide background and
add documentation. (Thanks Laurent)
- Block also uvc_query_ctrl for privacy controls (Thanks Gergo Koteles)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Ricardo Ribalda (4):
media: uvcvideo: Import standard controls from uvcdynctrl
media: uvcvideo: Announce deprecation intentions for UVCIOC_CTRL_MAP
media: uvcvideo: Introduce allow_privacy_override module parameter
media: uvcvideo: RFC: Convert allow_privacy_override into Kconfig

 .../userspace-api/media/drivers/uvcvideo.rst       |   2 +
 drivers/media/usb/uvc/Kconfig                      |  11 ++
 drivers/media/usb/uvc/uvc_ctrl.c                   | 212 +++++++++++++++++++++
 drivers/media/usb/uvc/uvc_v4l2.c                   |  11 ++
 drivers/media/usb/uvc/uvcvideo.h                   |   1 +
 include/linux/usb/uvc.h                            |  10 +
 6 files changed, 247 insertions(+)

---
base-commit: f6390408a846aacc2171c17d88b062e202d84e86
change-id: 20251117-uvcdynctrl-7b80f5bfbb41

Best regards,

Signature · 1 line
Ricardo Ribalda <[email protected]>