From patchwork Tue Dec 2 13:45:38 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: 25327 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 3C512C32F7 for ; Tue, 2 Dec 2025 13:46:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7B18B60E3E; Tue, 2 Dec 2025 14:46:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="fWgfHMJq"; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B32060D36 for ; Tue, 2 Dec 2025 14:46:19 +0100 (CET) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-477632d9326so34862025e9.1 for ; Tue, 02 Dec 2025 05:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764683178; x=1765287978; 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=3Y8+tq/SF7PURWDF6ElcSls3YEXtlcYRYqDXKFddwTk=; b=fWgfHMJqLd/cjGh1oMV6lHMf30XX6sf3/8pGdve8Fcm89GNoKT5kxvNNcq0rIFGE7L 1sZRZIcQq4THsIRmi7AqKH8O+YXvHoLS2WY+3XetjL4b6VdMQUjML8M+9yfH6Bj+TjHQ 2peL7QuZg4rwJeJay73JSA7fCEbyruh/PbDn8/Gw50hnOlnEyCsII4+QMTdgR2yCx+Dp 7lkEUwV2wX9DfFvpeBdSFZbKfz7neUOfNuqmz6MrtX4ZxcgMstkGN+rKW6Wg9qSk+XEj ugF/FasCo85A8yaHjpi8FRG9pXI1pSMyTnSuCJvE9rMfhgtdu5s2YCoJeqHCgPQxwgLS 8jRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764683178; x=1765287978; 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=3Y8+tq/SF7PURWDF6ElcSls3YEXtlcYRYqDXKFddwTk=; b=B+Cx93vefMvP5mwIwctxdhqHtz4jyTQ8rUa7KS+ZNNaVbM7/aaIXY8bayC03odw01K 3kjdwasu61fOVF5L8SncXzhQF/8FvKoXfIHHbVYZozRqM5n7HPUjsL4GELLB59TD2pYq H/OVapn2H5iJz8AAPbM6wH0Twsa+0D0nxLuV5BzNg70LQnZttq8Kd2t6D7epb6zpILfw FAIpVJKa91l/ZPQUwYsPihxIIhWoddklyZQi8Cu+RxuZnfoiJfCooUx+WHAcFOLc53+i QROtyU4VmGp2VmRWrDutDsmnacPqKoS6ENpVaJLcG2ZxaWhtB/I1+ak5K0EVz86VDaMh IFbA== X-Gm-Message-State: AOJu0YxdVjN5f2pmBjJw7LiFAScurnrSRxUggBg3HBDWznFP722r6+4t JZk1vtJ7gYsY4tAZRZAxnLqE+8KFwnlS7xNSrT7ufOX0HCRAAZ+qu3dLr+d7l4GNhuwFSs4rjJ4 ewOwG X-Gm-Gg: ASbGnculAhhz03G+yYXP0paNNH59OLHe+S32SCdd4koZrFK2roNZyyYJHqXIMFjMMkJ 6ECWW/zZOGqadbFJiNzJe89M7eUaslWTH7ytD/d0xOXd84sYWBLh8bVrkXc+llETZtx6KeWbEij kNmmgHQRFU8vy8t3P7XvPp9Lb0sPjq/iIeMkvA9Q3gRQZXqMEjQNTNt/57UfCD0mspapnNN+461 Tf1+to+xuhcis+mwiIfrPBzfmJlu931+54iVFfBJ7Ypm/SP6IJiPAGKi/me3cnrwLB2gAqAKcbV /LWWKx9LIBz2ZD8Q61MqtUUfFSr2TNt1pm5h3srS09URHl0XomQCvn5a3UbH/K+SOTiFRZIZCeI AC7k55meCMOHoK2WJ6wncqUxmTu9zOqBXNQczViXh2XledPDtuKxji9HlCaAxThWxXYzGKh7k/5 QX6Q/XxegeM3cHHXSWQuLtePctCWJp1dSbyzBRFZdXnaQvmmn/YD65gaqgHvs2V9T426A= X-Google-Smtp-Source: AGHT+IFPbxEDnFr2zioZjIKcX05HlT24ToS7YjukqMaei4yZI1YRnl/8lQsxT1thfB30kbRRVxwzQg== X-Received: by 2002:a05:600c:45c9:b0:477:af07:dd1c with SMTP id 5b1f17b1804b1-477c0212123mr431591465e9.35.1764683178322; Tue, 02 Dec 2025 05:46:18 -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-47926f0ec69sm19383375e9.1.2025.12.02.05.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:46:17 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v6 18/24] libcamera: software_isp: Implement a static init() routine Date: Tue, 2 Dec 2025 13:45:38 +0000 Message-ID: <20251202134544.662446-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202134544.662446-1-bryan.odonoghue@linaro.org> References: <20251202134544.662446-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,