From patchwork Thu Nov 27 02:37:34 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: 25256 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 8368AC32DE for ; Thu, 27 Nov 2025 02:38:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2E57A60C66; Thu, 27 Nov 2025 03:38:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Wmj+esZV"; 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 0336460C66 for ; Thu, 27 Nov 2025 03:38:25 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so2352635e9.1 for ; Wed, 26 Nov 2025 18:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764211104; x=1764815904; 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=Wmj+esZVbEXhV3QaSG552fkvTS1RT0rvfh+IHPfmfQBY3BIDw9SPr451r6isHqiJv0 Erc59n2bQu277dnkKZHAYFj/z+MxM9sb9XlydFVgAs4AMl6ioVC29pXawgaODXG1Ii7R 9VmzUZkBsor2wKAT1/H7u5t4deXgVEyP6ea6aiF1GXXf24hnqLgr5gncvyRGsXQhRDtM hNxaEEO/j86k7jUL7MOTgXfdXRbPlD1Y6ZCUqMlhaYwAWYozzbnlSRpttrUmcOBIJ4CW WTINJ68yHXBTzqIXjtDB5CYws5uNXGJkYQKbSxNjV7C9Ik3Hgh9b/y5aJdZ7mntnpQ+f 8ylw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764211104; x=1764815904; 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=wXRuqVzmOpAOsVcuU+75qzTPirSIfI3UPVGVFtxgok1+iB57DpxtGVuIdOKwGyF2en 9JbUeL9Vs8osPX4oOTS89vCuGVjmjliZ/9zJqNV/QWNmZLYbBE0RXryuisb6gbUlToDg r7vI1UQQpt9KU8k/sPcNqj3ess/C4pYKC30z+iqHowd9ANhufhkgoXR/gAocSDLZvMAh 327Qx9W4TMYJv7vVbeSJyqmOmOKOz92ElvL9Vpe+sKlOH9Bn8iCzCS7CQ+SfDp9Liu0t RirA/xAiSktPnKvarq2O4BJtQowxSAVDT1zYzTEawZs4NpSRxwmHxgR7ZS7FwHtqfyLj hHwA== X-Gm-Message-State: AOJu0Yzq6vU014Bx9GRDR6EJvYxlTLquKNpw5PiOUY5M6g+IF4ZrU14J wrSogrptxymNJNrW3lzLGhISkR+Ot5Naw6cXRy3Ko7i2+wSorrhfhTGfbZQa2PwUEZhf/YYpuwE GjJCwbVU= X-Gm-Gg: ASbGnct8KeCMEzxlLzjC0iicOyN6/1jnDUmBOpsn7bluz/M2kO8QMDayPXkQT7etjy9 n9GzQecFEjv2Nks/S55tptPwvpJwWbn/+E4N/mVHOdCyjPaAH5nz+AVNnKje1DlKKoawHnr+Pqj sdETTbw7QMNEplbtnZ//oOsdmt443QK0cuGxDV4OIxPZrrdM7a5R+zvgHaVR8VcrjlUIXyrkG65 qa3a94wWpYE8HlKeNdRSapuCgRMArQUtVvD7/DcC9vNljpULKCM0ZDL2KGGXNrhFKHw2W4qBUNg 56BZqVqDzosxk036rimQJPWTKQ0HP5DX5J2r9d1e0ketGEAybb/OafMsj6teUziqsrEtbcW7qZI +cL3PS5+ZLlf+91r51gU+XfkyplnQsWqMej3ojofeTshS47MOc2eGFKBea+KfG3p68Z0Q9S/BBS j1x92dsfQZOJD+PVFqacTrrAHRGD4iH0Sbcj/IoBfdKFK3jiyTjHhUkRr/URUybXvz730= X-Google-Smtp-Source: AGHT+IHzIQR+1DCDyIpRDMKPSK0EfjrwE6u55O6LGP6G8W8hQTzwHfYw+msbMCGKWK7ttfDlA0gsyA== X-Received: by 2002:a05:600c:c48e:b0:477:28c1:26ce with SMTP id 5b1f17b1804b1-47904acef1dmr83249335e9.7.1764211104376; Wed, 26 Nov 2025 18:38:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 18:38:23 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v5 19/24] ipa: Add a new Algorithm::init() to support self-initalising algorithms Date: Thu, 27 Nov 2025 02:37:34 +0000 Message-ID: <20251127023739.179652-20-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" 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) {