[libcamera-devel,v3,05/17] ipa: libipa: algorithm: prepare(): Pass frame and frame Context
diff mbox series

Message ID 20220818094410.1671-6-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: Align IPU3 and RKISP1 interfaces
Related show

Commit Message

Jacopo Mondi Aug. 18, 2022, 9:43 a.m. UTC
From: Kieran Bingham via libcamera-devel <libcamera-devel@lists.libcamera.org>

Pass the current frame number, and the current FrameContext for calls to
prepare.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/ipa/ipu3/algorithms/af.cpp           | 5 ++++-
 src/ipa/ipu3/algorithms/af.h             | 4 +++-
 src/ipa/ipu3/algorithms/awb.cpp          | 5 ++++-
 src/ipa/ipu3/algorithms/awb.h            | 5 ++++-
 src/ipa/ipu3/algorithms/blc.cpp          | 6 +++++-
 src/ipa/ipu3/algorithms/blc.h            | 4 +++-
 src/ipa/ipu3/algorithms/tone_mapping.cpp | 4 ++++
 src/ipa/ipu3/algorithms/tone_mapping.h   | 3 ++-
 src/ipa/ipu3/ipu3.cpp                    | 4 +++-
 src/ipa/libipa/algorithm.cpp             | 2 ++
 src/ipa/libipa/algorithm.h               | 2 ++
 src/ipa/rkisp1/algorithms/agc.cpp        | 5 ++++-
 src/ipa/rkisp1/algorithms/agc.h          | 4 +++-
 src/ipa/rkisp1/algorithms/awb.cpp        | 5 ++++-
 src/ipa/rkisp1/algorithms/awb.h          | 4 +++-
 src/ipa/rkisp1/algorithms/blc.cpp        | 2 ++
 src/ipa/rkisp1/algorithms/blc.h          | 4 +++-
 src/ipa/rkisp1/algorithms/cproc.cpp      | 2 ++
 src/ipa/rkisp1/algorithms/cproc.h        | 4 +++-
 src/ipa/rkisp1/algorithms/dpcc.cpp       | 2 ++
 src/ipa/rkisp1/algorithms/dpcc.h         | 4 +++-
 src/ipa/rkisp1/algorithms/filter.cpp     | 5 ++++-
 src/ipa/rkisp1/algorithms/filter.h       | 4 +++-
 src/ipa/rkisp1/algorithms/gsl.cpp        | 2 ++
 src/ipa/rkisp1/algorithms/gsl.h          | 4 +++-
 src/ipa/rkisp1/algorithms/lsc.cpp        | 2 ++
 src/ipa/rkisp1/algorithms/lsc.h          | 4 +++-
 src/ipa/rkisp1/rkisp1.cpp                | 4 +++-
 28 files changed, 85 insertions(+), 20 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp
index e7ed37003217..a949f0015b7d 100644
--- a/src/ipa/ipu3/algorithms/af.cpp
+++ b/src/ipa/ipu3/algorithms/af.cpp
@@ -116,7 +116,10 @@  Af::Af()
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
-void Af::prepare(IPAContext &context, ipu3_uapi_params *params)
+void Af::prepare(IPAContext &context,
+		 [[maybe_unused]] unsigned int frame,
+		 [[maybe_unused]] IPU3FrameContext &frameContext,
+		 ipu3_uapi_params *params)
 {
 	const struct ipu3_uapi_grid_config &grid = context.configuration.af.afGrid;
 	params->acc_param.af.grid_cfg = grid;
diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h
index 7a5aeb1b6bf4..4e2bbd08c3bf 100644
--- a/src/ipa/ipu3/algorithms/af.h
+++ b/src/ipa/ipu3/algorithms/af.h
@@ -30,8 +30,10 @@  public:
 	Af();
 	~Af() = default;
 
-	void prepare(IPAContext &context, ipu3_uapi_params *params) override;
 	int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     IPU3FrameContext &frameContext,
+		     ipu3_uapi_params *params) override;
 	void process(IPAContext &context, IPU3FrameContext &frameContext,
 		     const ipu3_uapi_stats_3a *stats) override;
 
diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp
index 35eafd5ec50e..a87b81f6458f 100644
--- a/src/ipa/ipu3/algorithms/awb.cpp
+++ b/src/ipa/ipu3/algorithms/awb.cpp
@@ -430,7 +430,10 @@  constexpr uint16_t Awb::gainValue(double gain)
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
-void Awb::prepare(IPAContext &context, ipu3_uapi_params *params)
+void Awb::prepare(IPAContext &context,
+		  [[maybe_unused]] unsigned int frame,
+		  [[maybe_unused]] IPU3FrameContext &frameContext,
+		  ipu3_uapi_params *params)
 {
 	/*
 	 * Green saturation thresholds are reduced because we are using the
diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h
index 28e39620fd59..731e5bae17de 100644
--- a/src/ipa/ipu3/algorithms/awb.h
+++ b/src/ipa/ipu3/algorithms/awb.h
@@ -39,7 +39,10 @@  public:
 	~Awb();
 
 	int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
-	void prepare(IPAContext &context, ipu3_uapi_params *params) override;
+
+	void prepare(IPAContext &context, unsigned int frame,
+		     IPU3FrameContext &frameContext,
+		     ipu3_uapi_params *params) override;
 	void process(IPAContext &context, IPU3FrameContext &frameContext,
 		     const ipu3_uapi_stats_3a *stats) override;
 
diff --git a/src/ipa/ipu3/algorithms/blc.cpp b/src/ipa/ipu3/algorithms/blc.cpp
index c561aa858b96..ff9ffacff13e 100644
--- a/src/ipa/ipu3/algorithms/blc.cpp
+++ b/src/ipa/ipu3/algorithms/blc.cpp
@@ -39,13 +39,17 @@  BlackLevelCorrection::BlackLevelCorrection()
 /**
  * \brief Fill in the parameter structure, and enable black level correction
  * \param context The shared IPA context
+ * \param[in] frame The frame context sequence number
+ * \param[in] frameContext The FrameContext for this frame
  * \param params The IPU3 parameters
  *
  * Populate the IPU3 parameter structure with the correction values for each
  * channel and enable the corresponding ImgU block processing.
  */
 void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,
-			      ipu3_uapi_params *params)
+				   [[maybe_unused]] unsigned int frame,
+				   [[maybe_unused]] IPU3FrameContext &frameContext,
+				   ipu3_uapi_params *params)
 {
 	/*
 	 * The Optical Black Level correction values
diff --git a/src/ipa/ipu3/algorithms/blc.h b/src/ipa/ipu3/algorithms/blc.h
index d8da1748baba..36388b267eea 100644
--- a/src/ipa/ipu3/algorithms/blc.h
+++ b/src/ipa/ipu3/algorithms/blc.h
@@ -18,7 +18,9 @@  class BlackLevelCorrection : public Algorithm
 public:
 	BlackLevelCorrection();
 
-	void prepare(IPAContext &context, ipu3_uapi_params *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     IPU3FrameContext &frameContext,
+		     ipu3_uapi_params *params) override;
 };
 
 } /* namespace ipa::ipu3::algorithms */
diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp
index 72627ea1e658..f5e6b1e35080 100644
--- a/src/ipa/ipu3/algorithms/tone_mapping.cpp
+++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp
@@ -50,12 +50,16 @@  int ToneMapping::configure(IPAContext &context,
 /**
  * \brief Fill in the parameter structure, and enable gamma control
  * \param context The shared IPA context
+ * \param[in] frame The frame context sequence number
+ * \param[in] frameContext The FrameContext for this frame
  * \param params The IPU3 parameters
  *
  * Populate the IPU3 parameter structure with our tone mapping look up table and
  * enable the gamma control module in the processing blocks.
  */
 void ToneMapping::prepare([[maybe_unused]] IPAContext &context,
+			  [[maybe_unused]] unsigned int frame,
+			  [[maybe_unused]] IPU3FrameContext &frameContext,
 			  ipu3_uapi_params *params)
 {
 	/* Copy the calculated LUT into the parameters buffer. */
diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h
index 8cce38c742a6..cfb3de01b7f3 100644
--- a/src/ipa/ipu3/algorithms/tone_mapping.h
+++ b/src/ipa/ipu3/algorithms/tone_mapping.h
@@ -19,7 +19,8 @@  public:
 	ToneMapping();
 
 	int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
-	void prepare(IPAContext &context, ipu3_uapi_params *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     IPU3FrameContext &frameContext, ipu3_uapi_params *params) override;
 	void process(IPAContext &context, IPU3FrameContext &frameContext,
 		     const ipu3_uapi_stats_3a *stats) override;
 
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 13d7c878a242..17dd13c04edf 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -574,8 +574,10 @@  void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
 	 */
 	params->use = {};
 
+	IPU3FrameContext &frameContext = context_.frameContexts.get(frame);
+
 	for (auto const &algo : algorithms())
-		algo->prepare(context_, params);
+		algo->prepare(context_, frame, frameContext, params);
 
 	paramsBufferReady.emit(frame);
 }
diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
index 38200e57b780..0992e5de8dd5 100644
--- a/src/ipa/libipa/algorithm.cpp
+++ b/src/ipa/libipa/algorithm.cpp
@@ -70,6 +70,8 @@  namespace ipa {
  * \fn Algorithm::prepare()
  * \brief Fill the \a params buffer with ISP processing parameters for a frame
  * \param[in] context The shared IPA context
+ * \param[in] frame The frame context sequence number
+ * \param[in] frameContext The FrameContext for this frame
  * \param[out] params The ISP specific parameters.
  *
  * This function is called for every frame when the camera is running before it
diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h
index 0fe3d772963a..379207f1657e 100644
--- a/src/ipa/libipa/algorithm.h
+++ b/src/ipa/libipa/algorithm.h
@@ -38,6 +38,8 @@  public:
 	}
 
 	virtual void prepare([[maybe_unused]] typename Module::Context &context,
+			     [[maybe_unused]] unsigned int frame,
+			     [[maybe_unused]] typename Module::FrameContext &frameContext,
 			     [[maybe_unused]] typename Module::Params *params)
 	{
 	}
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 40d27963ef68..2d436511caf7 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -322,7 +322,10 @@  void Agc::process(IPAContext &context,
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
-void Agc::prepare(IPAContext &context, rkisp1_params_cfg *params)
+void Agc::prepare(IPAContext &context,
+		  [[maybe_unused]] unsigned int frame,
+		  [[maybe_unused]] RKISP1FrameContext &frameContext,
+		  rkisp1_params_cfg *params)
 {
 	if (context.activeState.frameCount > 0)
 		return;
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
index af7fe2740908..97ca0e31558c 100644
--- a/src/ipa/rkisp1/algorithms/agc.h
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -26,7 +26,9 @@  public:
 	~Agc() = default;
 
 	int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 	void process(IPAContext &context, RKISP1FrameContext &frameContext,
 		     const rkisp1_stat_buffer *stats) override;
 
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp
index 3beafb73ca33..1af6d98c5252 100644
--- a/src/ipa/rkisp1/algorithms/awb.cpp
+++ b/src/ipa/rkisp1/algorithms/awb.cpp
@@ -70,7 +70,10 @@  uint32_t Awb::estimateCCT(double red, double green, double blue)
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
-void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)
+void Awb::prepare(IPAContext &context,
+		  [[maybe_unused]] unsigned int frame,
+		  [[maybe_unused]] RKISP1FrameContext &frameContext,
+		  rkisp1_params_cfg *params)
 {
 	params->others.awb_gain_config.gain_green_b = 256 * context.activeState.awb.gains.green;
 	params->others.awb_gain_config.gain_blue = 256 * context.activeState.awb.gains.blue;
diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h
index 5954034b8142..82d5ce1b1818 100644
--- a/src/ipa/rkisp1/algorithms/awb.h
+++ b/src/ipa/rkisp1/algorithms/awb.h
@@ -20,7 +20,9 @@  public:
 	~Awb() = default;
 
 	int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 	void process(IPAContext &context, RKISP1FrameContext &frameCtx,
 		     const rkisp1_stat_buffer *stats) override;
 
diff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp
index 4d55a2d529cb..93c7e3145fa2 100644
--- a/src/ipa/rkisp1/algorithms/blc.cpp
+++ b/src/ipa/rkisp1/algorithms/blc.cpp
@@ -66,6 +66,8 @@  int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
 void BlackLevelCorrection::prepare(IPAContext &context,
+				   [[maybe_unused]] unsigned int frame,
+				   [[maybe_unused]] RKISP1FrameContext &frameContext,
 				   rkisp1_params_cfg *params)
 {
 	if (context.activeState.frameCount > 0)
diff --git a/src/ipa/rkisp1/algorithms/blc.h b/src/ipa/rkisp1/algorithms/blc.h
index 5fc3a80fb638..1afa12f6b46e 100644
--- a/src/ipa/rkisp1/algorithms/blc.h
+++ b/src/ipa/rkisp1/algorithms/blc.h
@@ -20,7 +20,9 @@  public:
 	~BlackLevelCorrection() = default;
 
 	int init(IPAContext &context, const YamlObject &tuningData) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 
 private:
 	bool tuningParameters_;
diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp
index a3b778d1c908..edaf2d10e850 100644
--- a/src/ipa/rkisp1/algorithms/cproc.cpp
+++ b/src/ipa/rkisp1/algorithms/cproc.cpp
@@ -71,6 +71,8 @@  void ColorProcessing::queueRequest(IPAContext &context,
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
 void ColorProcessing::prepare(IPAContext &context,
+			      [[maybe_unused]] unsigned int frame,
+			      [[maybe_unused]] RKISP1FrameContext &frameContext,
 			      rkisp1_params_cfg *params)
 {
 	auto &cproc = context.activeState.cproc;
diff --git a/src/ipa/rkisp1/algorithms/cproc.h b/src/ipa/rkisp1/algorithms/cproc.h
index 4b7e4064d7e8..fde83f3c965c 100644
--- a/src/ipa/rkisp1/algorithms/cproc.h
+++ b/src/ipa/rkisp1/algorithms/cproc.h
@@ -23,7 +23,9 @@  public:
 
 	void queueRequest(IPAContext &context, const uint32_t frame,
 			  const ControlList &controls) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 };
 
 } /* namespace ipa::rkisp1::algorithms */
diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp
index 93d37b1dae44..9ba03653afdc 100644
--- a/src/ipa/rkisp1/algorithms/dpcc.cpp
+++ b/src/ipa/rkisp1/algorithms/dpcc.cpp
@@ -232,6 +232,8 @@  int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
 void DefectPixelClusterCorrection::prepare(IPAContext &context,
+					   [[maybe_unused]] unsigned int frame,
+					   [[maybe_unused]] RKISP1FrameContext &frameContext,
 					   rkisp1_params_cfg *params)
 {
 	if (context.activeState.frameCount > 0)
diff --git a/src/ipa/rkisp1/algorithms/dpcc.h b/src/ipa/rkisp1/algorithms/dpcc.h
index a363f7bee0a7..ca9df9fc38dc 100644
--- a/src/ipa/rkisp1/algorithms/dpcc.h
+++ b/src/ipa/rkisp1/algorithms/dpcc.h
@@ -20,7 +20,9 @@  public:
 	~DefectPixelClusterCorrection() = default;
 
 	int init(IPAContext &context, const YamlObject &tuningData) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 
 private:
 	bool initialized_;
diff --git a/src/ipa/rkisp1/algorithms/filter.cpp b/src/ipa/rkisp1/algorithms/filter.cpp
index bc7fc1f32f34..f6577046442a 100644
--- a/src/ipa/rkisp1/algorithms/filter.cpp
+++ b/src/ipa/rkisp1/algorithms/filter.cpp
@@ -85,7 +85,10 @@  void Filter::queueRequest(IPAContext &context,
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
-void Filter::prepare(IPAContext &context, rkisp1_params_cfg *params)
+void Filter::prepare(IPAContext &context,
+		     [[maybe_unused]] unsigned int frame,
+		     [[maybe_unused]] RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params)
 {
 	auto &filter = context.activeState.filter;
 
diff --git a/src/ipa/rkisp1/algorithms/filter.h b/src/ipa/rkisp1/algorithms/filter.h
index 9eb170eb7da1..1fbe785a3cab 100644
--- a/src/ipa/rkisp1/algorithms/filter.h
+++ b/src/ipa/rkisp1/algorithms/filter.h
@@ -23,7 +23,9 @@  public:
 
 	void queueRequest(IPAContext &context, const uint32_t frame,
 			  const ControlList &controls) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 };
 
 } /* namespace ipa::rkisp1::algorithms */
diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp
index dd9974627cd2..77d841cfbf82 100644
--- a/src/ipa/rkisp1/algorithms/gsl.cpp
+++ b/src/ipa/rkisp1/algorithms/gsl.cpp
@@ -119,6 +119,8 @@  int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
 void GammaSensorLinearization::prepare(IPAContext &context,
+				       [[maybe_unused]] unsigned int frame,
+				       [[maybe_unused]] RKISP1FrameContext &frameContext,
 				       rkisp1_params_cfg *params)
 {
 	if (context.activeState.frameCount > 0)
diff --git a/src/ipa/rkisp1/algorithms/gsl.h b/src/ipa/rkisp1/algorithms/gsl.h
index db287dc280dc..fe74ae10e099 100644
--- a/src/ipa/rkisp1/algorithms/gsl.h
+++ b/src/ipa/rkisp1/algorithms/gsl.h
@@ -20,7 +20,9 @@  public:
 	~GammaSensorLinearization() = default;
 
 	int init(IPAContext &context, const YamlObject &tuningData) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 
 private:
 	bool initialized_;
diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index 4ed467086199..cd8fcbe66b9b 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -123,6 +123,8 @@  int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
 void LensShadingCorrection::prepare(IPAContext &context,
+				    [[maybe_unused]] unsigned int frame,
+				    [[maybe_unused]] RKISP1FrameContext &frameContext,
 				    rkisp1_params_cfg *params)
 {
 	if (context.activeState.frameCount > 0)
diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h
index fdb2ec1dd27d..fafb80b329ee 100644
--- a/src/ipa/rkisp1/algorithms/lsc.h
+++ b/src/ipa/rkisp1/algorithms/lsc.h
@@ -20,7 +20,9 @@  public:
 	~LensShadingCorrection() = default;
 
 	int init(IPAContext &context, const YamlObject &tuningData) override;
-	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
+	void prepare(IPAContext &context, unsigned int frame,
+		     RKISP1FrameContext &frameContext,
+		     rkisp1_params_cfg *params) override;
 
 private:
 	bool initialized_;
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 3d6a6b78bb8d..219c4a4e4b33 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -301,6 +301,8 @@  void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls)
 
 void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
 {
+	RKISP1FrameContext &frameContext = context_.frameContexts.get(frame);
+
 	rkisp1_params_cfg *params =
 		reinterpret_cast<rkisp1_params_cfg *>(
 			mappedBuffers_.at(bufferId).planes()[0].data());
@@ -309,7 +311,7 @@  void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
 	memset(params, 0, sizeof(*params));
 
 	for (auto const &algo : algorithms())
-		algo->prepare(context_, params);
+		algo->prepare(context_, frame, frameContext, params);
 
 	paramsBufferReady.emit(frame);
 	context_.activeState.frameCount++;