{"id":25413,"url":"https://patchwork.libcamera.org/api/1.1/patches/25413/?format=json","web_url":"https://patchwork.libcamera.org/patch/25413/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20251210003139.43606-18-bryan.odonoghue@linaro.org>","date":"2025-12-10T00:31:34","name":"[v4,17/20] libcamera: software_isp: lut: Make CCM available in debayer params","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f9a37f61045bc5413e56d460d2e1b8c1956e3e48","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/1.1/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25413/mbox/","series":[{"id":5644,"url":"https://patchwork.libcamera.org/api/1.1/series/5644/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5644","date":"2025-12-10T00:31:17","name":"GPUISP precursor series","version":4,"mbox":"https://patchwork.libcamera.org/series/5644/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25413/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25413/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 DFBADBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 00:32:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CDEF61471;\n\tWed, 10 Dec 2025 01:32:42 +0100 (CET)","from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com\n\t[IPv6:2607:f8b0:4864:20::102f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40D3360C8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 01:32:41 +0100 (CET)","by mail-pj1-x102f.google.com with SMTP id\n\t98e67ed59e1d1-3438231df5fso7847703a91.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Dec 2025 16:32:41 -0800 (PST)","from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp.\n\t[150.147.107.6]) by smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-34a70427ea6sm566580a91.3.2025.12.09.16.32.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Dec 2025 16:32:39 -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=\"tcJfGFsp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765326760; x=1765931560;\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=tX8SQUKwoSIuWZvIfVWFvgmrgrfM2uE6n18+JCpQbRw=;\n\tb=tcJfGFsp8Os5D2HaxxC4ss8TLcZLu0aCTYE8vZc2HyBux9ZrlStfZp0AGTqeC4He4W\n\tjUiVn3zMa7i0rT8MBs9TpiBa/yZgaeeVunJpEOSoqs04a0eyT8oceZxLFMDr/Dcn1Zx1\n\tzAHpzVt0lWcJ51V9OVykVNqHZiQBmHZmWqaZihjggYdhIrYNH1Fq4xiXk6+l+G9lD9Bb\n\tXVu/++eL7AB28G+YPFpLyepMq44Q/8igb5jP42Du3Lllx085xFwLbjgvwIs7wMfBI23h\n\tLs/JMtKFaWfE6Q0WdnQ6LrO4ksokRyC+rsCcmCZqZQ6s0J5AvksJu5hTb0sRreelnUYt\n\tO9zA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765326760; x=1765931560;\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=tX8SQUKwoSIuWZvIfVWFvgmrgrfM2uE6n18+JCpQbRw=;\n\tb=cPiVkBgiuDVLZyEIf0CquRQ8g6ABB33EpUIe5oV6DUvB14+PKkBj//SDBo0BiF7VsV\n\tri47AdTzIFPojWMP/0deRGlT/Co0G9LGcL9jRGK2xa4OaWL33186TozONxgJaTo0bGUg\n\tYM5J1p2ESrqhntJJ0a0C8JhhUDdKnv8loTk4ABAguosB2kTzQN0LH6osgSGvA4hxEj4i\n\tKSqieZ4n/O61wfV23TYFXeFlnucergq4BXurYw05XGz2XGlqdWz2/kITf10cqdmg8Q1s\n\tn8WLsCGiOuRfVG9RnjLGVqG9RRbacblxGmvNjYDTFHU9nPmnawIJZEDTFPCOf5+Q/N5q\n\tpJmg==","X-Gm-Message-State":"AOJu0YyKGdK++dVaYze+bQcQecIUf/XqR6UWpRSGv148AqeBUR4Tzxdr\n\tpbecOvA+ry7ct5UH6vxTiYeCp1RUrDxzoTZYVxgxQl08RBgWusjyHljtUCtiYciWfgkY14bvzkU\n\twwk0L","X-Gm-Gg":"AY/fxX7p3MYMj9elLs1qq3cSFq0L4uG7NcgTQPqHQ/Xo6WKjhX4vrP0JOhq3+MoPTwD\n\tS041m4gjMsJVs1LV+DpCFZLNPoUAU8/nj5gvMZLL6F2XOnscpCV+zyjcyXghQauRyeIlo7bQIiY\n\tJZqvS4v2kXJXvlcyLNGX5hF5MYAhEiilGuxNoIbfByuEf41ZP7aceRJx6jBJUKp0eepBdEsYgrx\n\tTPevS9R7ahrxZPVixD/zuP5xDn+6gYa5g77Hq44zi830zIL3GlAyrLpDY5kQOqpUTu8CIAt2d34\n\tPQojm0RKewqBfEW1DF5EuYjlTVRrq8fuctqUMSYIqgQ8qFkp4YFM6J08gHKpGDUTtbQWX5tJ2Wf\n\tOQzR6Ln6bkT0xSYQOBQlZLweyQMk2WpLLWyxILrVCV7X4YyHGYSuW4+IXyZWrM+OwuxwPhbec7w\n\tWARpN+s6NnnegEhM6JygR/vnWqPkD3fX3CLPAIo4WbTG7aNTwX9dQVDW7+g3yzW34d","X-Google-Smtp-Source":"AGHT+IGXrRgjpH6gEJvCo0otHHWRX6LXwao91E6dI4V5Q3WICcV8krrwXBPtldhZ6Np9kizCRkzTzg==","X-Received":"by 2002:a17:90b:2f84:b0:341:d326:7354 with SMTP id\n\t98e67ed59e1d1-34a7288c11fmr574054a91.37.1765326759570; \n\tTue, 09 Dec 2025 16:32:39 -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\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"[PATCH v4 17/20] libcamera: software_isp: lut: Make CCM available in\n\tdebayer params","Date":"Wed, 10 Dec 2025 00:31:34 +0000","Message-ID":"<20251210003139.43606-18-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20251210003139.43606-1-bryan.odonoghue@linaro.org>","References":"<20251210003139.43606-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 CCM calculated in LUT to the debayer params structure for\nconsumption in the debayer shaders.\n\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 | 7 +++++++\n src/ipa/simple/algorithms/lut.cpp                        | 1 +\n src/libcamera/software_isp/debayer.cpp                   | 5 +++++\n 3 files changed, 13 insertions(+)","diff":"diff --git a/include/libcamera/internal/software_isp/debayer_params.h b/include/libcamera/internal/software_isp/debayer_params.h\nindex 217cd5d92..4b203e211 100644\n--- a/include/libcamera/internal/software_isp/debayer_params.h\n+++ b/include/libcamera/internal/software_isp/debayer_params.h\n@@ -13,6 +13,8 @@\n #include <array>\n #include <stdint.h>\n \n+#include \"libcamera/internal/matrix.h\"\n+\n namespace libcamera {\n \n struct DebayerParams {\n@@ -49,6 +51,11 @@ struct DebayerParams {\n \tCcmLookupTable greenCcm;\n \tCcmLookupTable blueCcm;\n \tLookupTable gammaLut;\n+\n+\t/*\n+\t * Per frame corrections as calculated by the IPA\n+\t */\n+\tMatrix<float, 3, 3> ccm;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/simple/algorithms/lut.cpp b/src/ipa/simple/algorithms/lut.cpp\nindex d4a79e101..49482d711 100644\n--- a/src/ipa/simple/algorithms/lut.cpp\n+++ b/src/ipa/simple/algorithms/lut.cpp\n@@ -133,6 +133,7 @@ void Lut::prepare(IPAContext &context,\n \t\tauto &red = params->redCcm;\n \t\tauto &green = params->greenCcm;\n \t\tauto &blue = params->blueCcm;\n+\t\tparams->ccm = ccm;\n \t\tfor (unsigned int i = 0; i < DebayerParams::kRGBLookupSize; i++) {\n \t\t\tred[i].r = ccmValue(i, ccm[0][0]);\n \t\t\tred[i].g = ccmValue(i, ccm[1][0]);\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 32a2c8378..0ee23f36c 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -100,6 +100,11 @@ namespace libcamera {\n  * \\brief Gamma lookup table used with color correction matrix\n  */\n \n+/**\n+ * \\var DebayerParams::ccm\n+ * \\brief Per frame colour correction matrix for GPUISP\n+ */\n+\n /**\n  * \\class Debayer\n  * \\brief Base debayering class\n","prefixes":["v4","17/20"]}