[v4,18/23] ipa: Add a new Algorithm::init() to support self-initalising algorithms
diff mbox series

Message ID 20251120233347.5046-19-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • Add GLES 2.0 GPUISP to libcamera
Related show

Commit Message

Bryan O'Donoghue Nov. 20, 2025, 11:33 p.m. UTC
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 <bryan.odonoghue@linaro.org>
---
 src/ipa/libipa/algorithm.cpp | 13 ++++++++++++-
 src/ipa/libipa/algorithm.h   |  5 +++++
 2 files changed, 17 insertions(+), 1 deletion(-)

Patch
diff mbox series

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)
 	{