[{"id":26718,"web_url":"https://patchwork.libcamera.org/comment/26718/","msgid":"<20230323161124.sn6uoemc4wmlqauf@uno.localdomain>","date":"2023-03-23T16:11:24","subject":"Re: [libcamera-devel] [PATCH v1 02/10] ipa: raspberrypi: Add\n\thardware configuration to the controller","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Wed, Mar 22, 2023 at 01:06:04PM +0000, Naushir Patuck via libcamera-devel wrote:\n> Add a new Controller::HardwareConfig structure that captures the\n> hardware statistics grid/histogram sizes and pipeline widths. This\n> ensures there is a single centralised places for these parameters.\n>\n> Add a getHardwareConfig() helper function to retrieve these values for a\n> given hardware target.\n>\n> Update the statistics populating routine in the IPA to use the values\n> from this structure instead of the hardcoded numbers.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/ipa/raspberrypi/controller/algorithm.h    |  4 ++\n>  src/ipa/raspberrypi/controller/controller.cpp | 39 +++++++++++++++++++\n>  src/ipa/raspberrypi/controller/controller.h   | 11 ++++++\n>  src/ipa/raspberrypi/raspberrypi.cpp           | 21 ++++------\n>  4 files changed, 62 insertions(+), 13 deletions(-)\n>\n> diff --git a/src/ipa/raspberrypi/controller/algorithm.h b/src/ipa/raspberrypi/controller/algorithm.h\n> index 7c22fbe4945c..4aa814ebbebd 100644\n> --- a/src/ipa/raspberrypi/controller/algorithm.h\n> +++ b/src/ipa/raspberrypi/controller/algorithm.h\n> @@ -45,6 +45,10 @@ public:\n>  \t{\n>  \t\treturn controller_->getTarget();\n>  \t}\n> +\tconst Controller::HardwareConfig &getHardwareConfig() const\n> +\t{\n> +\t\treturn controller_->getHardwareConfig();\n> +\t}\n>\n\nWill this be used ?\n\n>  private:\n>  \tController *controller_;\n> diff --git a/src/ipa/raspberrypi/controller/controller.cpp b/src/ipa/raspberrypi/controller/controller.cpp\n> index a6250ee140b0..2c7517aec6b4 100644\n> --- a/src/ipa/raspberrypi/controller/controller.cpp\n> +++ b/src/ipa/raspberrypi/controller/controller.cpp\n> @@ -20,6 +20,31 @@ using namespace libcamera;\n>\n>  LOG_DEFINE_CATEGORY(RPiController)\n>\n> +static const std::map<std::string, Controller::HardwareConfig> HardwareConfigMap = {\n> +\t{\n> +\t\t\"bcm2835\",\n> +\t\t{\n> +\t\t\t/*\n> +\t\t\t * There are only ever 15 AGC regions computed by the firmware\n> +\t\t\t * due to zoning, but the HW defines AGC_REGIONS == 16!\n> +\t\t\t */\n> +\t\t\t.agcRegions = { 15 , 1 },\n> +\t\t\t.agcZoneWeights = { 15 , 1 },\n> +\t\t\t.awbRegions = { 16, 12 },\n> +\t\t\t.focusRegions = { 4, 3 },\n> +\t\t\t.numHistogramBins = 128,\n> +\t\t\t.numGammaPoints = 33,\n> +\t\t\t.pipelineWidth = 13\n> +\t\t}\n> +\t},\n> +\t/* For error handling. */\n> +\t{\n> +\t\t\"error\",\n> +\t\t{\n> +\t\t}\n> +\t}\n\nDo you need this ?\n\n> +};\n> +\n>  Controller::Controller()\n>  \t: switchModeCalled_(false)\n>  {\n> @@ -148,3 +173,17 @@ const std::string &Controller::getTarget() const\n>  {\n>  \treturn target_;\n>  }\n> +\n> +const Controller::HardwareConfig &Controller::getHardwareConfig() const\n> +{\n> +\tauto cfg = HardwareConfigMap.find(getTarget());\n> +\n> +\t/*\n> +\t * This really should not happen, the IPA ought to validate the target\n> +\t * on initialisation.\n> +\t */\n> +\tif (cfg == HardwareConfigMap.end())\n> +\t\treturn HardwareConfigMap.at(\"error\");\n\nCould you just return {} here and remove \"error\" from the map ?\n\n> +\n> +\treturn cfg->second;\n> +}\n> diff --git a/src/ipa/raspberrypi/controller/controller.h b/src/ipa/raspberrypi/controller/controller.h\n> index 24e02903d438..c6af5cd6c7d4 100644\n> --- a/src/ipa/raspberrypi/controller/controller.h\n> +++ b/src/ipa/raspberrypi/controller/controller.h\n> @@ -37,6 +37,16 @@ typedef std::unique_ptr<Algorithm> AlgorithmPtr;\n>  class Controller\n>  {\n>  public:\n> +\tstruct HardwareConfig {\n> +\t\tlibcamera::Size agcRegions;\n> +\t\tlibcamera::Size agcZoneWeights;\n> +\t\tlibcamera::Size awbRegions;\n> +\t\tlibcamera::Size focusRegions;\n> +\t\tunsigned int numHistogramBins;\n> +\t\tunsigned int numGammaPoints;\n> +\t\tunsigned int pipelineWidth;\n> +\t};\n> +\n>  \tController();\n>  \t~Controller();\n>  \tint read(char const *filename);\n> @@ -47,6 +57,7 @@ public:\n>  \tMetadata &getGlobalMetadata();\n>  \tAlgorithm *getAlgorithm(std::string const &name) const;\n>  \tconst std::string &getTarget() const;\n> +\tconst HardwareConfig &getHardwareConfig() const;\n>\n>  protected:\n>  \tint createAlgorithm(const std::string &name, const libcamera::YamlObject &params);\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 86359538cf67..b64cb96e2dde 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -1392,20 +1392,19 @@ RPiController::StatisticsPtr IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n>  {\n>  \tusing namespace RPiController;\n>\n> +\tconst Controller::HardwareConfig &hw = controller_.getHardwareConfig();\n>  \tunsigned int i;\n>  \tStatisticsPtr statistics =\n>  \t\tstd::make_unique<Statistics>(Statistics::AgcStatsPos::PreWb, Statistics::ColourStatsPos::PostLsc);\n>\n>  \t/* RGB histograms are not used, so do not populate them. */\n> -\tstatistics->yHist = RPiController::Histogram(stats->hist[0].g_hist, NUM_HISTOGRAM_BINS);\n> +\tstatistics->yHist = RPiController::Histogram(stats->hist[0].g_hist,\n> +\t\t\t\t\t\t     hw.numHistogramBins);\n>\n> -\t/*\n> -\t * All region sums are based on a 13-bit pipeline bit-depth. Normalise\n> -\t * this to 16-bits for the AGC/AWB/ALSC algorithms.\n> -\t */\n> -\tconstexpr unsigned int scale = Statistics::NormalisationFactorPow2 - 13;\n> +\t/* All region sums are based on a 16-bit normalised pipeline bit-depth. */\n> +\tunsigned int scale = Statistics::NormalisationFactorPow2 - hw.pipelineWidth;\n>\n> -\tstatistics->awbRegions.init({ DEFAULT_AWB_REGIONS_X, DEFAULT_AWB_REGIONS_Y });\n> +\tstatistics->awbRegions.init(hw.awbRegions);\n>  \tfor (i = 0; i < statistics->awbRegions.numRegions(); i++)\n>  \t\tstatistics->awbRegions.set(i, { { stats->awb_stats[i].r_sum << scale,\n>  \t\t\t\t\t\t  stats->awb_stats[i].g_sum << scale,\n> @@ -1413,11 +1412,7 @@ RPiController::StatisticsPtr IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n>  \t\t\t\t\t\tstats->awb_stats[i].counted,\n>  \t\t\t\t\t\tstats->awb_stats[i].notcounted });\n>\n> -\t/*\n> -\t * There are only ever 15 regions computed by the firmware due to zoning,\n> -\t * but the HW defines AGC_REGIONS == 16!\n> -\t */\n> -\tstatistics->agcRegions.init(15);\n> +\tstatistics->agcRegions.init(hw.agcRegions);\n>  \tfor (i = 0; i < statistics->agcRegions.numRegions(); i++)\n>  \t\tstatistics->agcRegions.set(i, { { stats->agc_stats[i].r_sum << scale,\n>  \t\t\t\t\t\t  stats->agc_stats[i].g_sum << scale,\n> @@ -1425,7 +1420,7 @@ RPiController::StatisticsPtr IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n>  \t\t\t\t\t\tstats->agc_stats[i].counted,\n>  \t\t\t\t\t\tstats->awb_stats[i].notcounted });\n>\n> -\tstatistics->focusRegions.init({ 4, 3 });\n> +\tstatistics->focusRegions.init(hw.focusRegions);\n>  \tfor (i = 0; i < statistics->focusRegions.numRegions(); i++)\n>  \t\tstatistics->focusRegions.set(i, { stats->focus_stats[i].contrast_val[1][1] / 1000,\n>  \t\t\t\t\t\t  stats->focus_stats[i].contrast_val_num[1][1],\n> --\n> 2.34.1\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 E3E27C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Mar 2023 16:11:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19ECC626E2;\n\tThu, 23 Mar 2023 17:11:30 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 34D04626DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Mar 2023 17:11:28 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AE3309A8;\n\tThu, 23 Mar 2023 17:11:27 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679587890;\n\tbh=IE2gnIqJcoe9w4OOdO3ANoWCUdj55cwjZxJE7x++fzA=;\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=TJIKj44+9lbrb+DbMHt68020SzjBl9z9oo/DoIE+ujUlB9bwRWoToQjwUWdE29V3I\n\tp+n8JZtYnBI/gyf7Avo/UQAfjnqMmkVrudqjlTH+MuK3pcODriGl13OrmApebu9aPY\n\tnnvm31NK5MdtEQm3DXoRuWSKjcmLjdz8teu46Kpjyy1ib5RuU7k2nmT8C9jzCFVuNc\n\tnwYBbHCl9+CpHqliVthy2chpoXAguW5i5ewSce7rN8L3HB6LedB4mu8D8kIURykm3X\n\tbrQN6B/kmWJmshx7NulQnUENykZWDLxX8MDGDdOhfmvkkQEtZS/s82Qe+UftDWQOpu\n\tpPIcnRDdttseg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679587887;\n\tbh=IE2gnIqJcoe9w4OOdO3ANoWCUdj55cwjZxJE7x++fzA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nYm9dU1E+YD/rlEP+H5Mo09Pxhh0BX1YnLEJ28GY6VeFObUz2ZvXT/C3Z5yjbDYWX\n\tuKQZG4KqWZAibxJ//krOlVMlGBvKu5GaLRKIzui+RnaWm0W2cIisxzG1Dj+y86nRzW\n\tFprffRRk1fFXRkllkF5qvfY5zVFWSo41j11BL7YM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nYm9dU1E\"; dkim-atps=neutral","Date":"Thu, 23 Mar 2023 17:11:24 +0100","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230323161124.sn6uoemc4wmlqauf@uno.localdomain>","References":"<20230322130612.5208-1-naush@raspberrypi.com>\n\t<20230322130612.5208-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230322130612.5208-3-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v1 02/10] ipa: raspberrypi: Add\n\thardware configuration to the controller","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.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26720,"web_url":"https://patchwork.libcamera.org/comment/26720/","msgid":"<CAEmqJPpb0uMomvWCs7v3ium63i6JVH2qGGfHPC3D0J=_hNCATA@mail.gmail.com>","date":"2023-03-24T07:52:42","subject":"Re: [libcamera-devel] [PATCH v1 02/10] ipa: raspberrypi: Add\n\thardware configuration to the controller","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nThank you for your review!\n\nOn Thu, 23 Mar 2023 at 16:11, Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nwrote:\n\n> Hi Naush\n>\n> On Wed, Mar 22, 2023 at 01:06:04PM +0000, Naushir Patuck via\n> libcamera-devel wrote:\n> > Add a new Controller::HardwareConfig structure that captures the\n> > hardware statistics grid/histogram sizes and pipeline widths. This\n> > ensures there is a single centralised places for these parameters.\n> >\n> > Add a getHardwareConfig() helper function to retrieve these values for a\n> > given hardware target.\n> >\n> > Update the statistics populating routine in the IPA to use the values\n> > from this structure instead of the hardcoded numbers.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >  src/ipa/raspberrypi/controller/algorithm.h    |  4 ++\n> >  src/ipa/raspberrypi/controller/controller.cpp | 39 +++++++++++++++++++\n> >  src/ipa/raspberrypi/controller/controller.h   | 11 ++++++\n> >  src/ipa/raspberrypi/raspberrypi.cpp           | 21 ++++------\n> >  4 files changed, 62 insertions(+), 13 deletions(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/controller/algorithm.h\n> b/src/ipa/raspberrypi/controller/algorithm.h\n> > index 7c22fbe4945c..4aa814ebbebd 100644\n> > --- a/src/ipa/raspberrypi/controller/algorithm.h\n> > +++ b/src/ipa/raspberrypi/controller/algorithm.h\n> > @@ -45,6 +45,10 @@ public:\n> >       {\n> >               return controller_->getTarget();\n> >       }\n> > +     const Controller::HardwareConfig &getHardwareConfig() const\n> > +     {\n> > +             return controller_->getHardwareConfig();\n> > +     }\n> >\n>\n> Will this be used ?\n>\n\nYes, in subsequent patches :)\n\n\n>\n> >  private:\n> >       Controller *controller_;\n> > diff --git a/src/ipa/raspberrypi/controller/controller.cpp\n> b/src/ipa/raspberrypi/controller/controller.cpp\n> > index a6250ee140b0..2c7517aec6b4 100644\n> > --- a/src/ipa/raspberrypi/controller/controller.cpp\n> > +++ b/src/ipa/raspberrypi/controller/controller.cpp\n> > @@ -20,6 +20,31 @@ using namespace libcamera;\n> >\n> >  LOG_DEFINE_CATEGORY(RPiController)\n> >\n> > +static const std::map<std::string, Controller::HardwareConfig>\n> HardwareConfigMap = {\n> > +     {\n> > +             \"bcm2835\",\n> > +             {\n> > +                     /*\n> > +                      * There are only ever 15 AGC regions computed by\n> the firmware\n> > +                      * due to zoning, but the HW defines AGC_REGIONS\n> == 16!\n> > +                      */\n> > +                     .agcRegions = { 15 , 1 },\n> > +                     .agcZoneWeights = { 15 , 1 },\n> > +                     .awbRegions = { 16, 12 },\n> > +                     .focusRegions = { 4, 3 },\n> > +                     .numHistogramBins = 128,\n> > +                     .numGammaPoints = 33,\n> > +                     .pipelineWidth = 13\n> > +             }\n> > +     },\n> > +     /* For error handling. */\n> > +     {\n> > +             \"error\",\n> > +             {\n> > +             }\n> > +     }\n>\n> Do you need this ?\n>\n\nGood question.  I think the answer is no.\nWe validate the platform on ipa init, so really we cannot get into this\nerror state.\n\nI'll remove it in the next version.\n\nRegards,\nNaush\n\n\n\n>\n> > +};\n> > +\n> >  Controller::Controller()\n> >       : switchModeCalled_(false)\n> >  {\n> > @@ -148,3 +173,17 @@ const std::string &Controller::getTarget() const\n> >  {\n> >       return target_;\n> >  }\n> > +\n> > +const Controller::HardwareConfig &Controller::getHardwareConfig() const\n> > +{\n> > +     auto cfg = HardwareConfigMap.find(getTarget());\n> > +\n> > +     /*\n> > +      * This really should not happen, the IPA ought to validate the\n> target\n> > +      * on initialisation.\n> > +      */\n> > +     if (cfg == HardwareConfigMap.end())\n> > +             return HardwareConfigMap.at(\"error\");\n>\n> Could you just return {} here and remove \"error\" from the map ?\n>\n> > +\n> > +     return cfg->second;\n> > +}\n> > diff --git a/src/ipa/raspberrypi/controller/controller.h\n> b/src/ipa/raspberrypi/controller/controller.h\n> > index 24e02903d438..c6af5cd6c7d4 100644\n> > --- a/src/ipa/raspberrypi/controller/controller.h\n> > +++ b/src/ipa/raspberrypi/controller/controller.h\n> > @@ -37,6 +37,16 @@ typedef std::unique_ptr<Algorithm> AlgorithmPtr;\n> >  class Controller\n> >  {\n> >  public:\n> > +     struct HardwareConfig {\n> > +             libcamera::Size agcRegions;\n> > +             libcamera::Size agcZoneWeights;\n> > +             libcamera::Size awbRegions;\n> > +             libcamera::Size focusRegions;\n> > +             unsigned int numHistogramBins;\n> > +             unsigned int numGammaPoints;\n> > +             unsigned int pipelineWidth;\n> > +     };\n> > +\n> >       Controller();\n> >       ~Controller();\n> >       int read(char const *filename);\n> > @@ -47,6 +57,7 @@ public:\n> >       Metadata &getGlobalMetadata();\n> >       Algorithm *getAlgorithm(std::string const &name) const;\n> >       const std::string &getTarget() const;\n> > +     const HardwareConfig &getHardwareConfig() const;\n> >\n> >  protected:\n> >       int createAlgorithm(const std::string &name, const\n> libcamera::YamlObject &params);\n> > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp\n> b/src/ipa/raspberrypi/raspberrypi.cpp\n> > index 86359538cf67..b64cb96e2dde 100644\n> > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > @@ -1392,20 +1392,19 @@ RPiController::StatisticsPtr\n> IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n> >  {\n> >       using namespace RPiController;\n> >\n> > +     const Controller::HardwareConfig &hw =\n> controller_.getHardwareConfig();\n> >       unsigned int i;\n> >       StatisticsPtr statistics =\n> >\n>  std::make_unique<Statistics>(Statistics::AgcStatsPos::PreWb,\n> Statistics::ColourStatsPos::PostLsc);\n> >\n> >       /* RGB histograms are not used, so do not populate them. */\n> > -     statistics->yHist =\n> RPiController::Histogram(stats->hist[0].g_hist, NUM_HISTOGRAM_BINS);\n> > +     statistics->yHist = RPiController::Histogram(stats->hist[0].g_hist,\n> > +                                                  hw.numHistogramBins);\n> >\n> > -     /*\n> > -      * All region sums are based on a 13-bit pipeline bit-depth.\n> Normalise\n> > -      * this to 16-bits for the AGC/AWB/ALSC algorithms.\n> > -      */\n> > -     constexpr unsigned int scale = Statistics::NormalisationFactorPow2\n> - 13;\n> > +     /* All region sums are based on a 16-bit normalised pipeline\n> bit-depth. */\n> > +     unsigned int scale = Statistics::NormalisationFactorPow2 -\n> hw.pipelineWidth;\n> >\n> > -     statistics->awbRegions.init({ DEFAULT_AWB_REGIONS_X,\n> DEFAULT_AWB_REGIONS_Y });\n> > +     statistics->awbRegions.init(hw.awbRegions);\n> >       for (i = 0; i < statistics->awbRegions.numRegions(); i++)\n> >               statistics->awbRegions.set(i, { {\n> stats->awb_stats[i].r_sum << scale,\n> >\n>  stats->awb_stats[i].g_sum << scale,\n> > @@ -1413,11 +1412,7 @@ RPiController::StatisticsPtr\n> IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n> >\n>  stats->awb_stats[i].counted,\n> >\n>  stats->awb_stats[i].notcounted });\n> >\n> > -     /*\n> > -      * There are only ever 15 regions computed by the firmware due to\n> zoning,\n> > -      * but the HW defines AGC_REGIONS == 16!\n> > -      */\n> > -     statistics->agcRegions.init(15);\n> > +     statistics->agcRegions.init(hw.agcRegions);\n> >       for (i = 0; i < statistics->agcRegions.numRegions(); i++)\n> >               statistics->agcRegions.set(i, { {\n> stats->agc_stats[i].r_sum << scale,\n> >\n>  stats->agc_stats[i].g_sum << scale,\n> > @@ -1425,7 +1420,7 @@ RPiController::StatisticsPtr\n> IPARPi::fillStatistics(bcm2835_isp_stats *stats) co\n> >\n>  stats->agc_stats[i].counted,\n> >\n>  stats->awb_stats[i].notcounted });\n> >\n> > -     statistics->focusRegions.init({ 4, 3 });\n> > +     statistics->focusRegions.init(hw.focusRegions);\n> >       for (i = 0; i < statistics->focusRegions.numRegions(); i++)\n> >               statistics->focusRegions.set(i, {\n> stats->focus_stats[i].contrast_val[1][1] / 1000,\n> >\n>  stats->focus_stats[i].contrast_val_num[1][1],\n> > --\n> > 2.34.1\n> >\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 E589BC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Mar 2023 07:53:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 213B86270D;\n\tFri, 24 Mar 2023 08:53:02 +0100 (CET)","from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com\n\t[IPv6:2607:f8b0:4864:20::1129])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3DBE603A8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Mar 2023 08:52:59 +0100 (CET)","by mail-yw1-x1129.google.com with SMTP id\n\t00721157ae682-5419d4c340aso18941407b3.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Mar 2023 00:52:59 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679644382;\n\tbh=K4nyypz63255ZiJB4qfkIrS8lGaj+uVYy8ec9YXkMUs=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Craw/kAudLYx4IfvMlQ+uQMp25xIFxerICsFSvWn1mcJJR3IH86SHxgpV6MnWkGeE\n\tleU1b7eu0xnrt67QGvrMqhiWi+GCacqa/0S1zGqN/GztJ15ba9H+VvoBTogQunAznK\n\tBhEXuNqz9DTgHSdTruqlo1FnDiSfI9KqfLSlD22MjawOvADJS1i3iLP/kZsyFr/YKl\n\tcBRTmyAo2jJ4eaXu/s8k88W5sJ3ZL+WzaLaCc6il7QN50+2h/BAecWgHwNd52Te+PG\n\tPcV0E8LUVxj2ZsiyBpBl3E/n2tvuq46UcmtdOp24x1COVc9dtAqqS6FQ5QKxU4rStL\n\tcvOAdPKezV+xA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1679644378;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=MwreYVyR9Rves7SVaAIup4rcwu6qB/8AxgNLgANVgf0=;\n\tb=Ab2tQ3vg+9ckyH4KYUAkSGA2+45Y7MleSWtmH+72AwUC84iz4h7ezM0M2U0Bb3xzgb\n\tSQWjG9FUA11wlD9BP2TFo3KeySrPIcjpf1QP3JDWMg1yaqTPHrs6R2oxmT5ZACwDscyW\n\toWAV5+z/zzb9TMJAkbAcHOZQLQgO5qM6Xfq0ZKdMO4Fvl4EeACm++7a2A5vTu254dKiv\n\tZ+7hATiZ8zphqBcr9QiHtvILoydgVEtDerilmk+BMCCwbSVcLyc+1jd/hr0uJaSdwLR8\n\tqXV2KcitUI2eEo9PVXfbHW2+DGlFsGu2//z6ZLUtbYpWjddrbYkPrLs2mgh0Bxdht/Wf\n\tlqow=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Ab2tQ3vg\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1679644378;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=MwreYVyR9Rves7SVaAIup4rcwu6qB/8AxgNLgANVgf0=;\n\tb=DJhQ3eiueC2uZ3sk/wj4Y/svTEbAXws4LULp2rCNYzebtUkqFONyHS/KAMQmudZICV\n\tpzjpdIgs/hzV7KU7b/tRxrRxARsni3wx+0+cNfPNKMPfVbqNBmNQann4AeKfFtEL9SVH\n\tGguLupIJqNOiXesFoBmiz1rIEjMzfwlFSUVLD/oqnrQ4iI3FCJW1S2vDuNQH3scmUrgY\n\tfxSXbTdw9cH9OdMs3gyYZWjYFih9l0tcFT1DfSfyyhaYj3WSGpsBQBMTQcNRO20dT6jj\n\tEdHPpSfSazMK77m82wGQzcjIkKeW0KVR2ziaGfb6fEjDlIU35kZK91u6D0jhGbAwXQ1R\n\tTD8g==","X-Gm-Message-State":"AAQBX9cFbaE4YBSua5+K6oGrFAqi3s+GcZ03kpExEEJRA8rdDlR6hAIC\n\tests+a0pfpJPoj4+PiIdptZ+0teu43vSu5AhHahS971O9BnU51MTmIk=","X-Google-Smtp-Source":"AKy350YyQthJfr/bCDqluhFh6rWpsffm+biHLoma+LML/vjDkb96o+hQM1ZGFn50Sx9vfG9hy8zhW//gpS5mSsYZSPc=","X-Received":"by 2002:a81:ae11:0:b0:545:5b2c:4bf6 with SMTP id\n\tm17-20020a81ae11000000b005455b2c4bf6mr619447ywh.7.1679644378469;\n\tFri, 24 Mar 2023 00:52:58 -0700 (PDT)","MIME-Version":"1.0","References":"<20230322130612.5208-1-naush@raspberrypi.com>\n\t<20230322130612.5208-3-naush@raspberrypi.com>\n\t<20230323161124.sn6uoemc4wmlqauf@uno.localdomain>","In-Reply-To":"<20230323161124.sn6uoemc4wmlqauf@uno.localdomain>","Date":"Fri, 24 Mar 2023 07:52:42 +0000","Message-ID":"<CAEmqJPpb0uMomvWCs7v3ium63i6JVH2qGGfHPC3D0J=_hNCATA@mail.gmail.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"00000000000087330d05f7a0aea3\"","Subject":"Re: [libcamera-devel] [PATCH v1 02/10] ipa: raspberrypi: Add\n\thardware configuration to the controller","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]