Show a patch.

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

{
    "id": 27018,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/27018/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/27018/",
    "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": "<20260623-libipa-algorithms-v2-7-f97433f12e4e@ideasonboard.com>",
    "date": "2026-06-23T13:55:02",
    "name": "[v2,07/11] include: linux: mali-c55: Update to support CCM and Gamma",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d10d63ede716e43fc98f09f9d5a6f871817ad7ef",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/27018/mbox/",
    "series": [
        {
            "id": 6013,
            "url": "https://patchwork.libcamera.org/api/1.1/series/6013/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6013",
            "date": "2026-06-23T13:54:55",
            "name": "ipa: libipa: Introduce libipa algorithms",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/6013/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/27018/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/27018/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 059E6C3306\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Jun 2026 13:55:25 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F16E26579F;\n\tTue, 23 Jun 2026 15:55:20 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 11AD8657A1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jun 2026 15:55:11 +0200 (CEST)",
            "from [192.168.1.7] (net-93-65-100-155.cust.vodafonedsl.it\n\t[93.65.100.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F7272273;\n\tTue, 23 Jun 2026 15:54:33 +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=\"facpojy6\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782222873;\n\tbh=qBmjObkPWkG4+MI0nc+b7AQKq0A66qP27yBdaPl29Hg=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=facpojy6SlN5VqwL8h5WVmEttww/vWBtIeDlr7Q8b267FbcLcC1y9gL70K3mmtK5X\n\tTIinYLe+1JdaXfE0QypH1j9zpU1Q5OCZrqCedeZbyChfiOEy8DNzkKHehuln185Y7f\n\t4+1SRBGMy/V/Hs2JlnnzLuOiwDnTar1WFcLkOBcI=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Date": "Tue, 23 Jun 2026 15:55:02 +0200",
        "Subject": "[PATCH v2 07/11] include: linux: mali-c55: Update to support CCM\n\tand Gamma",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260623-libipa-algorithms-v2-7-f97433f12e4e@ideasonboard.com>",
        "References": "<20260623-libipa-algorithms-v2-0-f97433f12e4e@ideasonboard.com>",
        "In-Reply-To": "<20260623-libipa-algorithms-v2-0-f97433f12e4e@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "b4 0.14.3",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=5472;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=qBmjObkPWkG4+MI0nc+b7AQKq0A66qP27yBdaPl29Hg=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqOpA7VlYpEX56/s4oQPIzNcL1M1y0lxQeLVkG4\n\tZ6mN51O/oKJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCajqQOwAKCRByNAaPFqFW\n\tPBgeEAC6k/GhV9w4XzSBFdH3NkjWvp+R1nemxZyzKdyEk2fu5GgrxFA1U1kLBsg521Ma+eq9BMQ\n\tevdc+rp/rlZDe754Yuf4Pd60wEwKx+z00q8F8kUzLhYKcocyUCjSQqCWIgzq2rIK/2u7fMKPNfi\n\t+co0Bi63MMsyAEH8Li560Lyq/pHJ16xZ1RjksDRHIxN/Kcac6wluN3RMKQihRsntYuyB+vwuqEQ\n\to0l9OIbc1LD+uhHdbiwUCcQAdwmdoFbgM8/zHOTSL3LHiOTet/U0R3SzPCEWXgwa9JEypNOTQoe\n\t1QL4pcxjXM3gdjYvkMIWcFKwX9UzUBgEuRor8ey2bl/GBRHGWnA7IBQMS0Y8jFWqxToWFVf5QLp\n\toF/lDQmnA+gfIclCBw/sN27xMrfE1I1lMl1qgDuf7VZ8uNPkT0Prt17JEvIGbpox3L7Sr4UpvUl\n\tNXfaJWtOGmrPAIwRB5FZ6UXLYxjRHCqHME+Fi0bJEedPWGSRmgmIx3Rt3PBD2jUb4JumgZjU1Vp\n\tpW2FBxMNzWP31cW44wtOpSxgtFNRTr8YWmpHHKDMCuRiNJ7EM66/2fXLBaGbyPb61S1UTHLeXsv\n\tbwKkvhgfy5DK+znfpje74jfzXITjbzfgSXZIuGy2CBR8z+LyWQeXnLWvJgGxOwX+qxkKfdCglJG\n\twNqw7LnKZ4mWe5g==",
        "X-Developer-Key": "i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B",
        "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 the Mali-C55 uAPI header to add support for CCM and the\nRGB Gamma.\n\nPatches have been posted upstream but not yet merged\nhttps://patchwork.linuxtv.org/project/linux-media/list/?series=26497\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/linux/media/arm/mali-c55-config.h | 85 ++++++++++++++++++++++++++++++-\n 1 file changed, 84 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/linux/media/arm/mali-c55-config.h b/include/linux/media/arm/mali-c55-config.h\nindex 3d335f950eeb..06eb85a6d66a 100644\n--- a/include/linux/media/arm/mali-c55-config.h\n+++ b/include/linux/media/arm/mali-c55-config.h\n@@ -36,6 +36,9 @@\n  */\n #define MALI_C55_MAX_ZONES\t(15 * 15)\n \n+/* Number of RGB gamma LUT entries. */\n+#define MALI_C55_NUM_GAMMA_LUT_ELEMENTS 129\n+\n /**\n  * struct mali_c55_ae_1024bin_hist - Auto Exposure 1024-bin histogram statistics\n  *\n@@ -219,6 +222,9 @@ struct mali_c55_stats_buffer {\n  * @MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP: Auto-white balance gains for AEXP-0 tap\n  * @MALI_C55_PARAM_MESH_SHADING_CONFIG : Mesh shading tables configuration\n  * @MALI_C55_PARAM_MESH_SHADING_SELECTION: Mesh shading table selection\n+ * @MALI_C55_PARAM_BLOCK_CCM: Colour correction matrix\n+ * @MALI_C55_PARAM_BLOCK_GAMMA_FR: Gamma gain and offset for FR pipe\n+ * @MALI_C55_PARAM_BLOCK_GAMMA_DS: Gamma gain and offset for DS pipe\n  */\n enum mali_c55_param_block_type {\n \tMALI_C55_PARAM_BLOCK_SENSOR_OFFS,\n@@ -232,6 +238,9 @@ enum mali_c55_param_block_type {\n \tMALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP,\n \tMALI_C55_PARAM_MESH_SHADING_CONFIG,\n \tMALI_C55_PARAM_MESH_SHADING_SELECTION,\n+\tMALI_C55_PARAM_BLOCK_CCM,\n+\tMALI_C55_PARAM_BLOCK_GAMMA_FR,\n+\tMALI_C55_PARAM_BLOCK_GAMMA_DS,\n };\n \n /**\n@@ -757,6 +766,77 @@ struct mali_c55_params_mesh_shading_selection {\n \t__u16 mesh_strength;\n };\n \n+/**\n+ * struct mali_c55_params_ccm - Coefficients, offsets and gains for the colour\n+ *\t\t\t\tcorrection matrix\n+ *\n+ * The colour correction module converts images data from a sensor-specific\n+ * colour space to known one.\n+ *\n+ * Colour correction is applied after demosaicing and each pixel is represented\n+ * as a column vector of the three RGB colour channels on which the following\n+ * operations take place:\n+ * 1) An offset is subtracted from each colour channel\n+ * 2) Each colour channel is multiplied by a gain\n+ * 3) The pixel column vector is multiplied by the colour correction matrix\n+ *\n+ * This struct allows users to configure the coefficients for CCM and the\n+ * per-channel offsets and gains. The nine matrix coefficients are expressed as\n+ * signed Q4.8 Sign/Magnitude fixed-point numbers, the three gain multipliers\n+ * are expressed as unsigned Q4.8 fixed-point numbers and the three offsets are\n+ * expressed as a 12-bit unsigned integers.\n+ *\n+ * header.type should be set to MALI_C55_PARAM_BLOCK_CCM from\n+ * :c:type:`mali_c55_param_block_type`.\n+ *\n+ * @header:\tThe Mali-C55 parameters block header\n+ * @coeffs:\t3x3 color conversion matrix coefficients in sign/magnitude\n+ *\t\tQ4.8 format\n+ * @gains:\tGains for red, green and blue channels in unsigned Q4.8 format\n+ * @offs:\tOffsets for red, green and blue channels\n+ */\n+struct mali_c55_params_ccm {\n+\tstruct v4l2_isp_params_block_header header;\n+\t__u16 coeffs[3][3];\n+\t__u16 gains[3];\n+\t__u16 offs[3];\n+};\n+\n+/**\n+ * struct mali_c55_params_gamma - RGB Gamma correction\n+ *\n+ * Gamma correction is used to program a standard gamma curve such as the sRGB\n+ * one. It provides gains and offsets to implement contrast adjustments.\n+ *\n+ * Gamma correction is applied on both the FR and DS pipes separately in the RGB\n+ * colour domain where the following operations take place:\n+ * 1) An offset is subtracted from each colour channel\n+ * 2) Each colour channel is multiplied by a gain\n+ * 3) The Gamma LUT is applied to each colour channel\n+ *\n+ * The Gamma LUT has 129 entries where each node is an unsigned 12 bit number.\n+ * It is expected that LUT[0]=0 and LUT[128]=0xffff, with the other 127 values\n+ * defining the Gamma correction curve.\n+ *\n+ * As one Gamma correction block is available on both the FR and DS pipes, the\n+ * header.type field should be set to one of either\n+ * MALI_C55_PARAM_BLOCK_GAMMA_FR or MALI_C55_PARAM_BLOCK_GAMMA_DS from\n+ * :c:type:`mali_c55_param_block_type`.\n+ *\n+ * @header:\tThe Mali-C55 parameters block header\n+ * @gains:\tGains for the red, green and blue channel in unsigned Q4.8 format\n+ * @offs:\tOffsets subtracted from the red, green and blue channels\n+ *\t\tin unsigned 12-bit format\n+ * @lut: \t129-node Gamma LUT in u0.12 format\n+ */\n+struct mali_c55_params_gamma {\n+\tstruct v4l2_isp_params_block_header header;\n+\t__u8 rgb_enable;\n+\t__u16 gains[3];\n+\t__u16 offs[3];\n+\t__u32 lut[MALI_C55_NUM_GAMMA_LUT_ELEMENTS];\n+};\n+\n /**\n  * define MALI_C55_PARAMS_MAX_SIZE - Maximum size of all Mali C55 Parameters\n  *\n@@ -780,6 +860,9 @@ struct mali_c55_params_mesh_shading_selection {\n \tsizeof(struct mali_c55_params_awb_config) +\t\t\\\n \tsizeof(struct mali_c55_params_awb_gains) +\t\t\\\n \tsizeof(struct mali_c55_params_mesh_shading_config) +\t\\\n-\tsizeof(struct mali_c55_params_mesh_shading_selection))\n+\tsizeof(struct mali_c55_params_mesh_shading_selection) +\t\\\n+\tsizeof(struct mali_c55_params_ccm) +\t\t\t\\\n+\tsizeof(struct mali_c55_params_gamma) +\t\t\t\\\n+\tsizeof(struct mali_c55_params_gamma))\n \n #endif /* __UAPI_MALI_C55_CONFIG_H */\n",
    "prefixes": [
        "v2",
        "07/11"
    ]
}