Skip to contentSkip to conversation

media: Kconfig: Don't expose API options

PATCH In review Ezequiel Garcia 3 participants 6 messages Apr 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: Kconfig: Don't expose API options

There is no need to expose API options; instead, drivers that support a given API are expected to just select it.

Happily, this is currently the case, so simply stop exposing the options.

---
 drivers/media/Kconfig           | 2 +-
 drivers/media/mc/Kconfig        | 3 +--
 drivers/media/v4l2-core/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/media/Kconfig +1 -1
index a8def1591352..eef4c6761ffb 100644
@@ -173,7 +173,7 @@ config VIDEO_DEV
 	  radio devices and by some input devices.
 
 config MEDIA_CONTROLLER
-	bool "Media Controller API"
+	bool
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
 	help
 	  Enable the media controller API used to query media devices internal
drivers/media/mc/Kconfig +1 -2
index 002a918c4c75..0cdf885ce24d 100644
@@ -2,7 +2,6 @@
 
 #
 # Media controller
-#	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
 config MEDIA_CONTROLLER_DVB
@@ -14,7 +13,7 @@ config MEDIA_CONTROLLER_DVB
 	  This is currently experimental.
 
 config MEDIA_CONTROLLER_REQUEST_API
-	bool "Enable Media controller Request API (EXPERIMENTAL)"
+	bool
 	depends on MEDIA_CONTROLLER && STAGING_MEDIA
 	help
 	  DO NOT ENABLE THIS OPTION UNLESS YOU KNOW WHAT YOU'RE DOING.
drivers/media/v4l2-core/Kconfig +1 -1
index 3fa75352d04c..d034185856bb 100644
@@ -17,7 +17,7 @@ config VIDEO_V4L2_I2C
 	default y
 
 config VIDEO_V4L2_SUBDEV_API
-	bool "V4L2 sub-device userspace API"
+	bool
 	depends on VIDEO_DEV && MEDIA_CONTROLLER
 	help
 	  Enables the V4L2 sub-device pad-level userspace API used to configure
Signature · 1 line
2.26.0.rc2
#1 lore raw

Em Tue, 14 Apr 2020 10:02:10 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 18 lines

There is no need to expose API options; instead, drivers that support a given API are expected to just select it.

Happily, this is currently the case, so simply stop exposing the options.

---
 drivers/media/Kconfig           | 2 +-
 drivers/media/mc/Kconfig        | 3 +--
 drivers/media/v4l2-core/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/media/Kconfig +0 -0
index a8def1591352..eef4c6761ffb 100644

drivers/media/Kconfig config VIDEO_DEV · line 176

Quoted 5 lines
drivers/media/Kconfig +1 -1
@@ -173,7 +173,7 @@ config VIDEO_DEV
 	  radio devices and by some input devices.
 
 config MEDIA_CONTROLLER
-	bool "Media Controller API"
+	bool

This is not true here... non-embedded drivers like DVB and UVC can work with or without the media controller. For them, the API is experimental.

Quoted 16 lines
drivers/media/Kconfig +0 -0
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
 	help
 	  Enable the media controller API used to query media devices internal
drivers/media/mc/Kconfig +0 -1
index 002a918c4c75..0cdf885ce24d 100644
@@ -2,7 +2,6 @@
 
 #
 # Media controller
-#	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
 config MEDIA_CONTROLLER_DVB

drivers/media/mc/Kconfig config MEDIA_CONTROLLER_DVB · line 16

Quoted 5 lines
drivers/media/mc/Kconfig +1 -1
@@ -14,7 +13,7 @@ config MEDIA_CONTROLLER_DVB
 	  This is currently experimental.
 
 config MEDIA_CONTROLLER_REQUEST_API
-	bool "Enable Media controller Request API (EXPERIMENTAL)"
+	bool

This sounds OK.

The only reason why I didn't make this change is because of the "EXPERIMENTAL" warning.

At least while this API is considered experimental, it sounds wise to have a warning.

Perhaps we could apply this hunk, and add something like this to media/Kconfig:

comment "Please notice that the enabled Media controller Request API is EXPERIMENTAL"
depends on MEDIA_CONTROLLER_REQUEST_API

Regards,
Mauro

Quoted 8 lines
drivers/media/mc/Kconfig +0 -0
 	depends on MEDIA_CONTROLLER && STAGING_MEDIA
 	help
 	  DO NOT ENABLE THIS OPTION UNLESS YOU KNOW WHAT YOU'RE DOING.
drivers/media/v4l2-core/Kconfig +0 -0
index 3fa75352d04c..d034185856bb 100644

drivers/media/v4l2-core/Kconfig config VIDEO_V4L2_I2C · line 23

Quoted 8 lines
drivers/media/v4l2-core/Kconfig +1 -1
@@ -17,7 +17,7 @@ config VIDEO_V4L2_I2C
 	default y
 
 config VIDEO_V4L2_SUBDEV_API
-	bool "V4L2 sub-device userspace API"
+	bool
 	depends on VIDEO_DEV && MEDIA_CONTROLLER
 	help
 	  Enables the V4L2 sub-device pad-level userspace API used to configure

Thanks,
Mauro

#2 lore raw

Em Tue, 14 Apr 2020 15:21:47 +0200
Mauro Carvalho Chehab <[email protected]> escreveu:

Quoted 23 lines

Em Tue, 14 Apr 2020 10:02:10 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 20 lines

There is no need to expose API options; instead, drivers that support a given API are expected to just select it.

Happily, this is currently the case, so simply stop exposing the options.

---
 drivers/media/Kconfig           | 2 +-
 drivers/media/mc/Kconfig        | 3 +--
 drivers/media/v4l2-core/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/media/Kconfig +0 -0
index a8def1591352..eef4c6761ffb 100644
@@ -173,7 +173,7 @@ config VIDEO_DEV
 	  radio devices and by some input devices.
 
Quoted 6 lines

drivers/media/Kconfig config VIDEO_DEV · line 176

Quoted 3 lines
drivers/media/Kconfig +1 -1
 config MEDIA_CONTROLLER
-	bool "Media Controller API"
+	bool  

This is not true here... non-embedded drivers like DVB and UVC can work with or without the media controller. For them, the API is experimental.

Heh.... I meant to say:

For them, the API is ***optional***.

Thanks,
Mauro

#3 lore raw
In reply to Mauro Carvalho Chehab
Quoted 23 lines · Mauro Carvalho Chehab

Em Tue, 14 Apr 2020 10:02:10 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 20 lines

There is no need to expose API options; instead, drivers that support a given API are expected to just select it.

Happily, this is currently the case, so simply stop exposing the options.

---
 drivers/media/Kconfig           | 2 +-
 drivers/media/mc/Kconfig        | 3 +--
 drivers/media/v4l2-core/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/media/Kconfig +0 -0
index a8def1591352..eef4c6761ffb 100644
@@ -173,7 +173,7 @@ config VIDEO_DEV
 	  radio devices and by some input devices.
 
Quoted 7 lines

drivers/media/Kconfig config VIDEO_DEV · line 176

Quoted 3 lines
drivers/media/Kconfig +1 -1
 config MEDIA_CONTROLLER
-	bool "Media Controller API"
+	bool

This is not true here... non-embedded drivers like DVB and UVC can work with or without the media controller. For them, the API is experimental.

Fair enough.

Quoted 27 lines
Quoted 16 lines
drivers/media/Kconfig +0 -0
 	default MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_PLATFORM_SUPPORT
 	help
 	  Enable the media controller API used to query media devices internal
drivers/media/mc/Kconfig +0 -1
index 002a918c4c75..0cdf885ce24d 100644
@@ -2,7 +2,6 @@
 
 #
 # Media controller
-#	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
 config MEDIA_CONTROLLER_DVB

drivers/media/mc/Kconfig config MEDIA_CONTROLLER_DVB · line 16

Quoted 5 lines
drivers/media/mc/Kconfig +1 -1
@@ -14,7 +13,7 @@ config MEDIA_CONTROLLER_DVB
 	  This is currently experimental.
 
 config MEDIA_CONTROLLER_REQUEST_API
-	bool "Enable Media controller Request API (EXPERIMENTAL)"
+	bool

This sounds OK.

The only reason why I didn't make this change is because of the "EXPERIMENTAL" warning.

Quoted 9 lines

At least while this API is considered experimental, it sounds wise to have a warning.

Perhaps we could apply this hunk, and add something like this to media/Kconfig:

comment "Please notice that the enabled Media controller Request API is EXPERIMENTAL"
depends on MEDIA_CONTROLLER_REQUEST_API

Let me post a separate patch, since I believe we also need to select the request API on the test drivers that use it.

Thanks,
Ezequiel

#4 lore raw

PATCH 1/1 media: Kconfig: Don't expose the Request API option

In reply to Ezequiel Garcia

The Request API isn't meant to be chosen by users, but instead should be selected by drivers that want to support it.

Hantro and Cedrus are already selecting the right options, so only the test drivers need to be fixed.

---
 drivers/media/mc/Kconfig                   | 6 ++++--
 drivers/media/test_drivers/Kconfig         | 2 ++
 drivers/media/test_drivers/vicodec/Kconfig | 2 ++
 drivers/media/test_drivers/vivid/Kconfig   | 2 ++
 4 files changed, 10 insertions(+), 2 deletions(-)
drivers/media/mc/Kconfig +4 -2
index 002a918c4c75..7c9628f37196 100644
@@ -2,7 +2,6 @@
 
 #
 # Media controller
-#	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
 config MEDIA_CONTROLLER_DVB
@@ -14,7 +13,7 @@ config MEDIA_CONTROLLER_DVB
 	  This is currently experimental.
 
 config MEDIA_CONTROLLER_REQUEST_API
-	bool "Enable Media controller Request API (EXPERIMENTAL)"
+	bool
 	depends on MEDIA_CONTROLLER && STAGING_MEDIA
 	help
 	  DO NOT ENABLE THIS OPTION UNLESS YOU KNOW WHAT YOU'RE DOING.
@@ -24,3 +23,6 @@ config MEDIA_CONTROLLER_REQUEST_API
 
 	  There is currently no intention to provide API or ABI stability for
 	  this new API as of yet.
+
+comment "Please notice that the enabled Media controller Request API is EXPERIMENTAL"
+	depends on MEDIA_CONTROLLER_REQUEST_API
drivers/media/test_drivers/Kconfig +2 -0
index 9f4a9cfbacc9..d62d974138e4 100644
@@ -17,6 +17,8 @@ config VIDEO_VIM2M
 	depends on VIDEO_DEV && VIDEO_V4L2
 	select VIDEOBUF2_VMALLOC
 	select V4L2_MEM2MEM_DEV
+	select MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER_REQUEST_API
 	help
 	  This is a virtual test device for the memory-to-memory driver
 	  framework.
drivers/media/test_drivers/vicodec/Kconfig +2 -0
index 89456665cb16..d77c67810c73 100644
@@ -4,6 +4,8 @@ config VIDEO_VICODEC
 	depends on VIDEO_DEV && VIDEO_V4L2
 	select VIDEOBUF2_VMALLOC
 	select V4L2_MEM2MEM_DEV
+	select MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER_REQUEST_API
 	help
 	  Driver for a Virtual Codec
 
drivers/media/test_drivers/vivid/Kconfig +2 -0
index e2ff06edfa93..c3abde2986b2 100644
@@ -11,6 +11,8 @@ config VIDEO_VIVID
 	select VIDEOBUF2_VMALLOC
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEO_V4L2_TPG
+	select MEDIA_CONTROLLER
+	select MEDIA_CONTROLLER_REQUEST_API
 	help
 	  Enables a virtual video driver. This driver emulates a webcam,
 	  TV, S-Video and HDMI capture hardware, including VBI support for
Signature · 1 line
2.26.0.rc2
#5 lore raw

Re: [PATCH] media: Kconfig: Don't expose the Request API option

Em Tue, 14 Apr 2020 19:06:24 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 28 lines

The Request API isn't meant to be chosen by users, but instead should be selected by drivers that want to support it.

Hantro and Cedrus are already selecting the right options, so only the test drivers need to be fixed.

---
 drivers/media/mc/Kconfig                   | 6 ++++--
 drivers/media/test_drivers/Kconfig         | 2 ++
 drivers/media/test_drivers/vicodec/Kconfig | 2 ++
 drivers/media/test_drivers/vivid/Kconfig   | 2 ++
 4 files changed, 10 insertions(+), 2 deletions(-)
drivers/media/mc/Kconfig +0 -1
index 002a918c4c75..7c9628f37196 100644
@@ -2,7 +2,6 @@
 
 #
 # Media controller
-#	Selectable only for webcam/grabbers, as other drivers don't use it
 #
 
 config MEDIA_CONTROLLER_DVB

drivers/media/mc/Kconfig config MEDIA_CONTROLLER_DVB · line 19

Quoted 8 lines
drivers/media/mc/Kconfig +1 -1
@@ -14,7 +13,7 @@ config MEDIA_CONTROLLER_DVB
 	  This is currently experimental.
 
 config MEDIA_CONTROLLER_REQUEST_API
-	bool "Enable Media controller Request API (EXPERIMENTAL)"
+	bool
 	depends on MEDIA_CONTROLLER && STAGING_MEDIA
 	help
 	  DO NOT ENABLE THIS OPTION UNLESS YOU KNOW WHAT YOU'RE DOING.

Hmm... I guess you can also remove the help here, as it won't be shown anymore with make menuconfig.

Thanks,
Mauro