From patchwork Wed Nov 18 18:16:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 29036 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 41CFFC3355 for ; Wed, 18 Nov 2026 18:18:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E03BA6A92E; Wed, 18 Nov 2026 19:18:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OmIrKLGc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 010146A90F for ; Wed, 18 Nov 2026 19:18:33 +0100 (CET) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c67:cdf:7464:6c04:36e4:ee87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A5FD34; Wed, 18 Nov 2026 19:16:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1795025764; bh=fq0sEZd6urvSGaK8+0hogu0k0NCNnkIl/AJfv2213pk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OmIrKLGcJI5oEe/uBWzAvwA04esgirJ9kbHa/zPYigCBZk1aM5/23ugCc7YJbNp+S vA9Vtx187ppFHxvl81TM5lfo8kPk81HA4eRI5ZiLnr7wZnRaky1+1EBuPGwv8L2GRp CcbN+/5Aa+PyBMubgMN+TuZO5WBbx/KkLDu6KuUY= From: Jai Luthra Date: Wed, 18 Nov 2026 23:46:58 +0530 Subject: [PATCH v4 8/8] include: uapi: bcm2835-isp: Drop legacy V4L2 controls MIME-Version: 1.0 Message-Id: <20261118-pi4-upstream-v4-8-93bdc7d925ba@ideasonboard.com> References: <20261118-pi4-upstream-v4-0-93bdc7d925ba@ideasonboard.com> In-Reply-To: <20261118-pi4-upstream-v4-0-93bdc7d925ba@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart , Kieran Bingham , Paul Elder , Jacopo Mondi , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=10774; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=fq0sEZd6urvSGaK8+0hogu0k0NCNnkIl/AJfv2213pk=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBq/evLLq/XT9VBQildHP/XTEsfTgE+TZwFOIYlO JLeYoE5/BSJAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCav3rywAKCRBD3pH5JJpx RYnREACLFhDGi6EuzySJiayNABZF6bw0oHCl3JcQI8rB8QQTNIJsOYbD6DcSs/7J7hI7gAN/n8J ANSPcE9CA9BISgl0j2QXgm3ePtqqXYe+0E42cK9NZBHe+71AKbIB/C8oUvu4aciYR+hC3655d2c GmQiCkyLmL2q3oATEB5NBY+EtC9ivFz9O3w4tM8EmqpSrtvyFQ5R6RHzdoOwvseclltLeqTu+Bh QsP6S961xz087tgxvJCDGhYS6u4vNVMDasFfGgqNwyIU5zDuDRK71NzIsKUBQV/pWOAr/Zafse3 BIt+vnAH3vCwzjgcf3uKY2TyJJ0HpDcylZBx6BdWRbgiFFrLTLvSjJkbjU+ONt3SRKH4Z5pVkHB 8Pcr8QpsJrGkEiU0KG60TODt9Iw5NNzlVkCF4IXhNUlCxPSafVozq6I6NDvFRMjGyMt7fbuHtSx ihpyBm5RK+YaTH5jmKRlAii/2rUaeiMd+SJA/84pM+3NLD1jInF9iNwGv4o3pUztWTFIgJbtthX eK50RYa7vuM2D3y9vgfX1ug3gsYEbfM+v00oKc1NLysyy/SWOplKUnAgSg4KDQY9RlbtpCuUCQa Hd3zPItPC6aITCGbYj9MctqI3TsTFhRglbBPG5kdnexUDwKOgutevGHPPbxxMLnhDuuRNH/7VGI rYTRsdK/0Bc126Q== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Tested-by: Paul Elder Signed-off-by: Jai Luthra --- 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(-) 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 #include -#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 -#include +#include #include 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 #include -#include +#include #include #include 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 -#include +#include #include #include