Patch Detail
Show a patch.
GET /api/1.1/patches/22543/?format=api
{ "id": 22543, "url": "https://patchwork.libcamera.org/api/1.1/patches/22543/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22543/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250113135108.13924-9-mzamazal@redhat.com>", "date": "2025-01-13T13:51:05", "name": "[v4,8/9] libcamera: software_isp: Track whether CCM is enabled", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4cce73e3f7b62a9583c3a0fde1c6e7dd158134bf", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22543/mbox/", "series": [ { "id": 4946, "url": "https://patchwork.libcamera.org/api/1.1/series/4946/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4946", "date": "2025-01-13T13:50:57", "name": "Software ISP support for CCM", "version": 4, "mbox": "https://patchwork.libcamera.org/series/4946/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22543/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22543/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 4CC19C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jan 2025 13:51:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DC3AA68557;\n\tMon, 13 Jan 2025 14:51:46 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C7CCF68552\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jan 2025 14:51:44 +0100 (CET)", "from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-503-9OR0a3zlNlmn9zYGYZLbbA-1;\n\tMon, 13 Jan 2025 08:51:42 -0500", "from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.17])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 362E01955DDE; Mon, 13 Jan 2025 13:51:41 +0000 (UTC)", "from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.224.6])\n\tby mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id F37461956056; Mon, 13 Jan 2025 13:51:38 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Ex1DwNO8\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1736776303;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=wEV6O0yE5nijpliaEpOkziOSGfqqkgcYDqeBFZinTdA=;\n\tb=Ex1DwNO8Ny2ZdQhjKKN1P5mY0/R3TN+hln+afNjphourLtbeWLqXYlQz4xCHHLC9GBd0Tp\n\tixLwa4x0zsGlZE9OiXFKBDBL4KaNzwWnJWwWrnb1mbOMwz2OC+T36ast99JQYrucTSXbUK\n\tbSFSLBaOVLI4EGIBFxqkmP8HF2knSsk=", "X-MC-Unique": "9OR0a3zlNlmn9zYGYZLbbA-1", "X-Mimecast-MFC-AGG-ID": "9OR0a3zlNlmn9zYGYZLbbA", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>", "Subject": "[PATCH v4 8/9] libcamera: software_isp: Track whether CCM is enabled", "Date": "Mon, 13 Jan 2025 14:51:05 +0100", "Message-ID": "<20250113135108.13924-9-mzamazal@redhat.com>", "In-Reply-To": "<20250113135108.13924-1-mzamazal@redhat.com>", "References": "<20250113135108.13924-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.17", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "rVQw81vA-nJqIj4YKbdYMJARSbd62r7hA6Lvj5Wwd7k_1736776301", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "Applying color correction matrix (CCM) in software ISP is optional due\nto performance reasons. CCM is applied if and only if `Ccm' algorithm\nis present in the tuning file and it defines some CCM.\n\nSoftware ISP debayering is a performance critical piece of code and we\ndo not want to use dynamic conditionals there. Therefore we pass\ninformation about CCM application to debayering configuration and let it\nselect the right versions of debayering functions using templates. This\nis a similar trick as the previously used one for adding or not adding\nan alpha channel to the output.\n\nDebayering gets this information but it ignores it in this patch.\nActual processing with CCM is added in the followup patch.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n include/libcamera/ipa/soft.mojom | 2 +-\n src/ipa/simple/algorithms/ccm.cpp | 11 +++++--\n src/ipa/simple/algorithms/ccm.h | 1 +\n src/ipa/simple/soft_simple.cpp | 6 ++--\n src/libcamera/software_isp/debayer.cpp | 3 +-\n src/libcamera/software_isp/debayer.h | 3 +-\n src/libcamera/software_isp/debayer_cpu.cpp | 35 ++++++++++++---------\n src/libcamera/software_isp/debayer_cpu.h | 24 +++++++-------\n src/libcamera/software_isp/software_isp.cpp | 5 +--\n 9 files changed, 54 insertions(+), 36 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\nindex d52e6f1a..b5ed3905 100644\n--- a/include/libcamera/ipa/soft.mojom\n+++ b/include/libcamera/ipa/soft.mojom\n@@ -21,7 +21,7 @@ interface IPASoftInterface {\n \tstart() => (int32 ret);\n \tstop();\n \tconfigure(IPAConfigInfo configInfo)\n-\t\t=> (int32 ret);\n+\t\t=> (int32 ret, bool ccmEnabled);\n \n \t[async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n \t[async] computeParams(uint32 frame);\ndiff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\nindex 3c7fca2d..96038966 100644\n--- a/src/ipa/simple/algorithms/ccm.cpp\n+++ b/src/ipa/simple/algorithms/ccm.cpp\n@@ -38,12 +38,17 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n \treturn 0;\n }\n \n-void Ccm::prepare(IPAContext &context, const uint32_t frame,\n-\t\t IPAFrameContext &frameContext, [[maybe_unused]] DebayerParams *params)\n+int Ccm::configure(IPAContext &context,\n+\t\t [[maybe_unused]] const IPAConfigInfo &configInfo)\n {\n \tcontext.activeState.ccm.enabled = ccmEnabled_;\n+\treturn 0;\n+}\n \n-\tif (!ccmEnabled_)\n+void Ccm::prepare(IPAContext &context, const uint32_t frame,\n+\t\t IPAFrameContext &frameContext, [[maybe_unused]] DebayerParams *params)\n+{\n+\tif (!context.activeState.ccm.enabled)\n \t\treturn;\n \n \tunsigned int ct = context.activeState.awb.temperatureK;\ndiff --git a/src/ipa/simple/algorithms/ccm.h b/src/ipa/simple/algorithms/ccm.h\nindex 23481a08..fe81ebd5 100644\n--- a/src/ipa/simple/algorithms/ccm.h\n+++ b/src/ipa/simple/algorithms/ccm.h\n@@ -24,6 +24,7 @@ public:\n \t~Ccm() = default;\n \n \tint init(IPAContext &context, const YamlObject &tuningData) override;\n+\tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n \tvoid prepare(IPAContext &context,\n \t\t const uint32_t frame,\n \t\t IPAFrameContext &frameContext,\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex b26e4e15..9b32e02b 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -52,7 +52,7 @@ public:\n \t\t const SharedFD &fdParams,\n \t\t const ControlInfoMap &sensorInfoMap,\n \t\t ControlInfoMap *ipaControls) override;\n-\tint configure(const IPAConfigInfo &configInfo) override;\n+\tint configure(const IPAConfigInfo &configInfo, bool *ccmEnabled) override;\n \n \tint start() override;\n \tvoid stop() override;\n@@ -182,7 +182,7 @@ int IPASoftSimple::init(const IPASettings &settings,\n \treturn 0;\n }\n \n-int IPASoftSimple::configure(const IPAConfigInfo &configInfo)\n+int IPASoftSimple::configure(const IPAConfigInfo &configInfo, bool *ccmEnabled)\n {\n \tsensorInfoMap_ = configInfo.sensorControls;\n \n@@ -248,6 +248,8 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)\n \t\t\treturn ret;\n \t}\n \n+\t*ccmEnabled = context_.activeState.ccm.enabled;\n+\n \tLOG(IPASoft, Info)\n \t\t<< \"Exposure \" << context_.configuration.agc.exposureMin << \"-\"\n \t\t<< context_.configuration.agc.exposureMax\ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex f0b83261..45fe6960 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -57,10 +57,11 @@ Debayer::~Debayer()\n }\n \n /**\n- * \\fn int Debayer::configure(const StreamConfiguration &inputCfg, const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs)\n+ * \\fn int Debayer::configure(const StreamConfiguration &inputCfg, const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs, bool ccmEnabled)\n * \\brief Configure the debayer object according to the passed in parameters\n * \\param[in] inputCfg The input configuration\n * \\param[in] outputCfgs The output configurations\n+ * \\param[in] ccmEnabled Whether a color correction matrix is applied\n *\n * \\return 0 on success, a negative errno on failure\n */\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex d7ca060d..ba033d44 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -33,7 +33,8 @@ public:\n \tvirtual ~Debayer() = 0;\n \n \tvirtual int configure(const StreamConfiguration &inputCfg,\n-\t\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs) = 0;\n+\t\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs,\n+\t\t\t bool ccmEnabled) = 0;\n \n \tvirtual std::vector<PixelFormat> formats(PixelFormat inputFormat) = 0;\n \ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 01cfb36b..3c6597f9 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -114,7 +114,7 @@ DebayerCpu::~DebayerCpu() = default;\n \t\t(prev[x] + curr[x - p] + curr[x + n] + next[x]) / (4 * (div)), \\\n \t\tcurr[x] / (div))\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer8_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint8_t)\n@@ -125,7 +125,7 @@ void DebayerCpu::debayer8_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer8_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint8_t)\n@@ -136,7 +136,7 @@ void DebayerCpu::debayer8_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint16_t)\n@@ -148,7 +148,7 @@ void DebayerCpu::debayer10_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint16_t)\n@@ -160,7 +160,7 @@ void DebayerCpu::debayer10_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer12_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint16_t)\n@@ -172,7 +172,7 @@ void DebayerCpu::debayer12_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer12_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tDECLARE_SRC_POINTERS(uint16_t)\n@@ -184,7 +184,7 @@ void DebayerCpu::debayer12_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10P_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tconst int widthInBytes = window_.width * 5 / 4;\n@@ -210,7 +210,7 @@ void DebayerCpu::debayer10P_BGBG_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10P_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tconst int widthInBytes = window_.width * 5 / 4;\n@@ -231,7 +231,7 @@ void DebayerCpu::debayer10P_GRGR_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10P_GBGB_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tconst int widthInBytes = window_.width * 5 / 4;\n@@ -252,7 +252,7 @@ void DebayerCpu::debayer10P_GBGB_BGR888(uint8_t *dst, const uint8_t *src[])\n \t}\n }\n \n-template<bool addAlphaByte>\n+template<bool addAlphaByte, bool ccmEnabled>\n void DebayerCpu::debayer10P_RGRG_BGR888(uint8_t *dst, const uint8_t *src[])\n {\n \tconst int widthInBytes = window_.width * 5 / 4;\n@@ -368,10 +368,11 @@ int DebayerCpu::setupStandardBayerOrder(BayerFormat::Order order)\n \treturn 0;\n }\n \n-#define SET_DEBAYER_METHODS(method0, method1) \\\n-\tdebayer0_ = addAlphaByte ? &DebayerCpu::method0<true> : &DebayerCpu::method0<false>; \\\n-\tdebayer1_ = addAlphaByte ? &DebayerCpu::method1<true> : &DebayerCpu::method1<false>;\n+#define SET_DEBAYER_METHODS(method0, method1) \\\n+\tdebayer0_ = addAlphaByte ? &DebayerCpu::method0<true, ccmEnabled> : &DebayerCpu::method0<false, ccmEnabled>; \\\n+\tdebayer1_ = addAlphaByte ? &DebayerCpu::method1<true, ccmEnabled> : &DebayerCpu::method1<false, ccmEnabled>;\n \n+template<bool ccmEnabled>\n int DebayerCpu::setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputFormat)\n {\n \tBayerFormat bayerFormat =\n@@ -464,7 +465,8 @@ int DebayerCpu::setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputF\n }\n \n int DebayerCpu::configure(const StreamConfiguration &inputCfg,\n-\t\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs)\n+\t\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs,\n+\t\t\t bool ccmEnabled)\n {\n \tif (getInputConfig(inputCfg.pixelFormat, inputConfig_) != 0)\n \t\treturn -EINVAL;\n@@ -503,7 +505,10 @@ int DebayerCpu::configure(const StreamConfiguration &inputCfg,\n \t\treturn -EINVAL;\n \t}\n \n-\tif (setDebayerFunctions(inputCfg.pixelFormat, outputCfg.pixelFormat) != 0)\n+\tint ret = ccmEnabled\n+\t\t\t ? setDebayerFunctions<true>(inputCfg.pixelFormat, outputCfg.pixelFormat)\n+\t\t\t : setDebayerFunctions<false>(inputCfg.pixelFormat, outputCfg.pixelFormat);\n+\tif (ret != 0)\n \t\treturn -EINVAL;\n \n \twindow_.x = ((inputCfg.size.width - outputCfg.size.width) / 2) &\ndiff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\nindex 2c47e7c6..b2ec8f1b 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -31,7 +31,8 @@ public:\n \t~DebayerCpu();\n \n \tint configure(const StreamConfiguration &inputCfg,\n-\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs);\n+\t\t const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs,\n+\t\t bool ccmEnabled);\n \tSize patternSize(PixelFormat inputFormat);\n \tstd::vector<PixelFormat> formats(PixelFormat input);\n \tstd::tuple<unsigned int, unsigned int>\n@@ -85,28 +86,28 @@ private:\n \tusing debayerFn = void (DebayerCpu::*)(uint8_t *dst, const uint8_t *src[]);\n \n \t/* 8-bit raw bayer format */\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer8_BGBG_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer8_GRGR_BGR888(uint8_t *dst, const uint8_t *src[]);\n \t/* unpacked 10-bit raw bayer format */\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10_BGBG_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10_GRGR_BGR888(uint8_t *dst, const uint8_t *src[]);\n \t/* unpacked 12-bit raw bayer format */\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer12_BGBG_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer12_GRGR_BGR888(uint8_t *dst, const uint8_t *src[]);\n \t/* CSI-2 packed 10-bit raw bayer format (all the 4 orders) */\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10P_BGBG_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10P_GRGR_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10P_GBGB_BGR888(uint8_t *dst, const uint8_t *src[]);\n-\ttemplate<bool addAlphaByte>\n+\ttemplate<bool addAlphaByte, bool ccmEnabled>\n \tvoid debayer10P_RGRG_BGR888(uint8_t *dst, const uint8_t *src[]);\n \n \tstruct DebayerInputConfig {\n@@ -125,6 +126,7 @@ private:\n \tint getInputConfig(PixelFormat inputFormat, DebayerInputConfig &config);\n \tint getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config);\n \tint setupStandardBayerOrder(BayerFormat::Order order);\n+\ttemplate<bool ccmEnabled>\n \tint setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputFormat);\n \tvoid setupInputMemcpy(const uint8_t *linePointers[]);\n \tvoid shiftLinePointers(const uint8_t *linePointers[], const uint8_t *src);\ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 2bea64d9..6a07de85 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -236,11 +236,12 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,\n {\n \tASSERT(ipa_ && debayer_);\n \n-\tint ret = ipa_->configure(configInfo);\n+\tbool ccmEnabled;\n+\tint ret = ipa_->configure(configInfo, &ccmEnabled);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\treturn debayer_->configure(inputCfg, outputCfgs);\n+\treturn debayer_->configure(inputCfg, outputCfgs, ccmEnabled);\n }\n \n /**\n", "prefixes": [ "v4", "8/9" ] }