[{"id":18952,"web_url":"https://patchwork.libcamera.org/comment/18952/","msgid":"<3bd5e599-b40e-2031-c809-c795602dc06a@ideasonboard.com>","date":"2021-08-19T15:31:24","subject":"Re: [libcamera-devel] [PATCH v4 4/9] ipa: ipu3: Introduce modular\n\talgorithm","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 19/08/2021 15:57, Jean-Michel Hautbois wrote:\n> Implement a new modular framework for algorithms with a common context\n> structure that is passed to each algorithm through a common API.\n> \n> This patch:\n> - removes all the local references from IPAIPU3 and uses IPAContext\n> - implements the list of pointers and the loop at configure call on each\n>   algorithm\n> - loops in fillParams on each prepare() call on the algorithm list\n> - loops in prepareStats on each process() call on the algorithm list\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/algorithm.cpp |  2 +-\n>  src/ipa/ipu3/algorithms/algorithm.h   |  2 +-\n>  src/ipa/ipu3/ipa_context.h            |  6 +++\n>  src/ipa/ipu3/ipu3.cpp                 | 56 +++++++++++++++++++++------\n>  4 files changed, 52 insertions(+), 14 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/algorithm.cpp b/src/ipa/ipu3/algorithms/algorithm.cpp\n> index ec3c152e..8291fb16 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.cpp\n> +++ b/src/ipa/ipu3/algorithms/algorithm.cpp\n> @@ -92,7 +92,7 @@ void Algorithm::prepare([[maybe_unused]] IPAContext &context, [[maybe_unused]] i\n>   * Care shall be taken to ensure the ordering of access to the information\n>   * such that the algorithms use up to date state as required.\n>   */\n> -void Algorithm::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const ipu3_uapi_stats_3a &stats)\n> +void Algorithm::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const ipu3_uapi_stats_3a *&stats)\n\n*& should be just *, and it should be * from the previous patch, so no\nchange expected here.\n\n\n\n>  {\n>  }\n>  \n> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n> index 89431005..df66fc8c 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.h\n> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n> @@ -23,7 +23,7 @@ public:\n>  \n>  \tvirtual void prepare(IPAContext &context, ipu3_uapi_params &params);\n>  \n> -\tvirtual void process(IPAContext &context, const ipu3_uapi_stats_3a &stats);\n> +\tvirtual void process(IPAContext &context, const ipu3_uapi_stats_3a *&stats);\n>  };\n>  \n>  } /* namespace ipa::ipu3 */\n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> index 2706d3ca..a031ab83 100644\n> --- a/src/ipa/ipu3/ipa_context.h\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -10,11 +10,17 @@\n>  \n>  #include <linux/intel-ipu3.h>\n>  \n> +#include <libcamera/geometry.h>\n> +\n>  namespace libcamera {\n>  \n>  namespace ipa::ipu3 {\n>  \n>  struct IPASessionConfiguration {\n> +\tstruct {\n> +\t\tipu3_uapi_grid_config bdsGrid;\n> +\t\tSize bdsOutputSize;\n> +\t} grid;\n>  };\n>  \n>  struct IPAFrameContext {\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index a4359d3e..fa09d9f2 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -29,6 +29,7 @@\n>  \n>  #include \"libcamera/internal/mapped_framebuffer.h\"\n>  \n> +#include \"algorithms/algorithm.h\"\n>  #include \"ipu3_agc.h\"\n>  #include \"ipu3_awb.h\"\n>  #include \"libipa/camera_sensor_helper.h\"\n> @@ -82,6 +83,17 @@ static constexpr uint32_t kMaxCellHeightPerSet = 56;\n>   * are run. This needs to be turned into real per-frame data storage.\n>   */\n>  \n> +/**\n> + * \\struct IPASessionConfiguration::grid\n> + * \\brief Grid configuration of the IPA\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsGrid\n> + * \\brief Bayer Down Scaler grid plane config used by the kernel\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsOutputSize\n> + * \\brief BDS output size configured by the pipeline handler\n> + */\n> +\n>  namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(IPAIPU3)\n> @@ -137,10 +149,12 @@ private:\n>  \t/* Interface to the Camera Helper */\n>  \tstd::unique_ptr<CameraSensorHelper> camHelper_;\n>  \n> +\t/* Maintain the algorithms used by the IPA */\n> +\tstd::list<std::unique_ptr<ipa::ipu3::Algorithm>> algorithms_;\n> +\n>  \t/* Local parameter storage */\n> +\tstruct IPAContext context_;\n>  \tstruct ipu3_uapi_params params_;\n> -\n> -\tstruct ipu3_uapi_grid_config bdsGrid_;\n>  };\n>  \n>  /**\n> @@ -237,7 +251,9 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)\n>  \tuint32_t minError = std::numeric_limits<uint32_t>::max();\n>  \tSize best;\n>  \tSize bestLog2;\n> -\tbdsGrid_ = {};\n> +\n> +\t/* Set the BDS output size in the IPAConfiguration structure */\n> +\tcontext_.configuration.grid.bdsOutputSize = bdsOutputSize;\n>  \n>  \tfor (uint32_t widthShift = 3; widthShift <= 7; ++widthShift) {\n>  \t\tuint32_t width = std::min(kMaxCellWidthPerSet,\n> @@ -261,14 +277,17 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)\n>  \t\t}\n>  \t}\n>  \n> -\tbdsGrid_.width = best.width >> bestLog2.width;\n> -\tbdsGrid_.block_width_log2 = bestLog2.width;\n> -\tbdsGrid_.height = best.height >> bestLog2.height;\n> -\tbdsGrid_.block_height_log2 = bestLog2.height;\n> +\tstruct ipu3_uapi_grid_config &bdsGrid = context_.configuration.grid.bdsGrid;\n> +\tbdsGrid.x_start = 0;\n> +\tbdsGrid.y_start = 0;\n> +\tbdsGrid.width = best.width >> bestLog2.width;\n> +\tbdsGrid.block_width_log2 = bestLog2.width;\n> +\tbdsGrid.height = best.height >> bestLog2.height;\n> +\tbdsGrid.block_height_log2 = bestLog2.height;\n>  \n>  \tLOG(IPAIPU3, Debug) << \"Best grid found is: (\"\n> -\t\t\t    << (int)bdsGrid_.width << \" << \" << (int)bdsGrid_.block_width_log2 << \") x (\"\n> -\t\t\t    << (int)bdsGrid_.height << \" << \" << (int)bdsGrid_.block_height_log2 << \")\";\n> +\t\t\t    << (int)bdsGrid.width << \" << \" << (int)bdsGrid.block_width_log2 << \") x (\"\n> +\t\t\t    << (int)bdsGrid.height << \" << \" << (int)bdsGrid.block_height_log2 << \")\";\n>  }\n>  \n>  int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n> @@ -310,15 +329,22 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n>  \n>  \tdefVBlank_ = itVBlank->second.def().get<int32_t>();\n>  \n> +\t/* Clean context and IPU3 parameters at configuration */\n>  \tparams_ = {};\n> +\tcontext_ = {};\n>  \n>  \tcalculateBdsGrid(configInfo.bdsOutputSize);\n>  \n> -\tawbAlgo_ = std::make_unique<IPU3Awb>();\n> -\tawbAlgo_->initialise(params_, configInfo.bdsOutputSize, bdsGrid_);\n> +\tfor (auto const &algo : algorithms_) {\n> +\t\tint ret = algo->configure(context_, configInfo);\n> +\t\tif (ret)\n> +\t\t\treturn ret;\n> +\t}\n>  \n> +\tawbAlgo_ = std::make_unique<IPU3Awb>();\n> +\tawbAlgo_->initialise(params_, context_.configuration.grid.bdsOutputSize, context_.configuration.grid.bdsGrid);\n>  \tagcAlgo_ = std::make_unique<IPU3Agc>();\n> -\tagcAlgo_->initialise(bdsGrid_, sensorInfo_);\n> +\tagcAlgo_->initialise(context_.configuration.grid.bdsGrid, sensorInfo_);\n>  \n>  \treturn 0;\n>  }\n> @@ -392,6 +418,9 @@ void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n>  \n>  void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n>  {\n> +\tfor (auto const &algo : algorithms_)\n> +\t\talgo->prepare(context_, params_);\n\nAha, here we should be calling:\n\n\t\talgo->prepare(context_, params);\n\nBut as this is a transition with the existing algorithms also running,\nperhaps you might want to call\n\n\t\talgo->prepare(context_, &params_);\n\n> +\n>  \tif (agcAlgo_->updateControls())\n>  \t\tawbAlgo_->updateWbParameters(params_, agcAlgo_->gamma());\n\nUntil after this ^ is removed, at which point the loop calls to prepare\ncan go directly to params, and params_ can be removed entirely from the\nclass.\n\n\nWith that,\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n> @@ -409,6 +438,9 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>  {\n>  \tControlList ctrls(controls::controls);\n>  \n> +\tfor (auto const &algo : algorithms_)\n> +\t\talgo->process(context_, stats);\n> +\n>  \tdouble gain = camHelper_->gain(gain_);\n>  \tagcAlgo_->process(stats, exposure_, gain);\n>  \tgain_ = camHelper_->gainCode(gain);\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 A81A0BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Aug 2021 15:31:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 34C0460264;\n\tThu, 19 Aug 2021 17:31:28 +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 C310860264\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Aug 2021 17:31:26 +0200 (CEST)","from [192.168.0.20]\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 49236DD;\n\tThu, 19 Aug 2021 17:31:26 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Egw7um7Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629387086;\n\tbh=3J0SUbqWDWa1MCNZwhqbOj2Le2u5fMC+5qNA9RE8wbU=;\n\th=To:References:From:Subject:Date:In-Reply-To:From;\n\tb=Egw7um7ZKdK6v+mPUK6YIjwpCDnH3G23poG7bg6I3VUcUtlQ610JMxVCZfx0PSOEG\n\tLMQpRriaqdJ2+Tq4GJ6sxBqSC6OafztsqVa8mvg9SnwEBebQVIwXJMW9wdqsC4D6lO\n\tKfS2N3MQ/bd2yKSSgAgCWcPlfAzg8c8UEfx2B2T0=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210819145759.184192-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210819145759.184192-5-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<3bd5e599-b40e-2031-c809-c795602dc06a@ideasonboard.com>","Date":"Thu, 19 Aug 2021 16:31:24 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210819145759.184192-5-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v4 4/9] ipa: ipu3: Introduce modular\n\talgorithm","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18959,"web_url":"https://patchwork.libcamera.org/comment/18959/","msgid":"<YR79yJ2kj6peAGaH@pendragon.ideasonboard.com>","date":"2021-08-20T00:56:40","subject":"Re: [libcamera-devel] [PATCH v4 4/9] ipa: ipu3: Introduce modular\n\talgorithm","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Thu, Aug 19, 2021 at 04:57:54PM +0200, Jean-Michel Hautbois wrote:\n> Implement a new modular framework for algorithms with a common context\n> structure that is passed to each algorithm through a common API.\n> \n> This patch:\n> - removes all the local references from IPAIPU3 and uses IPAContext\n> - implements the list of pointers and the loop at configure call on each\n>   algorithm\n> - loops in fillParams on each prepare() call on the algorithm list\n> - loops in prepareStats on each process() call on the algorithm list\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/algorithm.cpp |  2 +-\n>  src/ipa/ipu3/algorithms/algorithm.h   |  2 +-\n>  src/ipa/ipu3/ipa_context.h            |  6 +++\n>  src/ipa/ipu3/ipu3.cpp                 | 56 +++++++++++++++++++++------\n>  4 files changed, 52 insertions(+), 14 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/algorithm.cpp b/src/ipa/ipu3/algorithms/algorithm.cpp\n> index ec3c152e..8291fb16 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.cpp\n> +++ b/src/ipa/ipu3/algorithms/algorithm.cpp\n> @@ -92,7 +92,7 @@ void Algorithm::prepare([[maybe_unused]] IPAContext &context, [[maybe_unused]] i\n>   * Care shall be taken to ensure the ordering of access to the information\n>   * such that the algorithms use up to date state as required.\n>   */\n> -void Algorithm::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const ipu3_uapi_stats_3a &stats)\n> +void Algorithm::process([[maybe_unused]] IPAContext &context, [[maybe_unused]] const ipu3_uapi_stats_3a *&stats)\n>  {\n>  }\n>  \n> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n> index 89431005..df66fc8c 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.h\n> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n> @@ -23,7 +23,7 @@ public:\n>  \n>  \tvirtual void prepare(IPAContext &context, ipu3_uapi_params &params);\n>  \n> -\tvirtual void process(IPAContext &context, const ipu3_uapi_stats_3a &stats);\n> +\tvirtual void process(IPAContext &context, const ipu3_uapi_stats_3a *&stats);\n>  };\n>  \n>  } /* namespace ipa::ipu3 */\n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> index 2706d3ca..a031ab83 100644\n> --- a/src/ipa/ipu3/ipa_context.h\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -10,11 +10,17 @@\n>  \n>  #include <linux/intel-ipu3.h>\n>  \n> +#include <libcamera/geometry.h>\n> +\n>  namespace libcamera {\n>  \n>  namespace ipa::ipu3 {\n>  \n>  struct IPASessionConfiguration {\n> +\tstruct {\n> +\t\tipu3_uapi_grid_config bdsGrid;\n> +\t\tSize bdsOutputSize;\n> +\t} grid;\n>  };\n>  \n>  struct IPAFrameContext {\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index a4359d3e..fa09d9f2 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -29,6 +29,7 @@\n>  \n>  #include \"libcamera/internal/mapped_framebuffer.h\"\n>  \n> +#include \"algorithms/algorithm.h\"\n>  #include \"ipu3_agc.h\"\n>  #include \"ipu3_awb.h\"\n>  #include \"libipa/camera_sensor_helper.h\"\n> @@ -82,6 +83,17 @@ static constexpr uint32_t kMaxCellHeightPerSet = 56;\n>   * are run. This needs to be turned into real per-frame data storage.\n>   */\n>  \n> +/**\n> + * \\struct IPASessionConfiguration::grid\n> + * \\brief Grid configuration of the IPA\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsGrid\n> + * \\brief Bayer Down Scaler grid plane config used by the kernel\n> + *\n> + * \\var IPASessionConfiguration::grid::bdsOutputSize\n> + * \\brief BDS output size configured by the pipeline handler\n> + */\n> +\n>  namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(IPAIPU3)\n> @@ -137,10 +149,12 @@ private:\n>  \t/* Interface to the Camera Helper */\n>  \tstd::unique_ptr<CameraSensorHelper> camHelper_;\n>  \n> +\t/* Maintain the algorithms used by the IPA */\n> +\tstd::list<std::unique_ptr<ipa::ipu3::Algorithm>> algorithms_;\n> +\n>  \t/* Local parameter storage */\n> +\tstruct IPAContext context_;\n>  \tstruct ipu3_uapi_params params_;\n> -\n> -\tstruct ipu3_uapi_grid_config bdsGrid_;\n>  };\n>  \n>  /**\n> @@ -237,7 +251,9 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)\n>  \tuint32_t minError = std::numeric_limits<uint32_t>::max();\n>  \tSize best;\n>  \tSize bestLog2;\n> -\tbdsGrid_ = {};\n> +\n> +\t/* Set the BDS output size in the IPAConfiguration structure */\n> +\tcontext_.configuration.grid.bdsOutputSize = bdsOutputSize;\n>  \n>  \tfor (uint32_t widthShift = 3; widthShift <= 7; ++widthShift) {\n>  \t\tuint32_t width = std::min(kMaxCellWidthPerSet,\n> @@ -261,14 +277,17 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)\n>  \t\t}\n>  \t}\n>  \n> -\tbdsGrid_.width = best.width >> bestLog2.width;\n> -\tbdsGrid_.block_width_log2 = bestLog2.width;\n> -\tbdsGrid_.height = best.height >> bestLog2.height;\n> -\tbdsGrid_.block_height_log2 = bestLog2.height;\n> +\tstruct ipu3_uapi_grid_config &bdsGrid = context_.configuration.grid.bdsGrid;\n> +\tbdsGrid.x_start = 0;\n> +\tbdsGrid.y_start = 0;\n> +\tbdsGrid.width = best.width >> bestLog2.width;\n> +\tbdsGrid.block_width_log2 = bestLog2.width;\n> +\tbdsGrid.height = best.height >> bestLog2.height;\n> +\tbdsGrid.block_height_log2 = bestLog2.height;\n>  \n>  \tLOG(IPAIPU3, Debug) << \"Best grid found is: (\"\n> -\t\t\t    << (int)bdsGrid_.width << \" << \" << (int)bdsGrid_.block_width_log2 << \") x (\"\n> -\t\t\t    << (int)bdsGrid_.height << \" << \" << (int)bdsGrid_.block_height_log2 << \")\";\n> +\t\t\t    << (int)bdsGrid.width << \" << \" << (int)bdsGrid.block_width_log2 << \") x (\"\n> +\t\t\t    << (int)bdsGrid.height << \" << \" << (int)bdsGrid.block_height_log2 << \")\";\n>  }\n>  \n>  int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n> @@ -310,15 +329,22 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n>  \n>  \tdefVBlank_ = itVBlank->second.def().get<int32_t>();\n>  \n> +\t/* Clean context and IPU3 parameters at configuration */\n>  \tparams_ = {};\n> +\tcontext_ = {};\n>  \n>  \tcalculateBdsGrid(configInfo.bdsOutputSize);\n>  \n> -\tawbAlgo_ = std::make_unique<IPU3Awb>();\n> -\tawbAlgo_->initialise(params_, configInfo.bdsOutputSize, bdsGrid_);\n> +\tfor (auto const &algo : algorithms_) {\n> +\t\tint ret = algo->configure(context_, configInfo);\n> +\t\tif (ret)\n> +\t\t\treturn ret;\n> +\t}\n>  \n> +\tawbAlgo_ = std::make_unique<IPU3Awb>();\n> +\tawbAlgo_->initialise(params_, context_.configuration.grid.bdsOutputSize, context_.configuration.grid.bdsGrid);\n\nShould I mention line wrap ? :-)\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \tagcAlgo_ = std::make_unique<IPU3Agc>();\n> -\tagcAlgo_->initialise(bdsGrid_, sensorInfo_);\n> +\tagcAlgo_->initialise(context_.configuration.grid.bdsGrid, sensorInfo_);\n>  \n>  \treturn 0;\n>  }\n> @@ -392,6 +418,9 @@ void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n>  \n>  void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n>  {\n> +\tfor (auto const &algo : algorithms_)\n> +\t\talgo->prepare(context_, params_);\n> +\n>  \tif (agcAlgo_->updateControls())\n>  \t\tawbAlgo_->updateWbParameters(params_, agcAlgo_->gamma());\n>  \n> @@ -409,6 +438,9 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>  {\n>  \tControlList ctrls(controls::controls);\n>  \n> +\tfor (auto const &algo : algorithms_)\n> +\t\talgo->process(context_, stats);\n> +\n>  \tdouble gain = camHelper_->gain(gain_);\n>  \tagcAlgo_->process(stats, exposure_, gain);\n>  \tgain_ = camHelper_->gainCode(gain);","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 05A24BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Aug 2021 00:56:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63370688A3;\n\tFri, 20 Aug 2021 02:56:49 +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 728D968886\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Aug 2021 02:56:48 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DD2BF8F;\n\tFri, 20 Aug 2021 02:56:47 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"IujYx6mq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1629421008;\n\tbh=NBP88wUxY4awaj7EXrX12ZELdkpYzhJx7xN4KaUwNPs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IujYx6mqBxFLXfCwDPYbkwZqGR1CaXjkP42/GuDTiyIxtDiwrUbBJRHWtQazsSBz7\n\tGVIXKZOzIAcW+z2HtdzPxOWAsDHkJIIpvfzVnKv4+cXnvRrEDzfImcshOcrqMTuby+\n\tGvXRHsSmI3xTH344mlDvWNRVXew/yHib+3Z6iOgM=","Date":"Fri, 20 Aug 2021 03:56:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YR79yJ2kj6peAGaH@pendragon.ideasonboard.com>","References":"<20210819145759.184192-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210819145759.184192-5-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210819145759.184192-5-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 4/9] ipa: ipu3: Introduce modular\n\talgorithm","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]