From patchwork Wed Dec 17 10:01:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25593 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 19464C32AF for ; Wed, 17 Dec 2025 10:02:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B6B7561F5E; Wed, 17 Dec 2025 11:02:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XKAtvUre"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A109B61F0A for ; Wed, 17 Dec 2025 11:02:07 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-477563e28a3so2283845e9.1 for ; Wed, 17 Dec 2025 02:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765965727; x=1766570527; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zyb9LZ6PT/7D8hWeLG03useXOhMS8JpWGPj51LZZTbo=; b=XKAtvUre/ReoZY6GlKI6BcVXGYQ7aJukiLLF1+z/LPJiLdoEHjckC5Ww+O1rSlo0qW nvSpLtcRhA/tU/a4+f+L4P3Qpl4Q8UXppC9ggGFQ9BM+tdp4esTFI0DxwwBptvsG5TfE aFfwT9YuLwTbxlj9ZpMn7U3KiNVUjF7kiZ52OLwG1wsvZ62mWLgitMKkicgsODepz794 KHElSNY34BfuuctQ8OvKa6nJAH8M+3i040WjDld4ms2/w8tWcY6zYG01IJRUT9i+ORwL bocj/PC6D1o6MvZsLYRNFiqSeYqIsH+aAVtkHNdrI7Y1VqT5Gqy5ls+yM0JJHf28lEUt VK4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765965727; x=1766570527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zyb9LZ6PT/7D8hWeLG03useXOhMS8JpWGPj51LZZTbo=; b=fwlOl0ijehAYM66FVtb35kcAl+oVddECJ43IobKHVB6mNlh7gZ/uILNi0BBsVzlwPE PmkVsq3azC+cOMb/TgclxAI3ClVCKu1aqXo0eOOTgHTi5/2qvAwwUfSHhg5FvqZxKWFF vCG86pggY/by2S4DSrA+bJIO89LoRtFkxcV/ZbW69jGdVCc+ikOKIywWzqgB8nb18irl xxqQEtmgZMBWct4wSxiJFyp+cEDOvbvFsnRKg3T2Oj7GIjjZCsy2wlNAgF30TksHzFLS jDAKHKfLSf0KqesqxvClzyubTFFCHs4JDnAsq6q2es8x2P1NqbHHZcbykq3Vz+7bxJUh FT2Q== X-Gm-Message-State: AOJu0Yx9kMWXFUqtc/XTRROsddznILUe/RIAS0M9opa+unxDMBpJGBVT eXyD5uunpOBcwcDhu9UfPc0Dgc416cyp7YOjoPJ5QohdxjjB62BQTEYRDAxzFQCN7sXGjmbYvnT 0l+XX X-Gm-Gg: AY/fxX7qbVcJ3vU7Cbn8/GwCza46v8yLcLvnQT/VKYW/GlJBXVy2TdTC0spRU8KG3ob WLee8EYj/2D75JLyLuxCzkk5p5iARw1MaYSYlTI8DZAVQETj2To377NMGg13ZCmYncP3pievU+q BpgSSLWtashmIrkTTNzjV5WTgUuAOpM/Qeq2M8Cz7hG+00D8gd8oiLhsmlm0rnafONoypf4kT5P 7iSoTG1ZtJdyo/fk51SOleuv4NtBFn241XohNcIVPDVnL4PJk69K7nHP/QDdz7TERQdAjqQVc8a DSZtZEhdha36G8KnLEUhRAWul8iDCSHOVqPkLtB/4bR1G8KDDh+OKKYImHxy5yA7tp/ZVmfgIu9 PD65S04c+sxG31lV3pQ86v4BUYHm3WoOL5nRB8ZLZrFHFUnIdyL8DjebSatU9vL7P8i1hbj2Rx3 9zFd3fzGwzLwdp2ypUCvn5qLoON/4hrEDPurHh30v3UFxEdkse3U0AUmYMwLsjz3jH768= X-Google-Smtp-Source: AGHT+IF+MhhEdhAhHf6Z9gSyPKht0rm207sOPO9friyguSF2zjMMEN5CzXajgWwS5x4eRnR47aYmUQ== X-Received: by 2002:a05:600c:6290:b0:46e:2815:8568 with SMTP id 5b1f17b1804b1-47a8f1c1e65mr199453995e9.10.1765965726650; Wed, 17 Dec 2025 02:02:06 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bdc1583fbsm32292585e9.0.2025.12.17.02.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 02:02:06 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal Subject: [PATCH v9 20/26] libcamera: software_isp: ccm: Add self-initialising identity CCM to Ccm::init Date: Wed, 17 Dec 2025 10:01:32 +0000 Message-ID: <20251217100138.82525-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251217100138.82525-1-bryan.odonoghue@linaro.org> References: <20251217100138.82525-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" We have a need to generate an identity CCM when running the GPUIsp without a sensor tuning file. A preivous patch added a selfInitialising bool to the IPAContext structure. When that bool is true generate an identity CCM at colour temperature 6500k. Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- src/ipa/simple/algorithms/ccm.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp index 0a98406c1..ac1ce1685 100644 --- a/src/ipa/simple/algorithms/ccm.cpp +++ b/src/ipa/simple/algorithms/ccm.cpp @@ -27,13 +27,23 @@ namespace ipa::soft::algorithms { LOG_DEFINE_CATEGORY(IPASoftCcm) -int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData) +int Ccm::init([[maybe_unused]] IPAContext &context, [[maybe_unused]] const YamlObject &tuningData) { - int ret = ccm_.readYaml(tuningData["ccms"], "ct", "ccm"); - if (ret < 0) { - LOG(IPASoftCcm, Error) - << "Failed to parse 'ccm' parameter from tuning file."; - return ret; + if (!context.selfInitialising) { + int ret = ccm_.readYaml(tuningData["ccms"], "ct", "ccm"); + if (ret < 0) { + LOG(IPASoftCcm, Error) + << "Failed to parse 'ccm' parameter from tuning file."; + return ret; + } + } else { + /* Initialize with identity CCM at standard D65 color temperature */ + Matrix identityMatrix = Matrix::identity(); + + std::map> ccmData; + ccmData[6500] = identityMatrix; + + ccm_ = Interpolator>(std::move(ccmData)); } context.ccmEnabled = true;