Show a patch.

GET /api/1.1/patches/23044/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 23044,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/23044/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23044/",
    "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": "<20250326090849.15494-10-mzamazal@redhat.com>",
    "date": "2025-03-26T09:08:46",
    "name": "[v8,09/10] libcamera: software_isp: Track whether CCM is enabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "70384d0287b39d5e04c2983b139c094aa2a3ffb7",
    "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/23044/mbox/",
    "series": [
        {
            "id": 5083,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5083/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5083",
            "date": "2025-03-26T09:08:37",
            "name": "Software ISP support for CCM",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/5083/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23044/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23044/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 1EEC8C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Mar 2025 09:09:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C037568975;\n\tWed, 26 Mar 2025 10:09:28 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F5766896C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Mar 2025 10:09:27 +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-630-CY6TvRExP7qqRF1GEyBblg-1;\n\tWed, 26 Mar 2025 05:09:23 -0400",
            "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.111])\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 B3E4E18004A9; Wed, 26 Mar 2025 09:09:22 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.15])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 8703C180094A; Wed, 26 Mar 2025 09:09:20 +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=\"goumINrD\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1742980166;\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=mx1lBRUYvxUAYi6LQJDN2q0w8AbNZHO/7/H+5wtp+c0=;\n\tb=goumINrDXWxBksQtsKBoJhJzuK0sEJfyoo6MN2BwRMe6QHRc06jARGTjku/ljMPsA68QLT\n\tA/ousThrivxmWea0Ywa8A6sWZk1JMoGDYYDBN/AQWu8AKh++PYolzllhK5TIwDgQVAdLFK\n\t8hGs7tBI8QLc2d7zR3lzXclc2ychdwQ=",
        "X-MC-Unique": "CY6TvRExP7qqRF1GEyBblg-1",
        "X-Mimecast-MFC-AGG-ID": "CY6TvRExP7qqRF1GEyBblg_1742980162",
        "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 v8 09/10] libcamera: software_isp: Track whether CCM is\n\tenabled",
        "Date": "Wed, 26 Mar 2025 10:08:46 +0100",
        "Message-ID": "<20250326090849.15494-10-mzamazal@redhat.com>",
        "In-Reply-To": "<20250326090849.15494-1-mzamazal@redhat.com>",
        "References": "<20250326090849.15494-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "8bPlBFqH2l3xL8pt5oQo9-ApPijbvIZ8XQ64ShikE0w_1742980162",
        "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>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.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 133b545c..0026cec2 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -99,6 +99,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 \tstd::deque<FrameBuffer *> queuedInputBuffers_;\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 67183b3e..17bcd4ca 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 a64e6b2c..4a74dcb6 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -132,7 +132,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@@ -244,7 +245,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": [
        "v8",
        "09/10"
    ]
}