{"id":22771,"url":"https://patchwork.libcamera.org/api/patches/22771/?format=json","web_url":"https://patchwork.libcamera.org/patch/22771/","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":"<20250207101703.21149-10-mzamazal@redhat.com>","date":"2025-02-07T10:17:01","name":"[v7,09/10] libcamera: software_isp: Track whether CCM is enabled","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a60546425c02672768d6bd32c07df474e05b9009","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22771/mbox/","series":[{"id":4994,"url":"https://patchwork.libcamera.org/api/series/4994/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4994","date":"2025-02-07T10:16:52","name":"Software ISP support for CCM","version":7,"mbox":"https://patchwork.libcamera.org/series/4994/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22771/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22771/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 839D6C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 Feb 2025 10:17:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3444E6862B;\n\tFri,  7 Feb 2025 11:17:42 +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 E32AB68624\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 Feb 2025 11:17:39 +0100 (CET)","from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-553-LRb_ocrkNMeUlwSl57J6ig-1;\n\tFri, 07 Feb 2025 05:17:37 -0500","from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.15])\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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 6D5EA180036F; Fri,  7 Feb 2025 10:17:36 +0000 (UTC)","from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.226.123])\n\tby mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 344591955F1B; Fri,  7 Feb 2025 10:17:33 +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=\"Thr/hGZP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1738923458;\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=oRYpEViOgcz2ko14P9mS5nNd4l3hlhJI8ocwVH0ATLY=;\n\tb=Thr/hGZPsdhofSx358zSlm7AjW6ZysKBTuv6evopzrtia2QA8hdmyKE7Jd1KNw0RQMJrgX\n\tohtfPdBfiv7b3+CTCNTlKDAykvr6zUxawcCcm/JzTlyb9wVO6I9BXCPgqtlpK3BUcqcALu\n\t/k0c9vCgDNcjeuGt6JRokwJWFFOeYhQ=","X-MC-Unique":"LRb_ocrkNMeUlwSl57J6ig-1","X-Mimecast-MFC-AGG-ID":"LRb_ocrkNMeUlwSl57J6ig","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 v7 09/10] libcamera: software_isp: Track whether CCM is\n\tenabled","Date":"Fri,  7 Feb 2025 11:17:01 +0100","Message-ID":"<20250207101703.21149-10-mzamazal@redhat.com>","In-Reply-To":"<20250207101703.21149-1-mzamazal@redhat.com>","References":"<20250207101703.21149-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.15","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"2olIugpj2GEhriQlidSMHF1SVmOvit2xnodsaeAkqxM_1738923456","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.\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 trick similar to 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>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../internal/software_isp/software_isp.h      |  1 +\n include/libcamera/ipa/soft.mojom              |  2 +-\n src/ipa/simple/algorithms/ccm.cpp             |  2 +\n src/ipa/simple/ipa_context.h                  |  1 +\n src/ipa/simple/soft_simple.cpp                |  8 +++-\n src/libcamera/software_isp/debayer.cpp        |  3 +-\n src/libcamera/software_isp/debayer.h          |  3 +-\n src/libcamera/software_isp/debayer_cpu.cpp    | 44 ++++++++++++-------\n src/libcamera/software_isp/debayer_cpu.h      | 29 ++++++------\n src/libcamera/software_isp/software_isp.cpp   |  5 ++-\n 10 files changed, 61 insertions(+), 37 deletions(-)","diff":"diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\nindex 440a296d..0412315b 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -98,6 +98,7 @@ private:\n \tSharedMemObject<DebayerParams> sharedParams_;\n \tDebayerParams debayerParams_;\n \tDmaBufAllocator dmaHeap_;\n+\tbool ccmEnabled_;\n \n \tstd::unique_ptr<ipa::soft::IPAProxySoft> ipa_;\n };\ndiff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\nindex d52e6f1a..ede74413 100644\n--- a/include/libcamera/ipa/soft.mojom\n+++ b/include/libcamera/ipa/soft.mojom\n@@ -17,7 +17,7 @@ interface IPASoftInterface {\n \t     libcamera.SharedFD fdStats,\n \t     libcamera.SharedFD fdParams,\n \t     libcamera.ControlInfoMap sensorCtrlInfoMap)\n-\t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls);\n+\t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled);\n \tstart() => (int32 ret);\n \tstop();\n \tconfigure(IPAConfigInfo configInfo)\ndiff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp\nindex 86e0395c..d5ba928d 100644\n--- a/src/ipa/simple/algorithms/ccm.cpp\n+++ b/src/ipa/simple/algorithms/ccm.cpp\n@@ -34,6 +34,8 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData\n \t\treturn ret;\n \t}\n \n+\tcontext.ccmEnabled = true;\n+\n \treturn 0;\n }\n \ndiff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\nindex 57883218..f0d52d6b 100644\n--- a/src/ipa/simple/ipa_context.h\n+++ b/src/ipa/simple/ipa_context.h\n@@ -82,6 +82,7 @@ struct IPAContext {\n \tIPAActiveState activeState;\n \tFCQueue<IPAFrameContext> frameContexts;\n \tControlInfoMap::Map ctrlMap;\n+\tbool ccmEnabled;\n };\n \n } /* namespace ipa::soft */\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex b26e4e15..a87c6cdd 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -51,7 +51,8 @@ public:\n \t\t const SharedFD &fdStats,\n \t\t const SharedFD &fdParams,\n \t\t const ControlInfoMap &sensorInfoMap,\n-\t\t ControlInfoMap *ipaControls) override;\n+\t\t ControlInfoMap *ipaControls,\n+\t\t bool *ccmEnabled) override;\n \tint configure(const IPAConfigInfo &configInfo) override;\n \n \tint start() override;\n@@ -89,7 +90,8 @@ int IPASoftSimple::init(const IPASettings &settings,\n \t\t\tconst SharedFD &fdStats,\n \t\t\tconst SharedFD &fdParams,\n \t\t\tconst ControlInfoMap &sensorInfoMap,\n-\t\t\tControlInfoMap *ipaControls)\n+\t\t\tControlInfoMap *ipaControls,\n+\t\t\tbool *ccmEnabled)\n {\n \tcamHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n \tif (!camHelper_) {\n@@ -125,6 +127,8 @@ int IPASoftSimple::init(const IPASettings &settings,\n \tif (ret)\n \t\treturn ret;\n \n+\t*ccmEnabled = context_.ccmEnabled;\n+\n \tparams_ = nullptr;\n \tstats_ = nullptr;\n \ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex f0b83261..34e42201 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()\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..0cd03a8f 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,11 +368,17 @@ 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-\n-int DebayerCpu::setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputFormat)\n+#define SET_DEBAYER_METHODS(method0, method1)                                                                        \\\n+\tdebayer0_ = addAlphaByte                                                                                     \\\n+\t\t\t    ? (ccmEnabled ? &DebayerCpu::method0<true, true> : &DebayerCpu::method0<true, false>)    \\\n+\t\t\t    : (ccmEnabled ? &DebayerCpu::method0<false, true> : &DebayerCpu::method0<false, false>); \\\n+\tdebayer1_ = addAlphaByte                                                                                     \\\n+\t\t\t    ? (ccmEnabled ? &DebayerCpu::method1<true, true> : &DebayerCpu::method1<true, false>)    \\\n+\t\t\t    : (ccmEnabled ? &DebayerCpu::method1<false, true> : &DebayerCpu::method1<false, false>);\n+\n+int DebayerCpu::setDebayerFunctions(PixelFormat inputFormat,\n+\t\t\t\t    PixelFormat outputFormat,\n+\t\t\t\t    bool ccmEnabled)\n {\n \tBayerFormat bayerFormat =\n \t\tBayerFormat::fromPixelFormat(inputFormat);\n@@ -464,7 +470,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 +510,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 = setDebayerFunctions(inputCfg.pixelFormat,\n+\t\t\t\t      outputCfg.pixelFormat,\n+\t\t\t\t      ccmEnabled);\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..21c08a2d 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: LGPL-2.1-or-later */\n /*\n  * Copyright (C) 2023, Linaro Ltd\n- * Copyright (C) 2023, Red Hat Inc.\n+ * Copyright (C) 2023-2025 Red Hat Inc.\n  *\n  * Authors:\n  * Hans de Goede <hdegoede@redhat.com>\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,7 +126,9 @@ private:\n \tint getInputConfig(PixelFormat inputFormat, DebayerInputConfig &config);\n \tint getOutputConfig(PixelFormat outputFormat, DebayerOutputConfig &config);\n \tint setupStandardBayerOrder(BayerFormat::Order order);\n-\tint setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputFormat);\n+\tint setDebayerFunctions(PixelFormat inputFormat,\n+\t\t\t\tPixelFormat outputFormat,\n+\t\t\t\tbool ccmEnabled);\n \tvoid setupInputMemcpy(const uint8_t *linePointers[]);\n \tvoid shiftLinePointers(const uint8_t *linePointers[], const uint8_t *src);\n \tvoid memcpyNextLine(const uint8_t *linePointers[]);\ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 44baf200..b03c4baa 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -128,7 +128,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \t\t\t     debayer_->getStatsFD(),\n \t\t\t     sharedParams_.fd(),\n \t\t\t     sensor->controls(),\n-\t\t\t     ipaControls);\n+\t\t\t     ipaControls,\n+\t\t\t     &ccmEnabled_);\n \tif (ret) {\n \t\tLOG(SoftwareIsp, Error) << \"IPA init failed\";\n \t\tdebayer_.reset();\n@@ -240,7 +241,7 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,\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":["v7","09/10"]}