{"id":24550,"url":"https://patchwork.libcamera.org/api/patches/24550/?format=json","web_url":"https://patchwork.libcamera.org/patch/24550/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251002133523.293413-3-naush@raspberrypi.com>","date":"2025-10-02T13:26:05","name":"[v1,2/4] ipa: rpi: Add FE globals as a parameter to applyDecompand()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"bae8c618a775e530fc592d7824a2ffd5c444a4bb","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24550/mbox/","series":[{"id":5474,"url":"https://patchwork.libcamera.org/api/series/5474/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5474","date":"2025-10-02T13:26:03","name":"Raspberry Pi: Decompanding support","version":1,"mbox":"https://patchwork.libcamera.org/series/5474/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24550/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24550/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 3B544C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Oct 2025 13:35:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95C246B5AA;\n\tThu,  2 Oct 2025 15:35:34 +0200 (CEST)","from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A59D06B5F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Oct 2025 15:35:31 +0200 (CEST)","by mail-wm1-x32b.google.com with SMTP id\n\t5b1f17b1804b1-46e310e64f4so1319185e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 02 Oct 2025 06:35:31 -0700 (PDT)","from NAUSH-P-DELL.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-46e6918bdebsm40396015e9.9.2025.10.02.06.35.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 02 Oct 2025 06:35:30 -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=\"lbGrknTJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1759412131; x=1760016931;\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=2FLUPxtStom9sPnXBOfr3PHqylq/XtMY5MS9+dCgLKk=;\n\tb=lbGrknTJ3fhbwOkirRJUn7fnB3MbAxLn1JK8CxzfRjb+txvR4+QfJ7Vnk3vvPSu+qg\n\tn+QDqE9YHdL734YRdBN/+b8WWmBGopiOzLCF5bQwIywFGlbDInUzopXI9KkwTjNAOHtK\n\tHjToB38CoAMRO9wWwCAfJo+Ef7tyJiS9F9Je257kXNdkWfMiEQ281Ba3nzgpN3Hfruyj\n\tvPKV4YWT1UpKHyUhn4R4qIpN7ApuUhTwFtK+hzFXFXwb4yEQD97xGKBCOEao8Vg2K68g\n\tg5x4gLGQdqIio8ppf/mpcTG++YtLtEUxwE3CA94/esFUnBYbzenpAc4KtVTRlVT2zyqP\n\t/mOg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759412131; x=1760016931;\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=2FLUPxtStom9sPnXBOfr3PHqylq/XtMY5MS9+dCgLKk=;\n\tb=bjoUfn90ScblH56gMekuSI30uxNoAeCf6x/K3wRYLY0w5jwcT56pHLNu4bl+AlddQY\n\tXmgZreWCfK8FTWx9WdyTNeBJvf6EFjw8o6RyVMFfGdAWRkkwuIVgQoIpvhJoFyc0WgvN\n\tc7j+kMnLou54JhGaSZ/2h8Ub/94pvEgyxgL+mul1dGD6ZVCG7SuWTOzNdPq/5D0u6iDU\n\ttzE1AguJzFy26bPSkef5ChaAWopL+wlSnrW/P8TAxv02rvnTsb2nCIk1vlF8KZ3Jpm0H\n\tWtKokZgcAnwcClSrv+vaN3yhasub2TdNYjyiHd8JFQkyc7POlaWC/TvN1qIGtUjXgwa7\n\tEIzQ==","X-Gm-Message-State":"AOJu0YzMNJs8IKxAKXMLD4QlIoBRzfUxbad7dk5qF4orwr0Hh7jPjqbT\n\t6990wtpZij2LmJOCEOtuUWJCEAY185eULv1A43MlFOE2aNHk/iWK4gXShTcdRJaZOGhLvNrDzUU\n\tkuXUD","X-Gm-Gg":"ASbGnctgEIteECbsL/hjnAaYVIT/d/vHdyxBcfvX1Gv0VgQstsbALW48FWs1f1hyuH5\n\to+Av1C9DOlJ8HPX2UiV0CdWLrQm90GrP5nBt52gpx8KmQ5z8QDEvMAPzdwOhzgdGkY/wrUijHD1\n\t73eEtwtoZWq9jpoU+gxgXstdxVW/2DzfBmslWC0TBdx5nluO7flm9T8A8oI8l2Y+S2/VE8o7teB\n\t7USR3lop6sj6m1H8HVDCYHyuhRfOeRM6vmZICAfHudhpiAuSbq8t2yGNIa0wWGkn5s8sXSecfi3\n\tOG9zjb0qDUGlVrC61k9bwXNt4ktQsX9D3+sUoNOxWqaBZG1DQQkHo134nWhegHEfZwUl9uZw8SQ\n\tDGKE/KJg22VBiTNgrapPs01icXITm6VUDa8xnMPiPpfzxACkOTOIZRLcuDljTcNpU6ggDfjdr3M\n\tuf","X-Google-Smtp-Source":"AGHT+IHtHbD2B8EKUQGTyXSdgExtDHZWw/bMZlNXKu7ag58MoRm94aZ5+XQYFWndEzacHwYJ6JWRPA==","X-Received":"by 2002:a05:600c:4511:b0:46e:3d3d:ea92 with SMTP id\n\t5b1f17b1804b1-46e61294dc2mr32208605e9.5.1759412130938; \n\tThu, 02 Oct 2025 06:35:30 -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 v1 2/4] ipa: rpi: Add FE globals as a parameter to\n\tapplyDecompand()","Date":"Thu,  2 Oct 2025 14:26:05 +0100","Message-ID":"<20251002133523.293413-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20251002133523.293413-1-naush@raspberrypi.com>","References":"<20251002133523.293413-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>\n---\n src/ipa/rpi/pisp/pisp.cpp | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)","diff":"diff --git a/src/ipa/rpi/pisp/pisp.cpp b/src/ipa/rpi/pisp/pisp.cpp\nindex e75c87df1924..03c6c47c1bd9 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,18 +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-\tfe_->GetGlobal(feGlobal);\n-\n \tif (!generateDecompandLut(decompandStatus->decompandCurve, decompand.lut, PISP_FE_DECOMPAND_LUT_SIZE)) {\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":["v1","2/4"]}