[{"id":36109,"web_url":"https://patchwork.libcamera.org/comment/36109/","msgid":"<CAHW6GYLeQG8pGQHKWdNDFHXRwXoNaB4=+sMRs20B4JNk44pLAA@mail.gmail.com>","date":"2025-10-03T14:07:42","subject":"Re: [PATCH v2 2/4] ipa: rpi: Add FE globals as a parameter to\n\tapplyDecompand()","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Fri, 3 Oct 2025 at 13:18, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Don't let applyDecompand() directly change the FE global enables.\n> Instead pass the global mask into the function and set it in the caller.\n> This will be needed when a future commit will add setting the decompand\n> initial values.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Tested-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n> ---\n>  src/ipa/rpi/pisp/pisp.cpp | 15 +++++++++------\n>  1 file changed, 9 insertions(+), 6 deletions(-)\n>\n> diff --git a/src/ipa/rpi/pisp/pisp.cpp b/src/ipa/rpi/pisp/pisp.cpp\n> index 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>         void applyLensShading(const AlscStatus *alscStatus,\n>                               pisp_be_global_config &global);\n>         void applyDPC(const DpcStatus *dpcStatus, pisp_be_global_config &global);\n> -       void applyDecompand(const DecompandStatus *decompandStatus);\n> +       void applyDecompand(const DecompandStatus *decompandStatus, pisp_fe_global_config &feGlobal);\n>         void applySdn(const SdnStatus *sdnStatus, pisp_be_global_config &global);\n>         void applyTdn(const TdnStatus *tdnStatus, const DeviceStatus *deviceStatus,\n>                       pisp_be_global_config &global);\n> @@ -368,6 +368,9 @@ void IpaPiSP::platformPrepareIsp([[maybe_unused]] const PrepareParams &params,\n>         {\n>                 /* All Frontend config goes first, we do not want to hold the FE lock for long! */\n>                 std::scoped_lock<FrontEnd> lf(*fe_);\n> +               pisp_fe_global_config feGlobal;\n> +\n> +               fe_->GetGlobal(feGlobal);\n>\n>                 if (noiseStatus)\n>                         applyFocusStats(noiseStatus);\n> @@ -375,13 +378,14 @@ void IpaPiSP::platformPrepareIsp([[maybe_unused]] const PrepareParams &params,\n>                 DecompandStatus *decompandStatus =\n>                         rpiMetadata.getLocked<DecompandStatus>(\"decompand.status\");\n>                 if (decompandStatus)\n> -                       applyDecompand(decompandStatus);\n> +                       applyDecompand(decompandStatus, feGlobal);\n>\n>                 BlackLevelStatus *blackLevelStatus =\n>                         rpiMetadata.getLocked<BlackLevelStatus>(\"black_level.status\");\n>                 if (blackLevelStatus)\n>                         applyBlackLevel(blackLevelStatus, global);\n>\n> +               fe_->SetGlobal(feGlobal);\n>         }\n>\n>         CacStatus *cacStatus = rpiMetadata.getLocked<CacStatus>(\"cac.status\");\n> @@ -728,16 +732,15 @@ void IpaPiSP::applyDPC(const DpcStatus *dpcStatus, pisp_be_global_config &global\n>         be_->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> -       pisp_fe_global_config feGlobal;\n>         pisp_fe_decompand_config decompand = {};\n>\n>         if (!generateDecompandLut(decompandStatus->decompandCurve, decompand.lut)) {\n>                 fe_->SetDecompand(decompand);\n>                 feGlobal.enables |= PISP_FE_ENABLE_DECOMPAND;\n> -               fe_->SetGlobal(feGlobal);\n> -       }\n> +       } else\n> +               feGlobal.enables &= ~PISP_FE_ENABLE_DECOMPAND;\n>  }\n>\n>  void IpaPiSP::applySdn(const SdnStatus *sdnStatus, pisp_be_global_config &global)\n> --\n> 2.43.0\n>","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 9E83DC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Oct 2025 14:07:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8F4786B5AA;\n\tFri,  3 Oct 2025 16:07:56 +0200 (CEST)","from mail-qk1-x733.google.com (mail-qk1-x733.google.com\n\t[IPv6:2607:f8b0:4864:20::733])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0CCB169318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Oct 2025 16:07:55 +0200 (CEST)","by mail-qk1-x733.google.com with SMTP id\n\taf79cd13be357-859b2ec0556so237524385a.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Oct 2025 07:07:54 -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=\"rwVA/5Ww\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1759500474; x=1760105274;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Um/6VfkmmGQfPNTaOSHuC6Jm/I1VjcI8l/vWHMeBwrI=;\n\tb=rwVA/5Ww1OydSkCLEj7JMN473/gEx7vJR7qccHLDSV5vW1OiQnqWeSgmjwF1p5nakq\n\tJUgkbMV5FtJuKMFs8QruNtYB0nQn0G4DydS3DyiXkLFi2PVFxbaIrPwuYLB2grGdz4vI\n\tsOLGaDNoj53SvmcQmjzpcmgGZMrfVBLtDcvcE9GXv7PEEMw0KZS2PpeZk3/8kWrNVs4m\n\t+8QDa7zhMoVIDQo/ayxI6X8iK0ycA+r68++oQqQoKudGKcEdNiLO+d1vUwtzToTyocb9\n\t5qC/SqxehS1GJ5dVe0UJcvdd72ecVkduSYzOA12A3EPjhLwXE29zA8C+O6Gvp8S6+/xN\n\tcCrg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759500474; x=1760105274;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=Um/6VfkmmGQfPNTaOSHuC6Jm/I1VjcI8l/vWHMeBwrI=;\n\tb=aqg8r/dIKtHiYRGl7WjHyHGzyg4EdM7FIB1g6QOyjaQkle/GGcrc/iYAd34Y+ULp/6\n\tSlfT/RuThjbtF0sOsEo7e06MYs6WlUVaruBOZYuFRVQCHSRtDQCG97uc8MxPDkJaomC9\n\tjBDyCbZ4EtFhlEkuZaSzVZ1pDg/OT049dj/KbpbXI1wz2AOlML5FFi333TIGY/oRjnOq\n\tsAfU6n0aoieiUm/b7T4WCUwXSHxp8BdQXxHdrVKDK1J+QL+aOqTD2N6eD56Zww03ykHV\n\tS+B/Ri3J+qBAj1gRRJZeBK/QZlnlG/REjVclYQHBHC09rCTIAtqicyj3V+XFdRkTCEc+\n\tUbZQ==","X-Gm-Message-State":"AOJu0Yz2XoiAXtwbm+/KOQnUt4g5PCNLsFGHQNTl9Jmj608bHDYldyB2\n\tFiKiDdlhzNaDD3lHfq0d504rglDh53V9pj4OgHReB6muzu+b8/oWfiieHTSd4hP8K0sFUdJNHou\n\tH4SPpeBMJkIvoqET6zfZQATMExN+o/2WW6ctDcYPmsA==","X-Gm-Gg":"ASbGnctv34N06IfdgUb7NcBqExZyNNIwzNKH9BF9mZF8BTPpHYa0CiCmufqIEXMBS74\n\tFJgij8gj1k3RPR3C+TekVUlKMNceU+04cQKmDBj+w9lQGaayZgK9hV7a7ebnvF3yqqAfF+w0UmG\n\tspgg/fVhbfk9i6XuJMEqXlBLM1mCfxDMgcm+8h7SoucE4ejSph0IuBwnjXRxrUqPd3m8nM4SWIt\n\t0OlGwytU67ldxl2wevC1WSI1Hp91sevotX8eLwwHJT/CL4+LSUeGlw73zIddzo=","X-Google-Smtp-Source":"AGHT+IGBhwruY+XSbFFQ9B6QaNYkREyerDhZqfCehEzFGtha14oLWTdd/7EMiCccWVsRE0Wx+kMy4jCJasI+IfvapW4=","X-Received":"by 2002:a05:620a:6cca:b0:863:696d:e368 with SMTP id\n\taf79cd13be357-87a3b8913b0mr377511985a.83.1759500473789;\n\tFri, 03 Oct 2025 07:07:53 -0700 (PDT)","MIME-Version":"1.0","References":"<20251003121821.659081-1-naush@raspberrypi.com>\n\t<20251003121821.659081-3-naush@raspberrypi.com>","In-Reply-To":"<20251003121821.659081-3-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Fri, 3 Oct 2025 15:07:42 +0100","X-Gm-Features":"AS18NWDrIKocvCR2tZYNOz2s6wWq4nQqEbfWy8DeXs9m4a0BCMGAIQPiYaV7-ag","Message-ID":"<CAHW6GYLeQG8pGQHKWdNDFHXRwXoNaB4=+sMRs20B4JNk44pLAA@mail.gmail.com>","Subject":"Re: [PATCH v2 2/4] ipa: rpi: Add FE globals as a parameter to\n\tapplyDecompand()","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tNick Hollinghurst <nick.hollinghurst@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","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>"}}]