{"id":25513,"url":"https://patchwork.libcamera.org/api/patches/25513/?format=json","web_url":"https://patchwork.libcamera.org/patch/25513/","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":"<20251211232246.31330-20-bryan.odonoghue@linaro.org>","date":"2025-12-11T23:22:44","name":"[v5,19/20] libcamera: software_isp: lut: Make gamma from lut.cpp available in debayer params","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"7e3165c52936b4a82668272030fb62fd74c41dad","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25513/mbox/","series":[{"id":5656,"url":"https://patchwork.libcamera.org/api/series/5656/?format=json","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/25513/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25513/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 4C685C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 23:24:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 02CB661698;\n\tFri, 12 Dec 2025 00:24:18 +0100 (CET)","from mail-pf1-x430.google.com (mail-pf1-x430.google.com\n\t[IPv6:2607:f8b0:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B222A61623\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 00:24:16 +0100 (CET)","by mail-pf1-x430.google.com with SMTP id\n\td2e1a72fcca58-7b22ffa2a88so659098b3a.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 15:24:16 -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.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Dec 2025 15:24:14 -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=\"gmVi/gSP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765495455; x=1766100255;\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=1/Ms2jejD2I8EStEsni5WUE0UOgduJv8CLqlNoVAcNM=;\n\tb=gmVi/gSPGUEnD5J3QO2z/YLI10yk3DJ8me6apPDa8i3ojz/5Mp5zQMORYiFl0tupYO\n\tOGG1DSMXsllTHzPuSbqoqzIWfgJrPrm57W5Gl/mZglaR4vR1RLRXuwUb5qgahbsU796X\n\t84QSjv8SFhaogxPrBWgQuvd8LOTfnLoZv60rDjaSMtASAkNl3s2a3uP2lKNocafLf2fB\n\t/q2e9iB3N1v6IzV8b/ILLsJtHrItoKR4GyfrkF0ZUS6umB8Sa/nM1K98SKsn8w8jvhaq\n\tqPVMAqLMnwcQRgF3BOd4oXhglXMBXyqRrT75t/X/J6jeDVijgi4cC1zxGTA5vBdJV5q7\n\tRAZA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765495455; x=1766100255;\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=1/Ms2jejD2I8EStEsni5WUE0UOgduJv8CLqlNoVAcNM=;\n\tb=HgcGoJi68g1uOM0aoz8h9mvN2GjksG1g++6RD4Sgivo3ZNwwurxzu7x7IR16RdH9bU\n\tENGYCGKLWtP/+LpDpIkiRucVFQqu+I4k2zAOV9AMl6DnEnH66vgm5BequkHd66K97SIA\n\tbh167ord7I6DsSB59FNRjfsl1ZfclIfoS1DViNubDmqab2coaByMGx1XR3bxL+Ibzqjk\n\taNfl5pvi3RbdvHbn5GhwOpyFS+hpCovFCDl+BYsjI8jw3o1Cc2ysYbdQZevopScU04Nk\n\ttVqYpjEDDRYQsJrPN63lNrGvFsPdPkT15hDBhe8wbyfUvtv9/WxRQMVmCYnX4j3r/aW+\n\tVdgw==","X-Gm-Message-State":"AOJu0YxCLJ/o9emhRjE1ynY2Q4O7ca8dQbZqo2QXgkKy7yO2X9vpo0Rx\n\tRUxGg6EG4OPhSkHNjAm+wXSHUmgokBA3ARbAzjlNysXw4uGscQAwpKFtc4Zrj7FyX7sL1+h8ubB\n\tOURVW","X-Gm-Gg":"AY/fxX79GCR/Wym/O/ZXZP13QlYHWoNZACmA2RNPob37s2H0MrXF5JNjjSDyKIrM54z\n\ts2kwGfiBu4uCbwgLdZFJoR+XxrNT3/44ly7ZPxNR9wT3VYkcERV7e+h7HHW+KMssfVqrhHTx/qO\n\tf3HB39LB/PT/QqruagQLQsSU0B9D3ypyApP2hFyCHDqZdV4xu0/ZEOrde0WoomdMtBpml+yJ6hI\n\tXV1Lr9dralSpiKKbhcckn2uJ1ml/z4H3GdhQvNpI6FDDVq4BhAuX88p4cyonxLQBonpDl5ZpGxQ\n\tY9rosPUi48de2JzQlFmmD8M6DXsLRgfX2M9SrrxeisqGcm2alKcg4Umd5UefW29wUGVqEKZDf2T\n\tGdikGFF4veDa+BbRcMo0Qv1jv54y/P4xYcLgWyYMj2Kzg8MW3VUkctSGv2YrcoB0UBusqWRkr5t\n\tGf6ITB4WEA4Emj2X4g2uGw8KXM9SvYIONnLqkr9/Pf/2gRtSQj503BVQsI3edvK6dX+Hl0hFMx","X-Google-Smtp-Source":"AGHT+IEm1nYyD1B2mSKAmnwW2T8bDF7qTl6Px6NhFXL7cDsGKTNIapHQDhC+dE2Y6Fz5Y6oXGBRTwA==","X-Received":"by 2002:a05:6a00:b904:b0:7e8:4471:ae78 with SMTP id\n\td2e1a72fcca58-7f66a07dac3mr165930b3a.68.1765495455073; \n\tThu, 11 Dec 2025 15:24:15 -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\tMilan Zamazal <mzamazal@redhat.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"[PATCH v5 19/20] libcamera: software_isp: lut: Make gamma from\n\tlut.cpp available in debayer params","Date":"Thu, 11 Dec 2025 23:22:44 +0000","Message-ID":"<20251211232246.31330-20-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":"Provide the gamma used in IPA to Bayer parameters. We will pass Gamma into\nthe shader via a uniform and can then tweak that value from outside at\nwill.\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n include/libcamera/internal/software_isp/debayer_params.h | 1 +\n src/ipa/simple/algorithms/lut.cpp                        | 2 ++\n src/libcamera/software_isp/debayer.cpp                   | 5 +++++\n 3 files changed, 8 insertions(+)","diff":"diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 5a0d9438f..d5dad1a98 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -58,6 +58,7 @@ struct DebayerParams {\n \t */\n \tMatrix<float, 3, 3> ccm;\n \tRGB<float> blackLevel;\n+\tfloat gamma;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\nindex 49482d711..ea5a86b20 100644\n--- a/src/ipa/simple/algorithms/lut.cpp\n+++ b/src/ipa/simple/algorithms/lut.cpp\n@@ -147,6 +147,8 @@ void Lut::prepare(IPAContext &context,\n \t\t\tparams->gammaLut[i] = gammaTable[i / div];\n \t\t}\n \t}\n+\n+\tparams->gamma = context.configuration.gamma;\n }\n \n void Lut::process([[maybe_unused]] IPAContext &context,\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 7334ea197..b3615b32b 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -110,6 +110,11 @@ namespace libcamera {\n  * \\brief Blacklevel gains for the GPUISP\n  */\n \n+/**\n+ * \\var DebayerParams::gamma\n+ * \\brief Gamma value for the GPUISP\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n","prefixes":["v5","19/20"]}