Show a patch.

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

{
    "id": 25512,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/25512/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25512/",
    "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": "<20251211232246.31330-19-bryan.odonoghue@linaro.org>",
    "date": "2025-12-11T23:22:43",
    "name": "[v5,18/20] libcamera: software_isp: blacklevel: Make black level available in debayer params",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "be9658f023e730c939ef09754cec17d1cee8a74c",
    "submitter": {
        "id": 175,
        "url": "https://patchwork.libcamera.org/api/1.1/people/175/?format=api",
        "name": "Bryan O'Donoghue",
        "email": "bryan.odonoghue@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25512/mbox/",
    "series": [
        {
            "id": 5656,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5656/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5656",
            "date": "2025-12-11T23:22:25",
            "name": "GPUISP precursor series",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/5656/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25512/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25512/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 79D13C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 23:24:13 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2F38061852;\n\tFri, 12 Dec 2025 00:24:13 +0100 (CET)",
            "from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B227C61623\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 00:24:11 +0100 (CET)",
            "by mail-pf1-x42f.google.com with SMTP id\n\td2e1a72fcca58-7ade456b6abso498546b3a.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 15:24:11 -0800 (PST)",
            "from inspiron14p-linux (M106185144161.v4.enabler.ne.jp.\n\t[106.185.144.161]) by smtp.gmail.com with ESMTPSA id\n\td2e1a72fcca58-7f4c4ab52aasm3399933b3a.38.2025.12.11.15.24.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Dec 2025 15:24:09 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"n6tiY7GW\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765495450; x=1766100250;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=LYX+U/etjfgPjb5J00CQm3DyC6598qa27lMCRWvT06k=;\n\tb=n6tiY7GWNBETfta95D6uMNrYLdQjyKxKl6INdtW3F3J0k5KTB3q5OL09u9E8oVjhue\n\te+W9an7mmqKyBKUwpcejikVvR1DKz4jAaNcriuepHe4716iZnhGUKg9kwdkLX/szpxVv\n\tvkcod/CStBfQ7qCfhWalvX0kU+YrmIoJ6GiWsmPQseJBjDv4vIE6sWyZSag5UPOb7qLK\n\tYn6N+npACQ1RapVM2K91DNMN4kx044o/H1q1ASv/WiAfi3kaPjAGzNb3XfZIWxz67A0g\n\tRb8amataYYNkyq+LdY+sGXq5SumbPEc/mHFesCaVl409euqaIA6KUleg1UiWkcdWyV8b\n\teeDA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765495450; x=1766100250;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=LYX+U/etjfgPjb5J00CQm3DyC6598qa27lMCRWvT06k=;\n\tb=iHxkkspnXIw8Bk3C2r5J1Lq48kgNG45m5fA/9oAz5jND4O8E4Fx3op245b03/cVCLv\n\tMGYo4M3eoMHpTzjdRW17qsV1QgylTqUf0HTz+ncswGcry9C7hGpRIk+vah5DHBhKvq3K\n\tnO1Ppjq9UNE8gyARB1HSFxqddXWA9HS9mJ5Nh6O3Xay55E6/9xMS3zBjetw5CH+oh9/t\n\tUlbuAhTUnkKnlfQYP8gB7Lv/Rfi4OxlZG0A7Kp/sH5J/kPGZa103jG8NOHTNODS2BY8N\n\tMCfhi0VZWo65u2S8vQzgwJEv/QY+eoYU8AQAZY0RObu1rgl9SMbguCC7iBKsxi248VXf\n\thSmA==",
        "X-Gm-Message-State": "AOJu0YweiDWdLxEDR5cUoulkrmqXEQIlWmWfV3/kW1vCNyB5XEmhnZVW\n\tQ+zorFXp5xaoivV7Vk10cADOsjmo+IGSicS9Z6FKwzYv5oYmvZj2wLBZI0aDgrt+HYGUU0O/lw2\n\tURm3c",
        "X-Gm-Gg": "AY/fxX7Wh4UiR+lCsztKi0/53K5YL4yENSjuFGNydZJvo7VwjzDM2bleuut48uHMrYI\n\tFClIRDWa55ImL63S/RbHrWApNfhu4+R7mlMfRHf7zYnXzmdTdCxK6vZapDQZXOJ62KWfUA3/Jxl\n\tkKHrWjIjtJUCBzJerUtIF4fHFbjRdpe59ItwZ+M55S1+dkQUeyc4mFEhK6iCvDkpeIJJMvyotQZ\n\t7z19EoZoIizpL9VksQgxQTjiG/cVc8zJ5XzWYhOzdwKlwUS/RIB9PBXe82BQPkVJiLOuk647FTi\n\thTParqRLFHOHpX3QbLZkWSpPj/fknhMCrBLCoRo93RlA/GdwKSxG71Y6jcJ0PYe6LXU0N2v5exE\n\t21+e3cD57BnSOXKLScq6uNich1hehVnmekMWk3hanIp/iWHg36Y4V9hBdzjCkNRYqHtH2O8OolV\n\tUv1DzOQQTp9H1rKAw/avwMn4GSxpxeAgOdB0vUf2c2dgzEqSv5ZVqEabUA0yEIJg==",
        "X-Google-Smtp-Source": "AGHT+IEf1aOxJOLB6XqeoyViZ65eKpYpAtLtLakcyfHMawTnOlvKpxY386a/BiGGEtwmdefhrHn7jg==",
        "X-Received": "by 2002:a05:6a21:32a3:b0:353:6c3b:d92a with SMTP id\n\tadf61e73a8af0-369ad3fcd7fmr212079637.15.1765495450112; \n\tThu, 11 Dec 2025 15:24:10 -0800 (PST)",
        "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH v5 18/20] libcamera: software_isp: blacklevel: Make black\n\tlevel available in debayer params",
        "Date": "Thu, 11 Dec 2025 23:22:43 +0000",
        "Message-ID": "<20251211232246.31330-19-bryan.odonoghue@linaro.org>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20251211232246.31330-1-bryan.odonoghue@linaro.org>",
        "References": "<20251211232246.31330-1-bryan.odonoghue@linaro.org>",
        "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": "Populate black level gain in blacklevel::prepare(). A copy is made of the gain\nvalue in the DebayerParams structure.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n include/libcamera/internal/software_isp/debayer_params.h | 2 ++\n src/ipa/simple/algorithms/blc.cpp                        | 9 +++++++++\n src/ipa/simple/algorithms/blc.h                          | 4 ++++\n src/libcamera/software_isp/debayer.cpp                   | 5 +++++\n 4 files changed, 20 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 4b203e211..5a0d9438f 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -14,6 +14,7 @@\n #include <stdint.h>\n \n #include \"libcamera/internal/matrix.h\"\n+#include \"libcamera/internal/vector.h\"\n \n namespace libcamera {\n \n@@ -56,6 +57,7 @@ struct DebayerParams {\n \t * Per frame corrections as calculated by the IPA\n \t */\n \tMatrix<float, 3, 3> ccm;\n+\tRGB<float> blackLevel;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\nindex 370385afc..464e43c27 100644\n--- a/src/ipa/simple/algorithms/blc.cpp\n+++ b/src/ipa/simple/algorithms/blc.cpp\n@@ -47,6 +47,15 @@ int BlackLevel::configure(IPAContext &context,\n \treturn 0;\n }\n \n+void BlackLevel::prepare(IPAContext &context,\n+\t\t\t [[maybe_unused]] const uint32_t frame,\n+\t\t\t [[maybe_unused]] IPAFrameContext &frameContext,\n+\t\t\t DebayerParams *params)\n+{\n+\t/* Latch the blacklevel gain so GPUISP can apply. */\n+\tparams->blackLevel = RGB<float>(context.activeState.blc.level / 255.0f);\n+}\n+\n void BlackLevel::process(IPAContext &context,\n \t\t\t [[maybe_unused]] const uint32_t frame,\n \t\t\t IPAFrameContext &frameContext,\ndiff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\nindex db9e6d639..a5592d087 100644\n--- a/src/ipa/simple/algorithms/blc.h\n+++ b/src/ipa/simple/algorithms/blc.h\n@@ -24,6 +24,10 @@ public:\n \n \tint init(IPAContext &context, const YamlObject &tuningData) override;\n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n+\tvoid prepare(IPAContext &context,\n+\t\t     const uint32_t frame,\n+\t\t     IPAFrameContext &frameContext,\n+\t\t     DebayerParams *params) override;\n \tvoid process(IPAContext &context, const uint32_t frame,\n \t\t     IPAFrameContext &frameContext,\n \t\t     const SwIspStats *stats,\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 4464bffb4..7334ea197 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -105,6 +105,11 @@ namespace libcamera {\n  * \\brief Per frame colour correction matrix for GPUISP\n  */\n \n+/**\n+ * \\var DebayerParams::blackLevel\n+ * \\brief Blacklevel gains for the GPUISP\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n",
    "prefixes": [
        "v5",
        "18/20"
    ]
}