From patchwork Thu Nov 27 02:37:35 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: 25257 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 7E526C0F2A for ; Thu, 27 Nov 2025 02:38:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3813560AC8; Thu, 27 Nov 2025 03:38:31 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="E67RJRJj"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4212860C68 for ; Thu, 27 Nov 2025 03:38:26 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4775895d69cso1144955e9.0 for ; Wed, 26 Nov 2025 18:38:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764211105; x=1764815905; 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=E67RJRJj7Q/nEpQohbeByB0My/BX2QmeUGLEUSDFscus09NFeJxOHUJ++TIPnJhbEf yN8HX7Eo0t+ZwPrGGF7A1OFsbn8rTLpiq5ilTsXzcYAGZBSCQPAgZSRbcKlfzdXib12R qYOc07IoeQYZgIDJmD7PemCHjQMOnjyyMXr9Yzib7dN2QSkXZ7QYgBtNiONH7VJ9NvV+ 3VbbyCqdTb9hHN08YquF1hS0iBMKnOKsyscm9vMQIsnV/91Ll33A+S34w2v/ws7BTFnB vPLQJovd3t5SlQOzs/FHV8LOTuODtuGzzd9SWpvRuXddBN8q8fQMyGplgzGv21BH2uUc yOew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764211105; x=1764815905; 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=mTs+/hd3VBM9Jo/uF4yYstOTx8yHCpV20/QXTptVh9eh4BKqWjAb6jUd1QG/pKBYEq HGDT4368KKLsnpEYe0wcxe4+r2LMEL2+K/4KZsfpWikJ6q8tz+Kqx8w/5poskuJmBIjE C9d+K7EwAnLJNW8JmmqdOPh0ozjbHfAfItwRRvI3QJTN/isNDnfkDWmAydoyzpTcZZ8Q EEKi1FraGAAqh7Dp/vPI2Dl4jpR0D0Yxum4f9BKJcl2ShP8gwxizQ4JKebN2WAmzL5yT xPEMxnP9dcZL5RcLYNwMo7ZxaozmZviCCQL71//NV+nS9+OyJp322a+uTsuhYOCrFbs1 i47g== X-Gm-Message-State: AOJu0YwrrxXOTc4zORQNK1l7CqVctPBh6KNvk4eVBaTXC8XCNrRh65Qz V8UjkzoMmpjmI1EmglbG4lHs9Vt2z7Oy7fu8yz/XLR/Gqyab+oJxVuu+PK1CT0zO93G8UiCfdD1 g8B+oqrE= X-Gm-Gg: ASbGnctIZK59NXXZrY+/tZT8ugveYe/8DjNLupV28fGv4j1HEIr5iCGNnBOb5axtMBQ YYPYhZBXLZTvxtfrlaHOoOlNqejW6H3uKb0UJuKYJyOZGLYeNEI2/8GdiSDlQbWU04/4Jbc+8c2 gpYCTeOpEOJmvPyK43eCukl3hsEZOIKMq2f9C+XKYPmedPII6jOrjtUcZswVQnWYJEyvmvMY7qr Gdb4I1+eqvUZ9eRZQiCLHkrhEM9dCppYXL4ZlZDg4Ob7th/7ALyOaQp/8hgy4RJxoGRaNYIHSWJ mf619M522GvFJxneoeIahe0WGSrQv37gR87MHhqSKLeZO3SAksOwXyKoRYTDnXFY/7sa2LOBy9C w77QK81PZLJO4IRl3BK0Gl3/YO4n8QWzwFi+xunRXGMpnEHSjWNL9hBdFXURlFci9wSqSoKQsJx t1m+TGHhjPkOrrEMaolDwuCpGVBFYna/VW7Yhyiq/NSENG9bV70C1TUqHSrSa8dm1X6Wk= X-Google-Smtp-Source: AGHT+IFvWfWYkN+rc0xLbjG+TdVbs+pnGLNubdJos3xPRMeIlU6MlnjEfdWYaEu5n3FuiLeTr2On8Q== X-Received: by 2002:a05:600c:6287:b0:477:7925:f7fb with SMTP id 5b1f17b1804b1-47904ad0724mr75489355e9.10.1764211105619; Wed, 26 Nov 2025 18:38:25 -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-4790552c3c9sm58186345e9.0.2025.11.26.18.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 18:38:25 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v5 20/24] libcamera: software_isp: Implement a static init() routine Date: Thu, 27 Nov 2025 02:37:35 +0000 Message-ID: <20251127023739.179652-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251127023739.179652-1-bryan.odonoghue@linaro.org> References: <20251127023739.179652-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,