From patchwork Fri Dec 12 00:29:31 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: 25535 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 6C10DBD1F1 for ; Fri, 12 Dec 2025 00:34:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1A6B561918; Fri, 12 Dec 2025 01:34:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DDIGjP5g"; dkim-atps=neutral Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A87B61919 for ; Fri, 12 Dec 2025 01:34:26 +0100 (CET) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-349bb6f9c86so906052a91.0 for ; Thu, 11 Dec 2025 16:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765499665; x=1766104465; 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=VNUHfHpg2M2YuqSAMwLvCr/seKArsWE4nrFMPIDyMeI=; b=DDIGjP5g8vXnNnIboMRfaez2sa9Cc2WiFylh1L0Mn4XXWQhWQ5idRk646XvXPNPqzP V3TScyOsdz2zln8PCeXuk3lAKdXTXPDdyNP7U4mzbT7BeVjtckQ9+E5xy9kZD75zTRXY K5z1GhhRgMNcTG5xINnT709pa10pGWazkux7MJQIEJhV2zW6x8GUpkvhUB6YUN6M9z3z j0cmK7zs+apmOAG+zydtLq36MtwnR7pZuNT8bxC3Zqect4ZfX1bDMiGx/V/ciMXPBKgj PK6VB2fjPVioaoPtSROOH1MmrLP/I8uLej+Wx89jZDPT0mzQO0XUQRnQtANjmBfea/E8 CBsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765499665; x=1766104465; 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=VNUHfHpg2M2YuqSAMwLvCr/seKArsWE4nrFMPIDyMeI=; b=N/hD6CMZKVcsr2/1ViYsYPRJ5eDGvd+x+NyUhQiM82MeQbIexiLb2K/9AH4/mS75pY wvjU70sKsvboLMAtkHLUEhPZOQOz3tnRrXOb+VNGads/5nhsHNiWv+26gYb60tvmqVkv 5tjTNAWyaScKKUZz7Rnged8VP/K53yCF8PoGRDtRhKwrvpdyzALdaW03nrnNdIghW9bg FpsMfnHJ0pND8ObRGykz/Ca3zloXccMTXxpMCxnPoMMxDTZQtl1uFX44m3jUi2YKR2dw lFJ4/mTUI66wKOKrLTGxEI50LeRHy4Ku1vo0BrSf8u4f0el+RqjM2RBXV/YFvBOZ8VrK KZyw== X-Gm-Message-State: AOJu0YwV48rj3FCKlM/A+G7kBrBPdY/uox+IHdn9/tpSjJJ7b3o/YIeq 2xBmzTx/VAzxG131smAlSONMMy9fXs2UYH0XCyr+jrwHSZnToNPfgpExL+rdQizgPbPnqeSodFD b9LGu X-Gm-Gg: AY/fxX6ESlWtTwe+Wo357UvvOn+09RnECSD1izMatU6Ch2jsTDxvoI4eWdsoMFi5jVi NdXJGaKJi7NWObciiT/ELXVNRSeUm/h4PmCgvjbPRewtptV+4ERC92qUJ5cVYp5UspLkOpPeMYf 7o26MYUzQynLNLmInUgexejBZZg7/K9ewmhzCozqL7RBKgpTFyEFCG4CnWTw3ZNyfHFY1jQYmFr 171W+3bJzjHMRo2W3zpqa5mX0o7FsC0rPMY2CYu9X2/Uo/d1ogS/tD4dzUZ+Ix5wKQh2gejIpX2 vCNlzEwJb4FVq77DysKb3Pllb5GdLphF9axxaWzQ4UfN4y+Vxw2QnQ+5u3TWzO+FkVPnijmKPM3 3/RF8QK3P8vTv5AsGoBgpLgfQcS18CL3IGNthm+MNeH8bozRLY067m/tDDbHYzcEyXjAm03CTFV UvW4YCCbIjCjnilgWH5l9lvhgGtj3YI8pRkQPbFblOWUHwSC3nLjAxNzrrynw= X-Google-Smtp-Source: AGHT+IEDcm3QWbbIds8HOaa4svhq96gjtcENALL1wW0LShvBqpU9crGiMP+ZpRZRMBRCo3anVrAERQ== X-Received: by 2002:a05:6a21:6da7:b0:34e:7bef:e820 with SMTP id adf61e73a8af0-369af90821dmr281696637.41.1765499664583; Thu, 11 Dec 2025 16:34:24 -0800 (PST) Received: from inspiron14p-linux (p99250-ipoefx.ipoe.ocn.ne.jp. [153.246.134.249]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c0c26eb0f6bsm3317282a12.14.2025.12.11.16.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 16:34:24 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v8 20/26] libcamera: software_isp: ccm: Add self-initialising identity CCM to Ccm::init Date: Fri, 12 Dec 2025 00:29:31 +0000 Message-ID: <20251212002937.3118-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251212002937.3118-1-bryan.odonoghue@linaro.org> References: <20251212002937.3118-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. 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;