Skip to contentSkip to conversation

media: vim2m: give vim2m a proper control ID range

PATCH In review Hans Verkuil 2 participants 2 messages Sep 8 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: vim2m: give vim2m a proper control ID range

The vim2m driver has two driver-specific controls, but the control IDs were never reserved in v4l2-control.h.

While these control IDs clashes with the range reserved for the old meye driver, since that meye driver has been removed from the kernel quite a long time ago we just officially claim that range for the vim2m driver.

---
 drivers/media/test-drivers/vim2m.c | 4 ++--
 include/uapi/linux/v4l2-controls.h | 9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/media/test-drivers/vim2m.c +2 -2
index bb2dd11eef0e..b16111067f68 100644
@@ -150,8 +150,8 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
-#define V4L2_CID_TRANS_TIME_MSEC	(V4L2_CID_USER_BASE + 0x1000)
-#define V4L2_CID_TRANS_NUM_BUFS		(V4L2_CID_USER_BASE + 0x1001)
+#define V4L2_CID_TRANS_TIME_MSEC	(V4L2_CID_USER_VIM2M_BASE + 0)
+#define V4L2_CID_TRANS_NUM_BUFS		(V4L2_CID_USER_VIM2M_BASE + 1)
 
 static struct vim2m_fmt *find_format(u32 fourcc)
 {
include/uapi/linux/v4l2-controls.h +9 -0
index affec0ab4781..9e3a59638287 100644
@@ -123,6 +123,15 @@ enum v4l2_colorfx {
 #define V4L2_CID_USER_MEYE_BASE			(V4L2_CID_USER_BASE + 0x1000)
 #endif
 
+/*
+ * The base for the vim2m driver controls.
+ * We reserve 16 controls for this driver.
+ * The vim2m control range clashed with the meye control range, which was not
+ * intended, but since the meye driver has been removed, we can just keep the
+ * vim2m control range.
+ */
+#define V4L2_CID_USER_VIM2M_BASE		(V4L2_CID_USER_BASE + 0x1000)
+
 /* The base for the bttv driver controls.
  * We reserve 32 controls for this driver. */
 #define V4L2_CID_USER_BTTV_BASE			(V4L2_CID_USER_BASE + 0x1010)
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw

Le mardi 08 septembre 2026 à 12:10 +0200, Hans Verkuil a écrit :

Quoted 10 lines

The vim2m driver has two driver-specific controls, but the control IDs were never reserved in v4l2-control.h.

While these control IDs clashes with the range reserved for the old meye driver, since that meye driver has been removed from the kernel quite a long time ago we just officially claim that range for the vim2m driver.

Quoted 41 lines
---
 drivers/media/test-drivers/vim2m.c | 4 ++--
 include/uapi/linux/v4l2-controls.h | 9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/media/test-drivers/vim2m.c +2 -2
index bb2dd11eef0e..b16111067f68 100644
@@ -150,8 +150,8 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
-#define V4L2_CID_TRANS_TIME_MSEC	(V4L2_CID_USER_BASE + 0x1000)
-#define V4L2_CID_TRANS_NUM_BUFS		(V4L2_CID_USER_BASE + 0x1001)
+#define V4L2_CID_TRANS_TIME_MSEC	(V4L2_CID_USER_VIM2M_BASE + 0)
+#define V4L2_CID_TRANS_NUM_BUFS		(V4L2_CID_USER_VIM2M_BASE + 1)
 
 static struct vim2m_fmt *find_format(u32 fourcc)
 {
include/uapi/linux/v4l2-controls.h +9 -0
index affec0ab4781..9e3a59638287 100644
@@ -123,6 +123,15 @@ enum v4l2_colorfx {
 #define V4L2_CID_USER_MEYE_BASE			(V4L2_CID_USER_BASE + 0x1000)
 #endif
 
+/*
+ * The base for the vim2m driver controls.
+ * We reserve 16 controls for this driver.
+ * The vim2m control range clashed with the meye control range, which was not
+ * intended, but since the meye driver has been removed, we can just keep the
+ * vim2m control range.
+ */
+#define V4L2_CID_USER_VIM2M_BASE		(V4L2_CID_USER_BASE + 0x1000)
+
 /* The base for the bttv driver controls.
  * We reserve 32 controls for this driver. */
 #define V4L2_CID_USER_BTTV_BASE			(V4L2_CID_USER_BASE + 0x1010)