{"id":25233,"url":"https://patchwork.libcamera.org/api/1.1/patches/25233/?format=json","web_url":"https://patchwork.libcamera.org/patch/25233/","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":"<20251127022256.178929-20-bryan.odonoghue@linaro.org>","date":"2025-11-27T02:22:51","name":"[v2,19/22] libcamera: software_isp: lut: Make CCM available in debayer params","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"9b41a28e3af97733f285f35774c8b44b08774105","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/25233/mbox/","series":[{"id":5616,"url":"https://patchwork.libcamera.org/api/1.1/series/5616/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5616","date":"2025-11-27T02:22:32","name":"GPUISP precursor series","version":2,"mbox":"https://patchwork.libcamera.org/series/5616/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25233/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25233/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 725C3C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Nov 2025 02:23:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 12FA760B36;\n\tThu, 27 Nov 2025 03:23:49 +0100 (CET)","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 40F3360AB3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Nov 2025 03:23:45 +0100 (CET)","by mail-wm1-x32b.google.com with SMTP id\n\t5b1f17b1804b1-47775fb6cb4so1770975e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Nov 2025 18:23:45 -0800 (PST)","from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4790b0e21e8sm71549495e9.15.2025.11.26.18.23.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 26 Nov 2025 18:23:43 -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=\"NVoJeHjF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1764210224; x=1764815024;\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=nQ95/jmePJyWEIfQTGXeTeGzLrO6Eq0ZC4qHC+vGgRQ=;\n\tb=NVoJeHjFaJFFXUwsPXxmNajZaV/SGpID7J93jjCgRJ84w8LFRg3GDYAc1BZHwQ9ZI6\n\tdNFlGdsSnzAWDuX9vsNoLvINyJBR35g3tJwofUzaUDsNn8h6160X24JH6ZFUO456DHXu\n\tDBHMnxQZw2bt+COUAn8CJ7VXNkxAnLepDXldMeXc7pQqU8iRHTUce6OjRh3vJ2jxl07U\n\tEYrPaybsbbGkUjRXgDZEgo3+H04zDs+NoxYkvK7qRV5m02QXaY/AX0myOEoRsha81JUx\n\twaYru4Fg1kodhBV6sEEqldoa7+bq/szPII01FoNtq23xDR/qcvsXBss/hvNpzS3xNtvA\n\tYswQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1764210224; x=1764815024;\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=nQ95/jmePJyWEIfQTGXeTeGzLrO6Eq0ZC4qHC+vGgRQ=;\n\tb=r/zhya2bV9UfeoeKDfN+yaGMEGIkLcnsYUKmPhnhzxCU4OEB6TfKFEErcpDAi4h+FF\n\tjIv8TyjEooR5U88/HizNOOGzWwKv8BmTME8QWB6S5qDleBaoTG7h/GFjVaLWo/k4x21r\n\tT9VY7d9iIN/0TvlzzcWVNhPeNqHyP0GPOYbC5Xswt7qVGVDzDtI1Sq1takNfzjTCo039\n\tK7Es9Zj4Z6QRbIvb4WEzoLqGGAkHjjjv9rQYEIENPMaflGZzGPYXCXwI3ihaVgvyw1oC\n\tJptCQSWT6Ivffme1gz84VdUC347FAVbLe6tXgenenBGRC/RZNxUS86zKDhaIU9Zi4Xjh\n\t8Qgw==","X-Gm-Message-State":"AOJu0YwSMjnn87DF2h1nzPSGFKEsmRrNd4mY0AXP2F20u/ZVjHViKlSR\n\tNqZBeUj60dIIP+21se2ETnVVlX4jw4EHiLiDtB/4mFgcN4FvhNmCkchiRNi8jWgTOx7a0BMQkbQ\n\t6wKAHEtc=","X-Gm-Gg":"ASbGnct3YXES0WDTbG3I/On9nB/Mlh/S4onXqjHemFYIUQm6iMKrhegcFbvOrOZnRFC\n\tMx6eJoDvTWz+bS/IYfrF/J6zKaa24wvuoN/vblnGoKlxqZ6zshSsz5bhMC3rG1nUwN4rAlTaCeP\n\teoLjae5X0TjDbwelMweJreHMWmDT9Gf8pTCqe2KC1rlC4TVmnrRNgalR4RCE0Bes+zqHhzOHc5V\n\tetk7bYqTRWzqYoI4d4FUIQIYugAy0w2zYsJaecPywjnv73JI2MTxEIbksywPDf2/SDWBgD6yenX\n\t+/DQ5IBu4+rm9IxMxhsvoMq3MK0KMJ0D9aGRBYPZLWpyGG7IdcbyHJwdPR2flEizZhYDxlTBYIJ\n\toMRz/2fiJaYgDnB1niziRqaY5oyA/no7f+JtcDj5LlHUhYEV+OIS9H4d3ql3YOL7EY5ZLQEE0eV\n\tTFTDvzcxpWkbyiF9g1LlXjrxNcW26X1/Uo4VscKjDz1N1SyHamyoTFKtZnQVBwcppWXjk=","X-Google-Smtp-Source":"AGHT+IFf2+wvGsKy4b0ndvv87M45heVdDxn3DjIqh4IVhxQbVQ2UvkwDQbVAtnbDhAPg8ZChYbvv2Q==","X-Received":"by 2002:a05:600c:198e:b0:46e:33b2:c8da with SMTP id\n\t5b1f17b1804b1-477c1133927mr218326255e9.32.1764210224591; \n\tWed, 26 Nov 2025 18:23:44 -0800 (PST)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>","Subject":"[PATCH v2 19/22] libcamera: software_isp: lut: Make CCM available in\n\tdebayer params","Date":"Thu, 27 Nov 2025 02:22:51 +0000","Message-ID":"<20251127022256.178929-20-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.51.2","In-Reply-To":"<20251127022256.178929-1-bryan.odonoghue@linaro.org>","References":"<20251127022256.178929-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\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 1d135b278..4ec76dce6 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":["v2","19/22"]}