From patchwork Thu Nov 20 23:33:43 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: 25143 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 7781AC3333 for ; Thu, 20 Nov 2025 23:34:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E3E0760B13; Fri, 21 Nov 2025 00:34:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="k8qw85dL"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C734260B2F for ; Fri, 21 Nov 2025 00:34:27 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-477632b0621so10049225e9.2 for ; Thu, 20 Nov 2025 15:34:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763681667; x=1764286467; 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=XGZEOlg3N1WKIZQYXL2EvkWqNCC95nhRh04jkinhjFs=; b=k8qw85dLpTQOP9pqInRJxtJ/hxqlnnwZ0EZy6J1heSxXCsAGDFqqci0Yjm66B/h2h8 lawwP09gXj5DlnZOwTR6+MH3vmq0SZSNo+ETJOJq5ONSyblKPA3LD81QMBIgav/1qpvs cTGGWuDqGfM4ULbuZjyAKMTGrXSRZwQH1DY0X+GrPvUqgpeyLVj864Nol18aOQn7I7jd 2ioQjXkwzg7s7uAIociiV8LUxN8JkNQ0pC1Fl3ouaz29x+Vg7p6D6JmYeAkfGC4iV38G aBJth73J5fTXfL9y8FmjpHyypfsqSpyPvAHFlRzFo4K4esQWc4NzVOAsfHhIRVF9tCsM dDyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763681667; x=1764286467; 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=XGZEOlg3N1WKIZQYXL2EvkWqNCC95nhRh04jkinhjFs=; b=er7dvRhPdFvTUfrIqFI5BibtQfo+U48CSseu89mTrsY/99gHSI5Ry/fLY9omNx3Dhd I3aNOfi1kLUFbcGkEh++ay3FPpO1Fm6MNWvMtokBvHKSqMudt5tOSmCxVfSe0FyZAhUi xU6GF1JMzv2rwoAFFIdRpJkVQUi8Y67x0pA+axzyRg17osAdz3FN1vtIhjXoFGos4Xf7 Y4ZXJHKpD/iTmi9pyoJRrY4qMurkWkAQ/w5yp825zeS6vxYeVg6XuyFsS1RK/7+jVvyY JfU9sZGVgT7a1/Sd8D00MosUfuXVYl2Hv3qfboGB6rIijNrMBkHSemGMsr6sYCgbkP4M Nh0Q== X-Gm-Message-State: AOJu0Yx8m9kQPT0FWY8eTL1Tip7zGryQs60KGvQ18BP08KuiTxuvsf44 EidoQJxpK4E2Jio2dYicp8qmuK6OyF666VKdJ5M4GzCOFiyTiArdI9CPO8XOQ3BX6WSOoe8Nnqq 30HL5SjA= X-Gm-Gg: ASbGncsNZ3is9ObCPdO0PSMOcjlYKIs9UMldfijNSnKBwN5yV9wa1klFibIU/T0UrXx +9Axn0CSj9sfKZcb1GHbx2K1iLWYNSDdKZKEA0mPQeiPOixIkU/XxsbJx+/vUwQRYYKqOayZin9 xBzVSGcg7QTsxccVPwnJHyYjJANlPxW6Ml+rLINEp40uPUZe091cnTBuOwp3McymqxpHx2rsTMy BsrD3sd3j0Ot+YQzbTRT1JamYeSqLYGRjadhqkcyDjnPCIvG0v0AHvC8YI8b/wpoDO0ycwlhO12 ARF4nIVWrByCW1MhnZg58gnu31kwS8HaOW4jq7VLoyeVPCv8ckcFmRKwhwDdflA8KaEgSrlb4V4 Y1fPOJQPylaad6EGT7JjBMwYpo4g3cgfJzMehzVTU/MfvhZhJ1Eq4avs9LxLAgGXo4zuI2zl9iZ ADJgsnaz/2/rHey5d8m6mzqS2UxUnHsabIn/xUXpZqhJSNugTmRwVKLerde1mnNkzu5S8= X-Google-Smtp-Source: AGHT+IEyxYWhBLs+mYoK5yV1RRcDhGwLGb6tSsX/59VJERBwFX/Za5QOr+PG0pS3FGmfG9HLY/jPIw== X-Received: by 2002:a05:6000:1889:b0:42b:3155:21da with SMTP id ffacd0b85a97d-42cc1cd8f1cmr100347f8f.2.1763681667116; Thu, 20 Nov 2025 15:34:27 -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 ffacd0b85a97d-42cb7fa3a81sm7984139f8f.26.2025.11.20.15.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 15:34:25 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v4 19/23] libcamera: software_isp: Implement a static init() routine Date: Thu, 20 Nov 2025 23:33:43 +0000 Message-ID: <20251120233347.5046-20-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251120233347.5046-1-bryan.odonoghue@linaro.org> References: <20251120233347.5046-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 | 18 ++++++++++++++++++ src/ipa/simple/algorithms/ccm.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/ipa/simple/algorithms/ccm.cpp b/src/ipa/simple/algorithms/ccm.cpp index 0a98406c1..e3da6adfc 100644 --- a/src/ipa/simple/algorithms/ccm.cpp +++ b/src/ipa/simple/algorithms/ccm.cpp @@ -42,6 +42,24 @@ int Ccm::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData return 0; } +int Ccm::init([[maybe_unused]] IPAContext &context) +{ + /* 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; + context.ctrlMap[&controls::Saturation] = ControlInfo(0.0f, 2.0f, 1.0f); + return 0; +} + int Ccm::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { diff --git a/src/ipa/simple/algorithms/ccm.h b/src/ipa/simple/algorithms/ccm.h index 8279a3d59..b46f17726 100644 --- a/src/ipa/simple/algorithms/ccm.h +++ b/src/ipa/simple/algorithms/ccm.h @@ -26,6 +26,7 @@ public: ~Ccm() = default; int init(IPAContext &context, const YamlObject &tuningData) override; + int init(IPAContext &context) override; int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void queueRequest(typename Module::Context &context,