[{"id":25023,"web_url":"https://patchwork.libcamera.org/comment/25023/","msgid":"<166368550576.3912877.2023072776822989491@Monstersaurus>","date":"2022-09-20T14:51:45","subject":"Re: [libcamera-devel] [PATCH v4 18/32] ipa: rkisp1: Use frame\n\tnumber passed to Algorithm::prepare()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-09-08 02:41:46)\n> Now that the Algorithm::prepare() function takes a frame number, we can\n> use it to replace the IPAActiveState::frameCount member.\n> \n\nI'm very happy to see this cleaned up.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp  | 5 ++---\n>  src/ipa/rkisp1/algorithms/awb.cpp  | 5 ++---\n>  src/ipa/rkisp1/algorithms/blc.cpp  | 6 +++---\n>  src/ipa/rkisp1/algorithms/dpcc.cpp | 6 +++---\n>  src/ipa/rkisp1/algorithms/dpf.cpp  | 4 ++--\n>  src/ipa/rkisp1/algorithms/gsl.cpp  | 6 +++---\n>  src/ipa/rkisp1/algorithms/lsc.cpp  | 5 ++---\n>  src/ipa/rkisp1/ipa_context.cpp     | 9 ---------\n>  src/ipa/rkisp1/ipa_context.h       | 2 --\n>  src/ipa/rkisp1/rkisp1.cpp          | 3 ---\n>  10 files changed, 17 insertions(+), 34 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index e9fab0222ac3..4124c3272bc7 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -326,12 +326,11 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void Agc::prepare(IPAContext &context,\n> -                 [[maybe_unused]] const uint32_t frame,\n> +void Agc::prepare(IPAContext &context, const uint32_t frame,\n>                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                   rkisp1_params_cfg *params)\n>  {\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         /* Configure the measurement window. */\n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index d3e9aa5334cf..a0bbe5cb8afa 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -74,8 +74,7 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void Awb::prepare(IPAContext &context,\n> -                 [[maybe_unused]] const uint32_t frame,\n> +void Awb::prepare(IPAContext &context, const uint32_t frame,\n>                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                   rkisp1_params_cfg *params)\n>  {\n> @@ -88,7 +87,7 @@ void Awb::prepare(IPAContext &context,\n>         params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_AWB_GAIN;\n>  \n>         /* If we already have configured the gains and window, return. */\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         /* Configure the gains to apply. */\n> diff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp\n> index c4aea0e828ca..500ce94294a2 100644\n> --- a/src/ipa/rkisp1/algorithms/blc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/blc.cpp\n> @@ -65,12 +65,12 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void BlackLevelCorrection::prepare(IPAContext &context,\n> -                                  [[maybe_unused]] const uint32_t frame,\n> +void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n> +                                  const uint32_t frame,\n>                                    [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                                    rkisp1_params_cfg *params)\n>  {\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         if (!tuningParameters_)\n> diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp\n> index b61eee022a68..f59d48180eb5 100644\n> --- a/src/ipa/rkisp1/algorithms/dpcc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/dpcc.cpp\n> @@ -258,12 +258,12 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void DefectPixelClusterCorrection::prepare(IPAContext &context,\n> -                                          [[maybe_unused]] const uint32_t frame,\n> +void DefectPixelClusterCorrection::prepare([[maybe_unused]] IPAContext &context,\n> +                                          const uint32_t frame,\n>                                            [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                                            rkisp1_params_cfg *params)\n>  {\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         if (!initialized_)\n> diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> index 8eafbbf85124..94c35c36570c 100644\n> --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> @@ -207,7 +207,7 @@ void Dpf::queueRequest(IPAContext &context,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +void Dpf::prepare(IPAContext &context, const uint32_t frame,\n>                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                   rkisp1_params_cfg *params)\n>  {\n> @@ -216,7 +216,7 @@ void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \n>         auto &dpf = context.activeState.dpf;\n>  \n> -       if (context.activeState.frameCount == 0) {\n> +       if (frame == 0) {\n>                 params->others.dpf_config = config_;\n>                 params->others.dpf_strength_config = strengthConfig_;\n>  \n> diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\n> index ed3104c98e48..44303594bd47 100644\n> --- a/src/ipa/rkisp1/algorithms/gsl.cpp\n> +++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n> @@ -118,12 +118,12 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void GammaSensorLinearization::prepare(IPAContext &context,\n> -                                      [[maybe_unused]] const uint32_t frame,\n> +void GammaSensorLinearization::prepare([[maybe_unused]] IPAContext &context,\n> +                                      const uint32_t frame,\n>                                        [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                                        rkisp1_params_cfg *params)\n>  {\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         if (!initialized_)\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index ed5b988599b8..20111c342bb3 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -132,12 +132,11 @@ int LensShadingCorrection::configure(IPAContext &context,\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::prepare\n>   */\n> -void LensShadingCorrection::prepare(IPAContext &context,\n> -                                   [[maybe_unused]] const uint32_t frame,\n> +void LensShadingCorrection::prepare(IPAContext &context, const uint32_t frame,\n>                                     [[maybe_unused]] RkISP1FrameContext &frameContext,\n>                                     rkisp1_params_cfg *params)\n>  {\n> -       if (context.activeState.frameCount > 0)\n> +       if (frame > 0)\n>                 return;\n>  \n>         if (!initialized_)\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 80fae271a6dc..211428717838 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -192,15 +192,6 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\brief Analogue gain multiplier\n>   */\n>  \n> -/**\n> - * \\var IPAActiveState::frameCount\n> - * \\brief Counter of requests queued to the IPA module\n> - *\n> - * The counter is reset to 0 when the IPA module is configured, and is\n> - * incremented for each request being queued, after calling the\n> - * Algorithm::prepare() function of all algorithms.\n> - */\n> -\n>  /**\n>   * \\struct RkISP1FrameContext\n>   * \\brief Per-frame context for algorithms\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index 9d89cf0160fc..4e38ef40ed3c 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -87,8 +87,6 @@ struct IPAActiveState {\n>                 uint32_t exposure;\n>                 double gain;\n>         } sensor;\n> -\n> -       unsigned int frameCount;\n>  };\n>  \n>  struct RkISP1FrameContext : public FrameContext {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 538401ac89ac..4f6e0b0f87b9 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -261,8 +261,6 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n>         context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n>         context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n>  \n> -       context_.activeState.frameCount = 0;\n> -\n>         for (auto const &algo : algorithms()) {\n>                 int ret = algo->configure(context_, info);\n>                 if (ret)\n> @@ -325,7 +323,6 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n>                 algo->prepare(context_, frame, frameContext, params);\n>  \n>         paramsBufferReady.emit(frame);\n> -       context_.activeState.frameCount++;\n>  }\n>  \n>  void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6D8BAC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Sep 2022 14:51:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1DDE0621BB;\n\tTue, 20 Sep 2022 16:51:50 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F5756218B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Sep 2022 16:51:48 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AE2796BE;\n\tTue, 20 Sep 2022 16:51:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663685510;\n\tbh=X8aYE21CWNpZHJaCvYDlzcelNvtRKXAFwiQDRgMg2Eg=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=n0dOZRxua60jRM15VKxV1oz0J6cO0+N+P91KcozHIzfpqYmNL7EVnwq7j5ETijzBG\n\triNKr+voIBdRaeAua8BkmxR/1dkzKy8+CKc0vAiw3zuqAert2e/px35WHQ6IavOGVr\n\t0DcLzL9qX8u4ZlHCKIvTOmHFBOOoG4KCTLkwbgMGBVIrCGeJaVPREGhOyvDicOQ0or\n\tFKrbX2jPPEOtvTJj1VrXe9wm9cnkR7J6TzNZXB8igdViNZocLSJfx2Z81Pn67zexdd\n\t5FC+vOVewPavezk+1O8WZ4CHXsuaPzxGLn7wDiiPahpBDX9BVtsqC4YEHKFfuexs90\n\t8/v/ozntpUleg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1663685507;\n\tbh=X8aYE21CWNpZHJaCvYDlzcelNvtRKXAFwiQDRgMg2Eg=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=OO4tqwm/NWkkbvFCzjn6TogUBrmLYQrbvwM1gzEX7Y60aYrUmEw3K3VlfYuVjSw3N\n\t/+wuHpS31u3ekkaumF7bqGY7D9hUahmxiXAgBNKiDb5L/wt0X5mAaE9EtEu17dUW5s\n\t2jU4fbGxO1aZ8CS1kGGoHwtD2uB+bdP86blVgGE4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"OO4tqwm/\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220908014200.28728-19-laurent.pinchart@ideasonboard.com>","References":"<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>\n\t<20220908014200.28728-19-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 20 Sep 2022 15:51:45 +0100","Message-ID":"<166368550576.3912877.2023072776822989491@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v4 18/32] ipa: rkisp1: Use frame\n\tnumber passed to Algorithm::prepare()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25064,"web_url":"https://patchwork.libcamera.org/comment/25064/","msgid":"<20220921184208.v6guuplylcgabaow@uno.localdomain>","date":"2022-09-21T18:42:08","subject":"Re: [libcamera-devel] [PATCH v4 18/32] ipa: rkisp1: Use frame\n\tnumber passed to Algorithm::prepare()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"On Tue, Sep 20, 2022 at 03:51:45PM +0100, Kieran Bingham via libcamera-devel wrote:\n> Quoting Laurent Pinchart via libcamera-devel (2022-09-08 02:41:46)\n> > Now that the Algorithm::prepare() function takes a frame number, we can\n> > use it to replace the IPAActiveState::frameCount member.\n> >\n>\n> I'm very happy to see this cleaned up.\n\nLikewise :)\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/ipa/rkisp1/algorithms/agc.cpp  | 5 ++---\n> >  src/ipa/rkisp1/algorithms/awb.cpp  | 5 ++---\n> >  src/ipa/rkisp1/algorithms/blc.cpp  | 6 +++---\n> >  src/ipa/rkisp1/algorithms/dpcc.cpp | 6 +++---\n> >  src/ipa/rkisp1/algorithms/dpf.cpp  | 4 ++--\n> >  src/ipa/rkisp1/algorithms/gsl.cpp  | 6 +++---\n> >  src/ipa/rkisp1/algorithms/lsc.cpp  | 5 ++---\n> >  src/ipa/rkisp1/ipa_context.cpp     | 9 ---------\n> >  src/ipa/rkisp1/ipa_context.h       | 2 --\n> >  src/ipa/rkisp1/rkisp1.cpp          | 3 ---\n> >  10 files changed, 17 insertions(+), 34 deletions(-)\n> >\n> > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> > index e9fab0222ac3..4124c3272bc7 100644\n> > --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> > @@ -326,12 +326,11 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void Agc::prepare(IPAContext &context,\n> > -                 [[maybe_unused]] const uint32_t frame,\n> > +void Agc::prepare(IPAContext &context, const uint32_t frame,\n> >                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                   rkisp1_params_cfg *params)\n> >  {\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         /* Configure the measurement window. */\n> > diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> > index d3e9aa5334cf..a0bbe5cb8afa 100644\n> > --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> > @@ -74,8 +74,7 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void Awb::prepare(IPAContext &context,\n> > -                 [[maybe_unused]] const uint32_t frame,\n> > +void Awb::prepare(IPAContext &context, const uint32_t frame,\n> >                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                   rkisp1_params_cfg *params)\n> >  {\n> > @@ -88,7 +87,7 @@ void Awb::prepare(IPAContext &context,\n> >         params->module_cfg_update |= RKISP1_CIF_ISP_MODULE_AWB_GAIN;\n> >\n> >         /* If we already have configured the gains and window, return. */\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         /* Configure the gains to apply. */\n> > diff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp\n> > index c4aea0e828ca..500ce94294a2 100644\n> > --- a/src/ipa/rkisp1/algorithms/blc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/blc.cpp\n> > @@ -65,12 +65,12 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void BlackLevelCorrection::prepare(IPAContext &context,\n> > -                                  [[maybe_unused]] const uint32_t frame,\n> > +void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n> > +                                  const uint32_t frame,\n> >                                    [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                                    rkisp1_params_cfg *params)\n> >  {\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         if (!tuningParameters_)\n> > diff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp\n> > index b61eee022a68..f59d48180eb5 100644\n> > --- a/src/ipa/rkisp1/algorithms/dpcc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/dpcc.cpp\n> > @@ -258,12 +258,12 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void DefectPixelClusterCorrection::prepare(IPAContext &context,\n> > -                                          [[maybe_unused]] const uint32_t frame,\n> > +void DefectPixelClusterCorrection::prepare([[maybe_unused]] IPAContext &context,\n> > +                                          const uint32_t frame,\n> >                                            [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                                            rkisp1_params_cfg *params)\n> >  {\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         if (!initialized_)\n> > diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > index 8eafbbf85124..94c35c36570c 100644\n> > --- a/src/ipa/rkisp1/algorithms/dpf.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n> > @@ -207,7 +207,7 @@ void Dpf::queueRequest(IPAContext &context,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> > +void Dpf::prepare(IPAContext &context, const uint32_t frame,\n> >                   [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                   rkisp1_params_cfg *params)\n> >  {\n> > @@ -216,7 +216,7 @@ void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> >\n> >         auto &dpf = context.activeState.dpf;\n> >\n> > -       if (context.activeState.frameCount == 0) {\n> > +       if (frame == 0) {\n> >                 params->others.dpf_config = config_;\n> >                 params->others.dpf_strength_config = strengthConfig_;\n> >\n> > diff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\n> > index ed3104c98e48..44303594bd47 100644\n> > --- a/src/ipa/rkisp1/algorithms/gsl.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n> > @@ -118,12 +118,12 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void GammaSensorLinearization::prepare(IPAContext &context,\n> > -                                      [[maybe_unused]] const uint32_t frame,\n> > +void GammaSensorLinearization::prepare([[maybe_unused]] IPAContext &context,\n> > +                                      const uint32_t frame,\n> >                                        [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                                        rkisp1_params_cfg *params)\n> >  {\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         if (!initialized_)\n> > diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > index ed5b988599b8..20111c342bb3 100644\n> > --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > @@ -132,12 +132,11 @@ int LensShadingCorrection::configure(IPAContext &context,\n> >  /**\n> >   * \\copydoc libcamera::ipa::Algorithm::prepare\n> >   */\n> > -void LensShadingCorrection::prepare(IPAContext &context,\n> > -                                   [[maybe_unused]] const uint32_t frame,\n> > +void LensShadingCorrection::prepare(IPAContext &context, const uint32_t frame,\n> >                                     [[maybe_unused]] RkISP1FrameContext &frameContext,\n> >                                     rkisp1_params_cfg *params)\n> >  {\n> > -       if (context.activeState.frameCount > 0)\n> > +       if (frame > 0)\n> >                 return;\n> >\n> >         if (!initialized_)\n> > diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> > index 80fae271a6dc..211428717838 100644\n> > --- a/src/ipa/rkisp1/ipa_context.cpp\n> > +++ b/src/ipa/rkisp1/ipa_context.cpp\n> > @@ -192,15 +192,6 @@ namespace libcamera::ipa::rkisp1 {\n> >   * \\brief Analogue gain multiplier\n> >   */\n> >\n> > -/**\n> > - * \\var IPAActiveState::frameCount\n> > - * \\brief Counter of requests queued to the IPA module\n> > - *\n> > - * The counter is reset to 0 when the IPA module is configured, and is\n> > - * incremented for each request being queued, after calling the\n> > - * Algorithm::prepare() function of all algorithms.\n> > - */\n> > -\n> >  /**\n> >   * \\struct RkISP1FrameContext\n> >   * \\brief Per-frame context for algorithms\n> > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> > index 9d89cf0160fc..4e38ef40ed3c 100644\n> > --- a/src/ipa/rkisp1/ipa_context.h\n> > +++ b/src/ipa/rkisp1/ipa_context.h\n> > @@ -87,8 +87,6 @@ struct IPAActiveState {\n> >                 uint32_t exposure;\n> >                 double gain;\n> >         } sensor;\n> > -\n> > -       unsigned int frameCount;\n> >  };\n> >\n> >  struct RkISP1FrameContext : public FrameContext {\n> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> > index 538401ac89ac..4f6e0b0f87b9 100644\n> > --- a/src/ipa/rkisp1/rkisp1.cpp\n> > +++ b/src/ipa/rkisp1/rkisp1.cpp\n> > @@ -261,8 +261,6 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n> >         context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n> >         context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n> >\n> > -       context_.activeState.frameCount = 0;\n> > -\n> >         for (auto const &algo : algorithms()) {\n> >                 int ret = algo->configure(context_, info);\n> >                 if (ret)\n> > @@ -325,7 +323,6 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n> >                 algo->prepare(context_, frame, frameContext, params);\n> >\n> >         paramsBufferReady.emit(frame);\n> > -       context_.activeState.frameCount++;\n> >  }\n> >\n> >  void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F1CDEC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Sep 2022 18:42:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5826A600AA;\n\tWed, 21 Sep 2022 20:42:12 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BBC40600AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Sep 2022 20:42:10 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id ABE2A40005;\n\tWed, 21 Sep 2022 18:42:09 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663785732;\n\tbh=EJVIveHrCAnqOYMFPM/b0eRutfI80tSoOXwEf9CiiCY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=1UxzRavV4ip60JoIFM+6alteR80LRHhm8t6XRgJPd4IMCSCIEmc5mxt6ilo7EmA2+\n\t4omMjErt/B+I8SXFsjHhZV2iUQIFRDERf9ZuplKK6rD/Y6fXIbYgvZ4L93SkCQjt8L\n\te36Xn3XsW7mGWIfXbHlo2UI3A4klkp+P6Fc8UD74jVIS0U5v/ENgTxFe+rqG30/WQk\n\tic8+t5WfbhhgiW2Gb+vYPBgU8WxhixfNvezsqpDaCNAFyVSzqJzQ6znM0KGx0mXS+W\n\tAL8bFIPnSDpR33unc/OinIr0jDrah0H50NxhPUjXncgVIw6u9qKaRhij1SZ57hZPlm\n\tFkq8r9QaPgVVg==","Date":"Wed, 21 Sep 2022 20:42:08 +0200","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20220921184208.v6guuplylcgabaow@uno.localdomain>","References":"<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>\n\t<20220908014200.28728-19-laurent.pinchart@ideasonboard.com>\n\t<166368550576.3912877.2023072776822989491@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<166368550576.3912877.2023072776822989491@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH v4 18/32] ipa: rkisp1: Use frame\n\tnumber passed to Algorithm::prepare()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]