Show a patch.

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

{
    "id": 21027,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21027/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21027/",
    "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": "<20240826161709.524293-9-jacopo.mondi@ideasonboard.com>",
    "date": "2024-08-26T16:17:07",
    "name": "[v3,8/9] ipa: rkisp1: blc: Add support for BLS in compand",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "861552912c62e47093dafd69976a580e2f4dff33",
    "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/21027/mbox/",
    "series": [
        {
            "id": 4541,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4541/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4541",
            "date": "2024-08-26T16:16:59",
            "name": "rkisp1: Support BLS on i.MX8MP",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4541/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21027/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21027/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 468F6C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Aug 2024 16:17:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5E15363420;\n\tMon, 26 Aug 2024 18:17:40 +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 69D906342D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Aug 2024 18:17:25 +0200 (CEST)",
            "from ideasonboard.com (mob-5-90-142-90.net.vodafone.it\n\t[5.90.142.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C03F1480;\n\tMon, 26 Aug 2024 18:16:18 +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=\"Q1tShAH8\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724688979;\n\tbh=950sa0lBjmlQZWNUEOv+dTEaszo0vrblQOphQ54UL8I=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Q1tShAH8bDpHVLAVMQrl5zMgqlfD5RxTQIYCEsZYYmRffOqKJwVWz/yDDCiZeogTl\n\tlUCi0dUwgx0Jn8rUkibStXBHlUN+Q6y2mCx7MEGNEFBrTlFy3a7XeHcdWK3Bsz5Cgr\n\t7s2O+qneLMWdSUWC1OxFONoXiW0m8F7j3WdpkGJw=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v3 8/9] ipa: rkisp1: blc: Add support for BLS in compand",
        "Date": "Mon, 26 Aug 2024 18:17:07 +0200",
        "Message-ID": "<20240826161709.524293-9-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.2",
        "In-Reply-To": "<20240826161709.524293-1-jacopo.mondi@ideasonboard.com>",
        "References": "<20240826161709.524293-1-jacopo.mondi@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": "From: Paul Elder <paul.elder@ideasonboard.com>\n\nExtend the RkISP1 BLC algorithm to use the ISP 'companding' block for\nversions of the ISP (such as the one on the i.MX8MP) that lack the\ndedicated BLS block but implement BLS as part of the companding block.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/blc.cpp | 33 ++++++++++++++++++++++---------\n 1 file changed, 24 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp\nindex df1a91a413db..9bc10f4ad07f 100644\n--- a/src/ipa/rkisp1/algorithms/blc.cpp\n+++ b/src/ipa/rkisp1/algorithms/blc.cpp\n@@ -110,7 +110,7 @@ int BlackLevelCorrection::init(IPAContext &context, const YamlObject &tuningData\n /**\n  * \\copydoc libcamera::ipa::Algorithm::prepare\n  */\n-void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n+void BlackLevelCorrection::prepare(IPAContext &context,\n \t\t\t\t   const uint32_t frame,\n \t\t\t\t   [[maybe_unused]] IPAFrameContext &frameContext,\n \t\t\t\t   RkISP1Params *params)\n@@ -124,15 +124,30 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n \tif (!tuningParameters_)\n \t\treturn;\n \n-\tauto config = params->block<Block::Bls>();\n-\tconfig.setEnabled(true);\n+\tif (context.hw->compand) {\n+\t\tauto config = params->block<Block::CompandBls>();\n+\t\tconfig.setEnabled(true);\n \n-\tconfig->enable_auto = 0;\n-\t/* The rkisp1 uses 12bit based black levels. Scale down accordingly. */\n-\tconfig->fixed_val.r = blackLevelRed_ >> 4;\n-\tconfig->fixed_val.gr = blackLevelGreenR_ >> 4;\n-\tconfig->fixed_val.gb = blackLevelGreenB_ >> 4;\n-\tconfig->fixed_val.b = blackLevelBlue_ >> 4;\n+\t\t/*\n+\t\t * Scale up to the 20-bit black levels used by the companding\n+\t\t * block.\n+\t\t */\n+\t\tconfig->r = blackLevelRed_ << 4;\n+\t\tconfig->gr = blackLevelGreenR_ << 4;\n+\t\tconfig->gb = blackLevelGreenB_ << 4;\n+\t\tconfig->b = blackLevelBlue_ << 4;\n+\t} else {\n+\t\tauto config = params->block<Block::Bls>();\n+\t\tconfig.setEnabled(true);\n+\n+\t\tconfig->enable_auto = 0;\n+\n+\t\t/* Scale down to the 12-bit black levels used by the BLS block. */\n+\t\tconfig->fixed_val.r = blackLevelRed_ >> 4;\n+\t\tconfig->fixed_val.gr = blackLevelGreenR_ >> 4;\n+\t\tconfig->fixed_val.gb = blackLevelGreenB_ >> 4;\n+\t\tconfig->fixed_val.b = blackLevelBlue_ >> 4;\n+\t}\n }\n \n /**\n",
    "prefixes": [
        "v3",
        "8/9"
    ]
}