From patchwork Tue Dec 2 13:45:37 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: 25326 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 56419C32F6 for ; Tue, 2 Dec 2025 13:46:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2ADAA60F3A; Tue, 2 Dec 2025 14:46:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="i6K9mtxT"; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B443160E3E for ; Tue, 2 Dec 2025 14:46:17 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-477b198f4bcso40709035e9.3 for ; Tue, 02 Dec 2025 05:46:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764683177; x=1765287977; 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=Cd4Lu/rRh8VWoA0Rmsx0kqTDJoCB3bfU/VXyPDYvPPU=; b=i6K9mtxTyiewTnoSFnfb2tF2i3y8H2nRhIFf67Wtw4eiAUvfg7pXOiHgmoY9JSghBC XM0onFF6jG3ThltSwZP2Rb8jYpN8CmmovshfJ/2ojezOHtii4voA8T8MCxEiv8OJthEW CzVpDHRSHwTIp4eeNsRIO/lTg2pCiEYuBfOE33Uu2sQIzzunC6y9bWsvZVZ7pM6Hxax8 JvdQtg41GF8V9Do67FP8tckNFcGmhCRlJd7lHWfHA+7BJa9Eap/VgSk1ENk/68MI/45h QK6EMxh+SWQuKPhBnTD2iMaUpokWkZ4Emk4x1CUt/E5766kDjR8E9d0cihUiJXTT5H0m V/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764683177; x=1765287977; 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=Cd4Lu/rRh8VWoA0Rmsx0kqTDJoCB3bfU/VXyPDYvPPU=; b=tFhRLwXiQM5gsgr89vDAxaTb79umS3WugdBU1QxlLsYfmL2lemGzyM6olEJCMHBzc7 /DlmEPKYT8feDNUwx8GndesLl0PSrnUBVY6Nh7hSmXEZ4ewGFWqPxSpPaUWCVwKip2xT XKXCyK310VEKnctBp2Q+BKIu3OWG2meCN4tvcgG3+AlE9BGQ/+GAE7RqxIUb83uGq+xJ r67uzsar4UnBikHnHKRdCo6qfN28F99vqC/w/pkn23c4t9Zm2qQMcnuL9fZRW5EHo/1J Jxw6J9zVUs/GiEvExtfX4ySwfQCpN/x6CIBXuU7OWuMXQoNHrf6WUNOm/urLpwcwD23D qLyQ== X-Gm-Message-State: AOJu0YxzOfcNj04+80lo1HPopn84Sr9wye8wnk5q4tvA28j7mtW4tkZI xPRv859nr9VhWPkwo6d8n5LI+TTkrWnlJM9sBKUmUI+DcQE7sfFuiJJNd3izoYGtGvAiD5Tz3kG KWbtF X-Gm-Gg: ASbGncu/C1+vmIKjW+6EvFYZt61BjgdoIpL7LaG6fq2zk7qHe17Gtd0hW6SE32+sC1k Q9Av8BmbGWeS4149b4eaSo8XNpJQm9S8jy6o2NhMvYAXnZdt1YhxS9Vr5PDVuk5NLZztwozRxZf MhLQ7JfjfqFw8v/prE0F9JE9eHwgYpbJN/yLNSa/pLh0mlSK6xipIC0g+60mVvVNMrgFWfckpJq JyzPFMHvFjopnmtkm9ixr5JyEPVDsPdWVhgy4BNP6aBz/IFpKVeDQ8O/1W3AsO6k3RxDVpxqgu6 cm1Nu4IoIb0TFYBKSH/KaUTFN3Iiw5M0jTFJzaY+Y3jOF2lQlO5m/PtJkyy+AFd7N/dMWSPazfV NQvwenq2+fGkZExGqWcTnOgIjwXBkNPBp5yXy8OKhVmndluwSI5sAPxJir1DLAnHov6abnztwp4 biuwSjNBtslZV8JiBEmm/AdTBmyda1dMmpW8FtljWpryRNqgcydmWqPyfuZNYSBJZa4qM= X-Google-Smtp-Source: AGHT+IFbTH/idGfHRNb1xaMvM0Pjd32yq6G5UtU19LwiV0W/63ilRELll6aD4JFxt0V01+BVBF+86Q== X-Received: by 2002:a05:600c:4e8e:b0:477:9f34:17b8 with SMTP id 5b1f17b1804b1-477c0165bf3mr408139665e9.1.1764683177017; Tue, 02 Dec 2025 05:46:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:46:16 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v6 17/24] ipa: Add a new Algorithm::init() to support self-initalising algorithms Date: Tue, 2 Dec 2025 13:45:37 +0000 Message-ID: <20251202134544.662446-18-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" Add in an algorithm init() routine which can be called in the absence of a Yaml input. Do this to allow an algorithm to set up a default set of parameters. Signed-off-by: Bryan O'Donoghue --- src/ipa/libipa/algorithm.cpp | 13 ++++++++++++- src/ipa/libipa/algorithm.h | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index 201efdfdb..da44c77ca 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -38,7 +38,7 @@ namespace ipa { */ /** - * \fn Algorithm::init() + * \fn Algorithm::init(typename Module::Context &context, const YamlObject &tuningData) * \brief Initialize the Algorithm with tuning data * \param[in] context The shared IPA context * \param[in] tuningData The tuning data for the algorithm @@ -50,6 +50,17 @@ namespace ipa { * \return 0 if successful, an error code otherwise */ +/** + * \fn Algorithm::init(typename Module::Context &context) + * \brief Initialize the algorithm with default parameters + * + * This method is called when no tuning data is available. The algorithm + * should initialize with sensible default values. + * + * \param context The IPA context containing algorithm state + * \return 0 on success, negative error code on failure + */ + /** * \fn Algorithm::configure() * \brief Configure the Algorithm given an IPAConfigInfo diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index 9a19dbd61..9fcbe23a9 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -32,6 +32,11 @@ public: return 0; } + virtual int init([[maybe_unused]] typename Module::Context &context) + { + return 0; + } + virtual int configure([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const typename Module::Config &configInfo) {