Show a patch.

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

{
    "id": 24559,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24559/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24559/",
    "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": "<20251003121821.659081-3-naush@raspberrypi.com>",
    "date": "2025-10-03T12:15:53",
    "name": "[v2,2/4] ipa: rpi: Add FE globals as a parameter to applyDecompand()",
    "commit_ref": "ffcdbf09809fd285bbc6098b052f3324b41fd5d2",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3c4487adbb5fe85f29df526e80941eca96e30c57",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24559/mbox/",
    "series": [
        {
            "id": 5477,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5477/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5477",
            "date": "2025-10-03T12:15:51",
            "name": "Raspberry Pi: Decompanding support",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5477/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24559/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24559/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 7F286C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Oct 2025 12:18:39 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24E1C69318;\n\tFri,  3 Oct 2025 14:18:37 +0200 (CEST)",
            "from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E66769318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Oct 2025 14:18:32 +0200 (CEST)",
            "by mail-wm1-x32a.google.com with SMTP id\n\t5b1f17b1804b1-46e38c21fafso4055465e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Oct 2025 05:18:32 -0700 (PDT)",
            "from NAUSH-P-DELL.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-4255d8f02a8sm7812529f8f.39.2025.10.03.05.18.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Oct 2025 05:18:31 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"b+TKvhOq\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1759493911; x=1760098711;\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=Nq0/DZ49evXH+3DtXg1iN+pSyMK/YaIlLQA5DCjVQTc=;\n\tb=b+TKvhOqhLHPbWh08GweF6ffedFh41wryOpEGJU33/FANE5g0w10JpSKwYzzKhM+tv\n\tJXDm9F6UarrzW/kFg3k/FHcjIyW/oj2n5tYfO7ni1fsUvT+oUBj34cWd0ukl90gpm2we\n\tdaYJ7cEfJQZdlSOJqBRZ3RS+wu1NfgJUt2wC0zVzXoNcsSq92U67J0033BcG/+SoScum\n\t+DgGgZWO9awabAcgVfbDeWphHn2yokwZr1FM30r68hQuy5Dq/9ZBfl8HAwLBWnvjt1VW\n\t64bWQN9WlfHTHs3SmVWkTAu2Pa1R8hNTI5/xPaxbR9C1X5r2klkaliTdJiVoXEjNnNUF\n\tjBAQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759493911; x=1760098711;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Nq0/DZ49evXH+3DtXg1iN+pSyMK/YaIlLQA5DCjVQTc=;\n\tb=oH7Oxh14iJ+I5GaAH6Ex/8EzQxKquN9tlHqgVHefFyPICvfO8Efid0W0kfTByUXzr2\n\tryG8n+i4S9FukXtYglQsCoKJCQkIepvxb/IGb+Eh+MfbH9jBGMgeLkjbh2NF0KeYMp3U\n\tAWX8tF7mCj6fbIJDbDh7yIRTc5MrheJESbsMn39/vRLp4O/xcHybAezcAc3u8DadfVmk\n\tJAqfkaBH0Xgw6io2dKOXvTMNnrEsXrRIWECX8t3AdKf38GXL0cpQAeJkoRli94NqR8WU\n\tRsQIp6lRsDfT2nVlXN+TCrHFy5tb23L5ACiToRNODEu19B0KUxicY7gqSRuMIxcMseMD\n\tJ9fQ==",
        "X-Gm-Message-State": "AOJu0YwB9YpQOIGhBXzea+oSkOcoPRMXLOcVDIbmwU3gS1hOoDuAYhrE\n\tyFfqToPFcMXAoFnCh/HYASckVEOBwZENU6ymHicr8sTr1/BB6gTHfmZ52jflgruIsJu5BL87/zg\n\t9yp05",
        "X-Gm-Gg": "ASbGncskBFqF3TEqp4+vg9YpikOuprRsNvp7VE8mSbD8mgqxhASXLvr5js6m2cxVPAR\n\tVU55KesVwMX/5DZD0W4KXuMqNn719tKen6irJSD2HNX2mqWl4I5+sxGPzYF7+EOksKhDrIJzN59\n\tLUjyBqiZd28SfUE46BJF7MlV8wBIsu6DBtYirp0t9w0ydchXmoFxVF30/4w2Ddp0cDWinafv7Wm\n\tPzIH/Ig7AEWqyrBjmwwAOggzl94Wb+mPZeLPEeY9kgztcpo0Y+UiguHseqqPZAyvj2HA0g2iAMf\n\t+B5SAT6HvpBhamGRl8Mu4ijpi8YJbUy8W4BTXNfg9sMpmiQtXzKEl2lB22kqtZtZmJQB3Jdx9No\n\tu+Of5BUCH9chXse0O28JjHji99J2ISlg4q1sQRICwQXLgP4vPof53oIshs1+k/Y1/2Q==",
        "X-Google-Smtp-Source": "AGHT+IG/MRuO3c/3vs7C782o/jvFkkWLvIp5sE+Mes9wlaUMCtjILYhtUzCB5macOHoLbynRk85uew==",
        "X-Received": "by 2002:a5d:5d13:0:b0:3f4:52d3:7a6a with SMTP id\n\tffacd0b85a97d-425671d3e41mr812206f8f.10.1759493911336; \n\tFri, 03 Oct 2025 05:18:31 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "David Plowman <david.plowman@raspberrypi.com>,\n\tNick Hollinghurst <nick.hollinghurst@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>",
        "Subject": "[PATCH v2 2/4] ipa: rpi: Add FE globals as a parameter to\n\tapplyDecompand()",
        "Date": "Fri,  3 Oct 2025 13:15:53 +0100",
        "Message-ID": "<20251003121821.659081-3-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20251003121821.659081-1-naush@raspberrypi.com>",
        "References": "<20251003121821.659081-1-naush@raspberrypi.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": "Don't let applyDecompand() directly change the FE global enables.\nInstead pass the global mask into the function and set it in the caller.\nThis will be needed when a future commit will add setting the decompand\ninitial values.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\n---\n src/ipa/rpi/pisp/pisp.cpp | 15 +++++++++------\n 1 file changed, 9 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/ipa/rpi/pisp/pisp.cpp b/src/ipa/rpi/pisp/pisp.cpp\nindex 14ece12b0895..f5be39aca5ee 100644\n--- a/src/ipa/rpi/pisp/pisp.cpp\n+++ b/src/ipa/rpi/pisp/pisp.cpp\n@@ -256,7 +256,7 @@ private:\n \tvoid applyLensShading(const AlscStatus *alscStatus,\n \t\t\t      pisp_be_global_config &global);\n \tvoid applyDPC(const DpcStatus *dpcStatus, pisp_be_global_config &global);\n-\tvoid applyDecompand(const DecompandStatus *decompandStatus);\n+\tvoid applyDecompand(const DecompandStatus *decompandStatus, pisp_fe_global_config &feGlobal);\n \tvoid applySdn(const SdnStatus *sdnStatus, pisp_be_global_config &global);\n \tvoid applyTdn(const TdnStatus *tdnStatus, const DeviceStatus *deviceStatus,\n \t\t      pisp_be_global_config &global);\n@@ -368,6 +368,9 @@ void IpaPiSP::platformPrepareIsp([[maybe_unused]] const PrepareParams &params,\n \t{\n \t\t/* All Frontend config goes first, we do not want to hold the FE lock for long! */\n \t\tstd::scoped_lock<FrontEnd> lf(*fe_);\n+\t\tpisp_fe_global_config feGlobal;\n+\n+\t\tfe_->GetGlobal(feGlobal);\n \n \t\tif (noiseStatus)\n \t\t\tapplyFocusStats(noiseStatus);\n@@ -375,13 +378,14 @@ void IpaPiSP::platformPrepareIsp([[maybe_unused]] const PrepareParams &params,\n \t\tDecompandStatus *decompandStatus =\n \t\t\trpiMetadata.getLocked<DecompandStatus>(\"decompand.status\");\n \t\tif (decompandStatus)\n-\t\t\tapplyDecompand(decompandStatus);\n+\t\t\tapplyDecompand(decompandStatus, feGlobal);\n \n \t\tBlackLevelStatus *blackLevelStatus =\n \t\t\trpiMetadata.getLocked<BlackLevelStatus>(\"black_level.status\");\n \t\tif (blackLevelStatus)\n \t\t\tapplyBlackLevel(blackLevelStatus, global);\n \n+\t\tfe_->SetGlobal(feGlobal);\n \t}\n \n \tCacStatus *cacStatus = rpiMetadata.getLocked<CacStatus>(\"cac.status\");\n@@ -728,16 +732,15 @@ void IpaPiSP::applyDPC(const DpcStatus *dpcStatus, pisp_be_global_config &global\n \tbe_->SetDpc(dpc);\n }\n \n-void IpaPiSP::applyDecompand(const DecompandStatus *decompandStatus)\n+void IpaPiSP::applyDecompand(const DecompandStatus *decompandStatus, pisp_fe_global_config &feGlobal)\n {\n-\tpisp_fe_global_config feGlobal;\n \tpisp_fe_decompand_config decompand = {};\n \n \tif (!generateDecompandLut(decompandStatus->decompandCurve, decompand.lut)) {\n \t\tfe_->SetDecompand(decompand);\n \t\tfeGlobal.enables |= PISP_FE_ENABLE_DECOMPAND;\n-\t\tfe_->SetGlobal(feGlobal);\n-\t}\n+\t} else\n+\t\tfeGlobal.enables &= ~PISP_FE_ENABLE_DECOMPAND;\n }\n \n void IpaPiSP::applySdn(const SdnStatus *sdnStatus, pisp_be_global_config &global)\n",
    "prefixes": [
        "v2",
        "2/4"
    ]
}