From patchwork Thu Nov 20 23:33:42 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: 25142 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 A9EB4BD80A for ; Thu, 20 Nov 2025 23:34:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5145860B30; 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="HYuTH9RO"; dkim-atps=neutral Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 19DF860AAB for ; Fri, 21 Nov 2025 00:34:26 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-47118259fd8so12449555e9.3 for ; Thu, 20 Nov 2025 15:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763681665; x=1764286465; 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=16pZ/JdoiYUGtAtk/R99scAohK2wEjdJ1P32w9Duc1Y=; b=HYuTH9ROZRxk52UhAZTMckRfGkePe72EfHEn1Shyc7Sa9fotaAZthzRv0KEFZkaZ3e ChECImeLI6Gnkq7FAhVuJt1AUcQI/D5qqcUXM6SW1yCFs7/BSNlyPrCStXXzWRqkMbvJ 2tqiA3yLAp+ykM26SHO+f4nU+SRNYbN9gsRK1+L3NTcar5bh2xrRIOaOW5F8ueyit42G jeK74xY11YvQl/hcyH9SSUY60Of3oYxbzQHwkwytngyrg/kldtkWWN2aYu5YMXCx017N 3Qq+RS1fKoLCJ9hW6ZXeTXLye6veNhO73eoFrngX+x4bN+MS7bcUAGV2fhOW8k0qixrY jHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763681665; x=1764286465; 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=16pZ/JdoiYUGtAtk/R99scAohK2wEjdJ1P32w9Duc1Y=; b=RvBCnWJ/KHLEZOpdiPft+Hzks80Z6+82KWV9EBWOnlJ3ZrNHHXl1RSUx0HmiiBn/dG AzLQdL8VceO0roO/f7mFU7qMdj9OXDDl5ANEaR/jLjBBBSkM4vxTu4puNQ58DOtWO8nV HtpMQFioKudYcTQKF7rxhxrKnKVnp3NV7wLXuSrsNlzg4OtjZb+p/lIDiZzS13iZauoD AxGgE6BYGW98g6ZsEdU0jxKdu9gmtTh8PVSufxO8t9+rl42ImkKfu4DwB/Ng92G0fz1m hPeQjPFB+O9X8wzW9RTM9FZt/QukG9XQCCsZ7I1kDOm9Yc3zbGTo7Y0Q3EaTDSUZe3TU wFSg== X-Gm-Message-State: AOJu0YzE3u/3HybtHYY3Xjtr0X9HhkuNkoHBS/sPod1wC+qs5q1MRnyK UsQeOGRAH85lkDZCWSjSjRDTllqldM68xJoNCYEtkNctIcB1fB/vNoGl38Nt/pZXlBZi6WQqQFy zLIHa3V4= X-Gm-Gg: ASbGnctuW7j5ww1k8s8NC8GedDiLDluy8Od2tjKcGrwgRa6EnBL5DZXwewQy3FUmrt7 GVBFoHMiQq/qf635x9M+Cwn9mpqWHU2LEtNEKrfNRQcXP9/uIFzYyhu1UOg+mnub24tbA26UuE2 nYLCZ5Z9m2BgEk+Vjl2chZ+LRCHjrs16fgNV7APpFNaZxunmtXm8Cwxu2KAHAXIB29+YADYGRih ZHzDIQTT3IB61eawTj99HzQI4csFxYeGIJ8LaxF6AgUJL1vwQEsdlkFawjUQneftQV+05yp9u+Y Bu2whLuVy5ro0Atjm75lspQwdWq+twCcXkeUDfamOCy8aFvz6nRml9US5SzQ3Nr19aUk/E9gsX9 bqAXEJmp6+JHbN/qXRGQAvS9Rk6sW88N1VCtwBYvpLWCTcPbATX/EcjiT3frz5mG6Qhnn817266 Syg9Nwj3lDdUoNTm5fxQLeTszw9t2DczlufovVTvEp2LQB9VQhir0+TOAsOf6yWu8pjKM= X-Google-Smtp-Source: AGHT+IEdl30USogqQJSCxFyuRgbIhrtp1NYuu50AEr+QIbOv48iKxFdSCfST8lfTP93VpiucxLMLcA== X-Received: by 2002:a05:600c:3115:b0:477:b48d:ba7a with SMTP id 5b1f17b1804b1-477c01fd202mr2764685e9.32.1763681665351; Thu, 20 Nov 2025 15:34: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 ffacd0b85a97d-42cb7fa3a81sm7984139f8f.26.2025.11.20.15.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 15:34:24 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v4 18/23] ipa: Add a new Algorithm::init() to support self-initalising algorithms Date: Thu, 20 Nov 2025 23:33:42 +0000 Message-ID: <20251120233347.5046-19-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" 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) {