Show a patch.

GET /api/1.1/patches/24082/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 24082,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24082/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24082/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20250808141315.413839-12-stefan.klug@ideasonboard.com>",
    "date": "2025-08-08T14:12:49",
    "name": "[v2,11/16] include: linux: Partially update linux headers from v6.16-rc1-310-gd968e50b5c26",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a03a5bcb25b1d6d2ce330f4f3c8ea5cbc66d83ac",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24082/mbox/",
    "series": [
        {
            "id": 5364,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5364/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5364",
            "date": "2025-08-08T14:12:38",
            "name": "Implement WDR algorithm",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5364/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24082/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24082/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9CA81BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Aug 2025 14:14:17 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5000A69234;\n\tFri,  8 Aug 2025 16:14:17 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDBB569232\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Aug 2025 16:14:15 +0200 (CEST)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:3ea1:35ac:90da:a221])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E0E95208E; \n\tFri,  8 Aug 2025 16:13:25 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HeoeGsJc\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1754662406;\n\tbh=XFTWEkGkyqYGTfqhC6w4yCohY2TSg7Hb0bYBuc4aUfE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=HeoeGsJciLcu+iA6XZBjE//oQ5FvzWCuzMR/mjj+KniNoivm+VlcdtyJ65kViYRBj\n\t8g/+bEwvOGVI9d7sHA2EK8mZLA6dLj3pj/JmC6GEmpizoUrScJ2rXEWWImMVNUq7VP\n\tI+1juRn8U+WQBW1mpnl6v8cxRu0fx8iZ58hM4S+E=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v2 11/16] include: linux: Partially update linux headers from\n\tv6.16-rc1-310-gd968e50b5c26",
        "Date": "Fri,  8 Aug 2025 16:12:49 +0200",
        "Message-ID": "<20250808141315.413839-12-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.48.1",
        "In-Reply-To": "<20250808141315.413839-1-stefan.klug@ideasonboard.com>",
        "References": "<20250808141315.413839-1-stefan.klug@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Update rkisp1-config.h and v4l2-controls.h from the next branch of\nhttps://gitlab.freedesktop.org/linux-media/media-committers.git to\ninclude the WDR related updates. The rest was left as is to minimize the\nrisk of issues due to last minute changes in the upstream process.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\n\nChanges in v2:\n- Updated headers from linux-media next branch\n---\n include/linux/rkisp1-config.h | 108 +++++++++++++++++++++++++++++++++-\n include/linux/v4l2-controls.h |  17 ++++--\n 2 files changed, 119 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\nindex edbc6cb65d1c..d323bfa72d8e 100644\n--- a/include/linux/rkisp1-config.h\n+++ b/include/linux/rkisp1-config.h\n@@ -169,6 +169,13 @@\n  */\n #define RKISP1_CIF_ISP_COMPAND_NUM_POINTS\t64\n \n+/*\n+ * Wide Dynamic Range\n+ */\n+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV\t32\n+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF\t(RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV + 1)\n+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS\t4\n+\n /*\n  * Measurement types\n  */\n@@ -889,6 +896,72 @@ struct rkisp1_cif_isp_compand_curve_config {\n \t__u32 y[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];\n };\n \n+/**\n+ * struct rkisp1_cif_isp_wdr_tone_curve - Tone mapping curve definition for WDR.\n+ *\n+ * @dY: the dYn increments for horizontal (input) axis of the tone curve.\n+ *      each 3-bit dY value represents an increment of 2**(value+3).\n+ *      dY[0] bits 0:2 is increment dY1, bit 3 unused\n+ *      dY[0] bits 4:6 is increment dY2, bit 7 unused\n+ *      ...\n+ *      dY[0] bits 28:30 is increment dY8, bit 31 unused\n+ *      ... and so on till dY[3] bits 28:30 is increment dY32, bit 31 unused.\n+ * @ym: the Ym values for the vertical (output) axis of the tone curve.\n+ *      each value is 13 bit.\n+ */\n+struct rkisp1_cif_isp_wdr_tone_curve {\n+\t__u32 dY[RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS];\n+\t__u16 ym[RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF];\n+};\n+\n+/**\n+ * struct rkisp1_cif_isp_wdr_iref_config - Illumination reference config for WDR.\n+ *\n+ * Use illumination reference value as described below, instead of only the\n+ * luminance (Y) value for tone mapping and gain calculations:\n+ * IRef = (rgb_factor * RGBMax_tr + (8 - rgb_factor) * Y)/8\n+ *\n+ * @rgb_factor: defines how much influence the RGBmax approach has in\n+ *              comparison to Y (valid values are 0..8).\n+ * @use_y9_8: use Y*9/8 for maximum value calculation along with the\n+ *            default of R, G, B for noise reduction.\n+ * @use_rgb7_8: decrease RGBMax by 7/8 for noise reduction.\n+ * @disable_transient: disable transient calculation between Y and RGBY_max.\n+ */\n+struct rkisp1_cif_isp_wdr_iref_config {\n+\t__u8 rgb_factor;\n+\t__u8 use_y9_8;\n+\t__u8 use_rgb7_8;\n+\t__u8 disable_transient;\n+};\n+\n+/**\n+ * struct rkisp1_cif_isp_wdr_config - Configuration for wide dynamic range.\n+ *\n+ * @tone_curve: tone mapping curve.\n+ * @iref_config: illumination reference configuration. (when use_iref is true)\n+ * @rgb_offset: RGB offset value for RGB operation mode. (12 bits)\n+ * @luma_offset: luminance offset value for RGB operation mode. (12 bits)\n+ * @dmin_thresh: lower threshold for deltaMin value. (12 bits)\n+ * @dmin_strength: strength factor for deltaMin. (valid range is 0x00..0x10)\n+ * @use_rgb_colorspace: use RGB instead of luminance/chrominance colorspace.\n+ * @bypass_chroma_mapping: disable chrominance mapping (only valid if\n+ *                         use_rgb_colorspace = 0)\n+ * @use_iref: use illumination reference instead of Y for tone mapping\n+ *            and gain calculations.\n+ */\n+struct rkisp1_cif_isp_wdr_config {\n+\tstruct rkisp1_cif_isp_wdr_tone_curve tone_curve;\n+\tstruct rkisp1_cif_isp_wdr_iref_config iref_config;\n+\t__u16 rgb_offset;\n+\t__u16 luma_offset;\n+\t__u16 dmin_thresh;\n+\t__u8 dmin_strength;\n+\t__u8 use_rgb_colorspace;\n+\t__u8 bypass_chroma_mapping;\n+\t__u8 use_iref;\n+};\n+\n /*---------- PART2: Measurement Statistics ------------*/\n \n /**\n@@ -1059,6 +1132,7 @@ struct rkisp1_stat_buffer {\n  * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS: BLS in the compand block\n  * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve\n  * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve\n+ * @RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR: Wide dynamic range\n  */\n enum rkisp1_ext_params_block_type {\n \tRKISP1_EXT_PARAMS_BLOCK_TYPE_BLS,\n@@ -1081,11 +1155,15 @@ enum rkisp1_ext_params_block_type {\n \tRKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS,\n \tRKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND,\n \tRKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS,\n+\tRKISP1_EXT_PARAMS_BLOCK_TYPE_WDR,\n };\n \n #define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE\t(1U << 0)\n #define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE\t(1U << 1)\n \n+/* A bitmask of parameters blocks supported on the current hardware. */\n+#define RKISP1_CID_SUPPORTED_PARAMS_BLOCKS\t(V4L2_CID_USER_RKISP1_BASE + 0x01)\n+\n /**\n  * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block\n  *\t\t\t\t\t   header\n@@ -1460,6 +1538,23 @@ struct rkisp1_ext_params_compand_curve_config {\n \tstruct rkisp1_cif_isp_compand_curve_config config;\n } __attribute__((aligned(8)));\n \n+/**\n+ * struct rkisp1_ext_params_wdr_config - RkISP1 extensible params\n+ *                                       Wide dynamic range config\n+ *\n+ * RkISP1 extensible parameters WDR block.\n+ * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR`\n+ *\n+ * @header: The RkISP1 extensible parameters header, see\n+ *\t    :c:type:`rkisp1_ext_params_block_header`\n+ * @config: WDR configuration, see\n+ *\t    :c:type:`rkisp1_cif_isp_wdr_config`\n+ */\n+struct rkisp1_ext_params_wdr_config {\n+\tstruct rkisp1_ext_params_block_header header;\n+\tstruct rkisp1_cif_isp_wdr_config config;\n+} __attribute__((aligned(8)));\n+\n /*\n  * The rkisp1_ext_params_compand_curve_config structure is counted twice as it\n  * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types.\n@@ -1484,7 +1579,8 @@ struct rkisp1_ext_params_compand_curve_config {\n \tsizeof(struct rkisp1_ext_params_afc_config)\t\t\t+\\\n \tsizeof(struct rkisp1_ext_params_compand_bls_config)\t\t+\\\n \tsizeof(struct rkisp1_ext_params_compand_curve_config)\t\t+\\\n-\tsizeof(struct rkisp1_ext_params_compand_curve_config))\n+\tsizeof(struct rkisp1_ext_params_compand_curve_config)\t\t+\\\n+\tsizeof(struct rkisp1_ext_params_wdr_config))\n \n /**\n  * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version\n@@ -1520,6 +1616,14 @@ enum rksip1_ext_param_buffer_version {\n  * V4L2 control. If such control is not available, userspace should assume only\n  * RKISP1_EXT_PARAM_BUFFER_V1 is supported by the driver.\n  *\n+ * The read-only V4L2 control ``RKISP1_CID_SUPPORTED_PARAMS_BLOCKS`` can be used\n+ * to query the blocks supported by the device. It contains a bitmask where each\n+ * bit represents the availability of the corresponding entry from the\n+ * :c:type:`rkisp1_ext_params_block_type` enum. The current and default values\n+ * of the control represents the blocks supported by the device instance, while\n+ * the maximum value represents the blocks supported by the kernel driver,\n+ * independently of the device instance.\n+ *\n  * For each ISP block that userspace wants to configure, a block-specific\n  * structure is appended to the @data buffer, one after the other without gaps\n  * in between nor overlaps. Userspace shall populate the @data_size field with\n@@ -1528,7 +1632,7 @@ enum rksip1_ext_param_buffer_version {\n  * The expected memory layout of the parameters buffer is::\n  *\n  *\t+-------------------- struct rkisp1_ext_params_cfg -------------------+\n- *\t| version = RKISP_EXT_PARAMS_BUFFER_V1;                               |\n+ *\t| version = RKISP1_EXT_PARAM_BUFFER_V1;                               |\n  *\t| data_size = sizeof(struct rkisp1_ext_params_bls_config)             |\n  *\t|           + sizeof(struct rkisp1_ext_params_dpcc_config);           |\n  *\t| +------------------------- data  ---------------------------------+ |\ndiff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\nindex 882a81805783..fc43bb09efe3 100644\n--- a/include/linux/v4l2-controls.h\n+++ b/include/linux/v4l2-controls.h\n@@ -177,10 +177,6 @@ enum v4l2_colorfx {\n  * We reserve 128 controls for this driver.\n  */\n #define V4L2_CID_USER_CCS_BASE\t\t\t(V4L2_CID_USER_BASE + 0x10f0)\n-\n-/* The base for the bcm2835-isp driver controls.\n- * We reserve 16 controls for this driver. */\n-#define V4L2_CID_USER_BCM2835_ISP_BASE\t\t(V4L2_CID_USER_BASE + 0x10e0)\n /*\n  * The base for Allegro driver controls.\n  * We reserve 16 controls for this driver.\n@@ -217,6 +213,19 @@ enum v4l2_colorfx {\n  */\n #define V4L2_CID_USER_THP7312_BASE\t\t(V4L2_CID_USER_BASE + 0x11c0)\n \n+/*\n+ * The base for the uvc driver controls.\n+ * See linux/uvcvideo.h for the list of controls.\n+ * We reserve 64 controls for this driver.\n+ */\n+#define V4L2_CID_USER_UVC_BASE\t\t\t(V4L2_CID_USER_BASE + 0x11e0)\n+\n+/*\n+ * The base for Rockchip ISP1 driver controls.\n+ * We reserve 16 controls for this driver.\n+ */\n+#define V4L2_CID_USER_RKISP1_BASE\t\t(V4L2_CID_USER_BASE + 0x1220)\n+\n /* MPEG-class control IDs */\n /* The MPEG controls are applicable to all codec controls\n  * and the 'MPEG' part of the define is historical */\n",
    "prefixes": [
        "v2",
        "11/16"
    ]
}