[v4,8/8] include: uapi: bcm2835-isp: Drop legacy V4L2 controls
diff mbox series

Message ID 20261118-pi4-upstream-v4-8-93bdc7d925ba@ideasonboard.com
State New
Headers show
Series
  • Raspberry Pi: Update VC4 pipeline for mainline
Related show

Commit Message

Jai Luthra Nov. 18, 2026, 6:16 p.m. UTC
Now that the VC4 IPA and pipeline handler pass ISP configuration
exclusively through parameter buffers, the V4L2_CID_USER_BCM2835_ISP_*
custom controls are unused.

Drop them, and clean up the struct documentation that still referenced
the controls. Also sync with the latest header posted for mainline, and
move the header under the include/linux/media/broadcom subdirectory to
match.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 include/linux/{ => media/broadcom}/bcm2835-isp.h | 67 +++++++-----------------
 include/linux/v4l2-controls.h                    |  3 --
 include/linux/videodev2.h                        |  2 +-
 src/ipa/rpi/vc4/params.h                         |  2 +-
 src/ipa/rpi/vc4/vc4.cpp                          |  2 +-
 src/libcamera/control_ids_rpi.yaml               |  2 +-
 src/libcamera/pipeline/rpi/vc4/vc4.cpp           |  2 +-
 7 files changed, 24 insertions(+), 56 deletions(-)

Patch
diff mbox series

diff --git a/include/linux/bcm2835-isp.h b/include/linux/media/broadcom/bcm2835-isp.h
similarity index 86%
rename from include/linux/bcm2835-isp.h
rename to include/linux/media/broadcom/bcm2835-isp.h
index c49854cfa004..d15a4ed18404 100644
--- a/include/linux/bcm2835-isp.h
+++ b/include/linux/media/broadcom/bcm2835-isp.h
@@ -4,7 +4,7 @@ 
  *
  * BCM2835 ISP driver - user space header file.
  *
- * Copyright © 2019-2020 Raspberry Pi Ltd
+ * Copyright © 2019-2026 Raspberry Pi (Trading) Ltd.
  *
  * Author: Naushir Patuck (naush@raspberrypi.com)
  *
@@ -13,30 +13,11 @@ 
 #ifndef __BCM2835_ISP_H_
 #define __BCM2835_ISP_H_
 
-#include <linux/v4l2-controls.h>
 #include <linux/media/v4l2-isp.h>
 
-#define V4L2_CID_USER_BCM2835_ISP_CC_MATRIX	\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0001)
-#define V4L2_CID_USER_BCM2835_ISP_LENS_SHADING	\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0002)
-#define V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL	\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0003)
-#define V4L2_CID_USER_BCM2835_ISP_GEQ		\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0004)
-#define V4L2_CID_USER_BCM2835_ISP_GAMMA		\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0005)
-#define V4L2_CID_USER_BCM2835_ISP_DENOISE	\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0006)
-#define V4L2_CID_USER_BCM2835_ISP_SHARPEN	\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0007)
-#define V4L2_CID_USER_BCM2835_ISP_DPC		\
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0008)
-#define V4L2_CID_USER_BCM2835_ISP_CDN \
-				(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0009)
 /*
- * All structs below are directly mapped onto the equivalent structs in
- * drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
+ * All structs below are directly mapped from struct
+ * mmal_parameter_isp_parameters in include/linux/raspberrypi/mmal-parameters.h
  * for convenience.
  */
 
@@ -63,8 +44,7 @@  struct bcm2835_isp_ccm {
 };
 
 /**
- * struct bcm2835_isp_custom_ccm - Custom CCM applied with the
- *				   V4L2_CID_USER_BCM2835_ISP_CC_MATRIX ctrl.
+ * struct bcm2835_isp_custom_ccm - Custom CCM configuration.
  *
  * @enabled:	Enable custom CCM.
  * @ccm:	Custom CCM coefficients and offsets.
@@ -76,8 +56,7 @@  struct bcm2835_isp_custom_ccm {
 
 /**
  * enum bcm2835_isp_gain_format - format of the gains in the lens shading
- *				  tables used with the
- *				  V4L2_CID_USER_BCM2835_ISP_LENS_SHADING ctrl.
+ *				  tables.
  *
  * @GAIN_FORMAT_U0P8_1:		Gains are u0.8 format, starting at 1.0
  * @GAIN_FORMAT_U1P7_0:		Gains are u1.7 format, starting at 0.0
@@ -100,9 +79,7 @@  enum bcm2835_isp_gain_format {
 };
 
 /**
- * struct bcm2835_isp_lens_shading - Lens shading tables supplied with the
- *				     V4L2_CID_USER_BCM2835_ISP_LENS_SHADING
- *				     ctrl.
+ * struct bcm2835_isp_lens_shading - Lens shading tables.
  *
  * @enabled:		Enable lens shading.
  * @grid_cell_size:	Size of grid cells in samples (16, 32, 64, 128 or 256).
@@ -129,13 +106,13 @@  struct bcm2835_isp_lens_shading {
 };
 
 /**
- * struct bcm2835_isp_black_level - Sensor black level set with the
- *				    V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL ctrl.
+ * struct bcm2835_isp_black_level - Sensor black level configuration.
  *
  * @enabled:		Enable black level.
  * @black_level_r:	Black level for red channel.
  * @black_level_g:	Black level for green channels.
  * @black_level_b:	Black level for blue channel.
+ * @padding:		Unused padding.
  */
 struct bcm2835_isp_black_level {
 	__u32 enabled;
@@ -146,8 +123,7 @@  struct bcm2835_isp_black_level {
 };
 
 /**
- * struct bcm2835_isp_geq - Green equalisation parameters set with the
- *			    V4L2_CID_USER_BCM2835_ISP_GEQ ctrl.
+ * struct bcm2835_isp_geq - Green equalisation parameters.
  *
  * @enabled:	Enable green equalisation.
  * @offset:	Fixed offset of the green equalisation threshold.
@@ -162,13 +138,12 @@  struct bcm2835_isp_geq {
 #define BCM2835_NUM_GAMMA_PTS 33
 
 /**
- * struct bcm2835_isp_gamma - Gamma parameters set with the
- *			      V4L2_CID_USER_BCM2835_ISP_GAMMA ctrl.
+ * struct bcm2835_isp_gamma - Gamma parameters.
  *
  * @enabled:	Enable gamma adjustment.
- * @X:		X values of the points defining the gamma curve.
+ * @x:		X values of the points defining the gamma curve.
  *		Values should be scaled to 16 bits.
- * @Y:		Y values of the points defining the gamma curve.
+ * @y:		Y values of the points defining the gamma curve.
  *		Values should be scaled to 16 bits.
  */
 struct bcm2835_isp_gamma {
@@ -180,9 +155,9 @@  struct bcm2835_isp_gamma {
 /**
  * enum bcm2835_isp_cdn_mode - Mode of operation for colour denoise.
  *
-  * @CDN_MODE_FAST:		Fast (but lower quality) colour denoise
+ * @CDN_MODE_FAST:		Fast (but lower quality) colour denoise
  *				algorithm, typically used for video recording.
- * @CDN_HIGH_QUALITY:		High quality (but slower) colour denoise
+ * @CDN_MODE_HIGH_QUALITY:	High quality (but slower) colour denoise
  *				algorithm, typically used for stills capture.
  */
 enum bcm2835_isp_cdn_mode {
@@ -191,11 +166,10 @@  enum bcm2835_isp_cdn_mode {
 };
 
 /**
- * struct bcm2835_isp_cdn - Colour denoise parameters set with the
- *			    V4L2_CID_USER_BCM2835_ISP_CDN ctrl.
+ * struct bcm2835_isp_cdn - Colour denoise parameters.
  *
  * @enabled:	Enable colour denoise.
- * @cdn_mode:	Colour denoise operating mode (see enum &bcm2835_isp_cdn_mode)
+ * @mode:	Colour denoise operating mode (see enum &bcm2835_isp_cdn_mode)
  */
 struct bcm2835_isp_cdn {
 	__u32 enabled;
@@ -203,8 +177,7 @@  struct bcm2835_isp_cdn {
 };
 
 /**
- * struct bcm2835_isp_denoise - Denoise parameters set with the
- *				V4L2_CID_USER_BCM2835_ISP_DENOISE ctrl.
+ * struct bcm2835_isp_denoise - Denoise parameters.
  *
  * @enabled:	Enable denoise.
  * @constant:	Fixed offset of the noise threshold.
@@ -219,8 +192,7 @@  struct bcm2835_isp_denoise {
 };
 
 /**
- * struct bcm2835_isp_sharpen - Sharpen parameters set with the
- *				V4L2_CID_USER_BCM2835_ISP_SHARPEN ctrl.
+ * struct bcm2835_isp_sharpen - Sharpen parameters.
  *
  * @enabled:	Enable sharpening.
  * @threshold:	Threshold at which to start sharpening pixels.
@@ -248,8 +220,7 @@  enum bcm2835_isp_dpc_mode {
 };
 
 /**
- * struct bcm2835_isp_dpc - Defective pixel correction (DPC) parameters set
- *			    with the V4L2_CID_USER_BCM2835_ISP_DPC ctrl.
+ * struct bcm2835_isp_dpc - Defective pixel correction (DPC) parameters.
  *
  * @enabled:	Enable DPC.
  * @strength:	DPC strength (see enum &bcm2835_isp_dpc_mode).
diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
index c0d9cab3c71e..aff5280b63cc 100644
--- a/include/linux/v4l2-controls.h
+++ b/include/linux/v4l2-controls.h
@@ -178,9 +178,6 @@  enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_CCS_BASE			(V4L2_CID_USER_BASE + 0x10f0)
 
-/* The base for the bcm2835-isp driver controls.
- * We reserve 16 controls for this driver. */
-#define V4L2_CID_USER_BCM2835_ISP_BASE		(V4L2_CID_USER_BASE + 0x10e0)
 /*
  * The base for Allegro driver controls.
  * We reserve 16 controls for this driver.
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 60133dcf90f5..e14c78ed51b2 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -844,7 +844,7 @@  struct v4l2_pix_format {
 #define V4L2_META_FMT_UVC_MSXU_1_5  v4l2_fourcc('U', 'V', 'C', 'M') /* UVC MSXU metadata */
 #define V4L2_META_FMT_VIVID	  v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
 #define V4L2_META_FMT_SENSOR_DATA v4l2_fourcc('S', 'E', 'N', 'S') /* Sensor Ancillary metadata */
-#define V4L2_META_FMT_BCM2835_ISP_STATS v4l2_fourcc('B', 'S', 'T', 'A') /* BCM2835 ISP image statistics output */
+#define V4L2_META_FMT_BCM2835_ISP_STATS v4l2_fourcc('B', 'S', 'T', 'A') /* BCM2835 ISP stats */
 #define V4L2_META_FMT_BCM2835_ISP_PARAMS v4l2_fourcc('B', 'C', 'M', 'P') /* BCM2835 ISP params */
 
 /* Vendor specific - used for RK_ISP1 camera sub-system */
diff --git a/src/ipa/rpi/vc4/params.h b/src/ipa/rpi/vc4/params.h
index 3eb7794e7c79..d7b9c668dae4 100644
--- a/src/ipa/rpi/vc4/params.h
+++ b/src/ipa/rpi/vc4/params.h
@@ -9,7 +9,7 @@ 
 
 #include <stdint.h>
 
-#include <linux/bcm2835-isp.h>
+#include <linux/media/broadcom/bcm2835-isp.h>
 
 #include <libipa/v4l2_params.h>
 
diff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp
index e1075235f663..eaa589cfb702 100644
--- a/src/ipa/rpi/vc4/vc4.cpp
+++ b/src/ipa/rpi/vc4/vc4.cpp
@@ -10,7 +10,7 @@ 
 #include <string.h>
 #include <sys/mman.h>
 
-#include <linux/bcm2835-isp.h>
+#include <linux/media/broadcom/bcm2835-isp.h>
 
 #include <libcamera/base/log.h>
 #include <libcamera/control_ids.h>
diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml
index 31a1356415df..9a03c1b515a3 100644
--- a/src/libcamera/control_ids_rpi.yaml
+++ b/src/libcamera/control_ids_rpi.yaml
@@ -28,7 +28,7 @@  controls:
 
         This is sent in the Request metadata if the StatsOutputEnable is set to
         true.  The statistics struct definition can be found in
-        include/linux/bcm2835-isp.h.
+        include/linux/media/broadcom/bcm2835-isp.h.
 
         \sa StatsOutputEnable
 
diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index a84cd0107764..c419337f895f 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -7,7 +7,7 @@ 
 
 #include <memory>
 
-#include <linux/bcm2835-isp.h>
+#include <linux/media/broadcom/bcm2835-isp.h>
 #include <linux/v4l2-controls.h>
 #include <linux/videodev2.h>