From patchwork Wed Dec 10 00:53:48 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: 25437 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 B3BC9C326B for ; Wed, 10 Dec 2025 00:55:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 559C061487; Wed, 10 Dec 2025 01:55:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qCxC/SG4"; dkim-atps=neutral Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BBBCC61487 for ; Wed, 10 Dec 2025 01:55:05 +0100 (CET) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7b852bb31d9so7562502b3a.0 for ; Tue, 09 Dec 2025 16:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765328104; x=1765932904; 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=8xTO1tBEr5dmwj5C2btCnNs2WBrUsqlzweC7y2YC3O8=; b=qCxC/SG48rEHawUIfzgkkdEQKAV7gNDul33Dr7MtgHDIMbTrwvvKUDXF7SWYoxVuvH YE77MXysh9QX++LOA4y/OZ9p6ASRUPtjEdiNjI0ff9LPIHqq2FiylcU58z61KHI+oY6M 7pOyBMkEVN1k6hKtdJZWnj1r4gRYAwoxh4GXx1bESof8yLfjvES86kfVEX+5aUgcyvfm zpgKxlSGOG9IoYGmyiw75f2GU0mbRIIOQcfegTMMF0Z7j59VbU9V/6jVg9Rjr5VcDRub rt5PZfjJXiRtymcvjVABUR0YPq6GJM5y2y2Rh5fow6sGIXS7abzJId+MQXQKjGZstmug 7tSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765328104; x=1765932904; 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=8xTO1tBEr5dmwj5C2btCnNs2WBrUsqlzweC7y2YC3O8=; b=iBnB9HHw8/LhIb2vnde76mFcB5QGqfSjF9Rq0/drd2M/Wnah1mH7D1AdbzM0hTIohl wIPkChTFyIQATIJotu5hQC+efr/TJKWC+0Oi/Jj5ZctX8pzTpy4EA+9JRSGHrFCTKqd7 VCiosLLtzLtoRkzzYwj5sbJwgKSLYxbidrN/PENuPHWhQ7lLsp8vXAmk7JjNWd2W5itj zGJOfyp28zHqVT69PNVBoWZGmcoT38dppZrXxWgGq7TEWf21FFh4JN18yK3gtsODa7Rn Efd9y3K6tynvoLLQHTWJHrU4ynXbfNgOhGlzTgxJWxI/FZWR1E5k/YxJqC780KC5FQm7 /AVw== X-Gm-Message-State: AOJu0YxTLILqJCdpZyT9c54XBWmklinEKJpXcaVKhQVnbqJZsckpmu9d tryFxusqLHW1PPpBHrqpnRkOpMKEpHj7PEcB+80L4vON84TSn4OkQ2kPzh7vIPIByakqAU65Qy/ z+m9g X-Gm-Gg: ASbGncs7RmpcyI0XMeKWCKseUJnuH1/PvCSqdcJlYBRWBmhtGcn9+r6J6lek+4PBM5S A29C1kDaRXD1iCm+08x4p0s2QRAOznlJpS7IG4buT56zbyA7TtPNlvWGBXStYa0E+dlw7yVPwyI qwHjiIDx+kEvWyLLipC1Px2T/u60PAHpcmiHIunBapFguYhJcUDURFimcMDzjNqI6tO/XGUNA+z +hd+KU52NGFIUYAuAWYRld4IEK0SHQkyHIan6D/Gn1s8rMjXMeh6dsHR49ohwjxHNMHwiDUWd0W jDrar3kSHIXB+l1zMPlGUFQukt4KpEoH4Tn3h270PZUiJ7doMM7sMQMVYiHS22uKOSZBQo/edCq 5tXcHmpX1DIsX3zFsxBXe0LEgML31p8B3CA+65YIi0vZg+1Ta14mn3XWUbrd+3Bs5ElUpsAXLxE 5D3epBdQF6PAtL5KZYrhqN+uSvs12oKsbnA2GvAQWSifhJPLl8KV9pd7y0lBKdfZlB X-Google-Smtp-Source: AGHT+IHouw2Sw4C4g25ZKxNbEmHl1Mm3g+AihAkhsbn/UvdN3AT0L170iMyorpKcK0p9uD4VBgckmg== X-Received: by 2002:a05:6a20:7f91:b0:35f:aa1b:bc09 with SMTP id adf61e73a8af0-366e09e2d9dmr539083637.17.1765328104052; Tue, 09 Dec 2025 16:55:04 -0800 (PST) Received: from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp. [150.147.107.6]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-bf6875cc8eesm16057762a12.16.2025.12.09.16.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 16:55:03 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v7 20/26] libcamera: software_isp: ccm: Implement a static init() routine Date: Wed, 10 Dec 2025 00:53:48 +0000 Message-ID: <20251210005354.44726-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251210005354.44726-1-bryan.odonoghue@linaro.org> References: <20251210005354.44726-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" This is an overloaded init() routine that allows the CCM class to self enumerate a default identity CCM at colour temperature 6500k. This is required for the case where we are running GPUISP but don't have a CCM for the sensor. In this case we want to generate a default CCM and use it instead of using the CPUISP's lookup tables. Signed-off-by: Bryan O'Donoghue --- src/ipa/simple/algorithms/ccm.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp index 0a98406c1..38c18806e 100644 --- a/src/ipa/simple/algorithms/ccm.cpp +++ b/src/ipa/simple/algorithms/ccm.cpp @@ -27,13 +27,26 @@ 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 */ + float identity[] = { 1, 0, 0, + 0, 1, 0, + 0, 0, 1 }; + Matrix identityMatrix(identity); + + std::map> ccmData; + ccmData[6500] = identityMatrix; + + ccm_ = Interpolator>(std::move(ccmData)); } context.ccmEnabled = true;