From patchwork Thu Aug 18 09:43:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 17160 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 9AF00C3272 for ; Thu, 18 Aug 2022 09:44:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D46E61FCE; Thu, 18 Aug 2022 11:44:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660815870; bh=JsfPz9aOh+yRTxOO96KMikmTpDOd5KjY5SUao46pwCw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=4ThRGxhw+JMNXBR50GzWJtj68IGGvRTrhByZkkL/o5mA79MN21aYb//6JhSO49VjE 1BJZJFQwJKMBwZzSSJsRYZnQCmO/Sy/Tnn2HK5JfNQVEZBoE3wj7fxd12fT8NyyKCw U9uozGRP1OLMVciRkDGysnCqa0wa0+DTSw03oTodsKmmvxkvryjwi9ZCy90aUSTtMi K+XGUIoTNesD943Lbz3/PRSxpKbgIQ+1H8lVAKFQViR8yv5suK0H7KX3F9DN+ru9Em 1G3pBZBYEQkANgFUDcSRqwNRriDXjjRkIJePmAGm4fxj5GIPXNb7RV5RdfgKigbx14 Fe0UnQYtYPTQw== Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ABBCF61FA5 for ; Thu, 18 Aug 2022 11:44:26 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 5C7AFFF809; Thu, 18 Aug 2022 09:44:25 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Aug 2022 11:43:58 +0200 Message-Id: <20220818094410.1671-6-jacopo@jmondi.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818094410.1671-1-jacopo@jmondi.org> References: <20220818094410.1671-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 05/17] ipa: libipa: algorithm: prepare(): Pass frame and frame Context 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: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Kieran Bingham via libcamera-devel Pass the current frame number, and the current FrameContext for calls to prepare. Signed-off-by: Kieran Bingham Signed-off-by: Jacopo Mondi Reviewed-by: Umang Jain --- 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(-) 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( 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++;