[{"id":22198,"web_url":"https://patchwork.libcamera.org/comment/22198/","msgid":"<164605518607.2091767.14461866903118975305@Monstersaurus>","date":"2022-02-28T13:33:06","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Umang,\n\nQuoting Umang Jain (2022-02-28 13:22:50)\n> The exposure and gain limits are queried as part of\n> IPAIPU3::configure(). Consolidate it.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 44 +++++++++++++------------------------------\n>  1 file changed, 13 insertions(+), 31 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 2fab4ee0..33fcf59b 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -196,12 +196,14 @@ private:\n>  void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>  {\n>         const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n> -       int32_t minExposure = v4l2Exposure.min().get<int32_t>();\n> -       int32_t maxExposure = v4l2Exposure.max().get<int32_t>();\n> +       minExposure_ = v4l2Exposure.min().get<int32_t>();\n> +       maxExposure_ = v4l2Exposure.max().get<int32_t>();\n> +       exposure_ = minExposure_;\n\nAre the class members used elsewhere at all? (I.e. exposure_ etc?) or\ncould they be removed leaving the state stored only in\ncontext_.configuration?\n\nI don't think it's in yet, but I'm sure one of JM's patches adds state\nto a IPASessionConfiguration.sensor structure to keep sensor specfic\nstate tied together in the context.\n\nThese properties might really belong in there.\n\n>         const ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\n> -       int32_t minGain = v4l2Gain.min().get<int32_t>();\n> -       int32_t maxGain = v4l2Gain.max().get<int32_t>();\n> +       minGain_ = v4l2Gain.min().get<int32_t>();\n> +       maxGain_ = v4l2Gain.max().get<int32_t>();\n> +       gain_ = minGain_;\n>  \n>         /*\n>          * When the AGC computes the new exposure values for a frame, it needs\n> @@ -210,10 +212,10 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>          *\n>          * \\todo take VBLANK into account for maximum shutter speed\n>          */\n> -       context_.configuration.agc.minShutterSpeed = minExposure * lineDuration_;\n> -       context_.configuration.agc.maxShutterSpeed = maxExposure * lineDuration_;\n> -       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n> -       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n> +       context_.configuration.agc.minShutterSpeed = minExposure_ * lineDuration_;\n> +       context_.configuration.agc.maxShutterSpeed = maxExposure_ * lineDuration_;\n> +       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n> +       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n>  }\n>  \n>  /**\n> @@ -430,32 +432,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>          */\n>         ctrls_ = configInfo.sensorControls;\n>  \n> -       const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\n> -       if (itExp == ctrls_.end()) {\n> -               LOG(IPAIPU3, Error) << \"Can't find exposure control\";\n> -               return -EINVAL;\n> -       }\n> -\n> -       const auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\n> -       if (itGain == ctrls_.end()) {\n> -               LOG(IPAIPU3, Error) << \"Can't find gain control\";\n> -               return -EINVAL;\n> -       }\n> -\n>         const auto itVBlank = ctrls_.find(V4L2_CID_VBLANK);\n>         if (itVBlank == ctrls_.end()) {\n>                 LOG(IPAIPU3, Error) << \"Can't find VBLANK control\";\n>                 return -EINVAL;\n>         }\n>  \n> -       minExposure_ = itExp->second.min().get<int32_t>();\n> -       maxExposure_ = itExp->second.max().get<int32_t>();\n> -       exposure_ = minExposure_;\n> -\n> -       minGain_ = itGain->second.min().get<int32_t>();\n> -       maxGain_ = itGain->second.max().get<int32_t>();\n> -       gain_ = minGain_;\n> -\n>         defVBlank_ = itVBlank->second.def().get<int32_t>();\n>  \n>         /* Clean context at configuration */\n> @@ -465,12 +447,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>  \n>         lineDuration_ = sensorInfo_.lineLength * 1.0s / sensorInfo_.pixelRate;\n>  \n> -       /* Update the camera controls using the new sensor settings. */\n> -       updateControls(sensorInfo_, ctrls_, ipaControls);\n> -\n>         /* Update the IPASessionConfiguration using the sensor settings. */\n>         updateSessionConfiguration(ctrls_);\n>  \n> +       /* Update the camera controls using the new sensor settings. */\n> +       updateControls(sensorInfo_, ctrls_, ipaControls);\n> +\n>         for (auto const &algo : algorithms_) {\n>                 int ret = algo->configure(context_, configInfo);\n>                 if (ret)\n> -- \n> 2.31.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 9E49DBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Feb 2022 13:33:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B30F961171;\n\tMon, 28 Feb 2022 14:33:09 +0100 (CET)","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 B9A926115E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Feb 2022 14:33:08 +0100 (CET)","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 5F8BE478;\n\tMon, 28 Feb 2022 14:33:08 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jI6nvdWi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1646055188;\n\tbh=qb0lGI0V4YRmLScTIWsNz/j14+uPRWcjAmmJq0+E1yQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=jI6nvdWiy8awL3HqhjfT4X84k5KjiJi62DeLJhdNeWUVbdBtMmfnvXT5WfrMhMPvC\n\tSNcETK2z9Z/nLUZV2brckW0EJCIma1ID2Ig1FG0mDL9HHnpcV+66lrqOgpu9zaYfPC\n\toZP672h77XJ1qIzJ2scX1B6/qa4isxE2WUBZfdAg=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220228132250.116211-3-umang.jain@ideasonboard.com>","References":"<20220228132250.116211-1-umang.jain@ideasonboard.com>\n\t<20220228132250.116211-3-umang.jain@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 28 Feb 2022 13:33:06 +0000","Message-ID":"<164605518607.2091767.14461866903118975305@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","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":22199,"web_url":"https://patchwork.libcamera.org/comment/22199/","msgid":"<e685a88c-c6dc-0588-ab16-d1f97ca14875@ideasonboard.com>","date":"2022-02-28T13:52:19","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran,\n\nOn 2/28/22 19:03, Kieran Bingham wrote:\n> Hi Umang,\n>\n> Quoting Umang Jain (2022-02-28 13:22:50)\n>> The exposure and gain limits are queried as part of\n>> IPAIPU3::configure(). Consolidate it.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   src/ipa/ipu3/ipu3.cpp | 44 +++++++++++++------------------------------\n>>   1 file changed, 13 insertions(+), 31 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 2fab4ee0..33fcf59b 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -196,12 +196,14 @@ private:\n>>   void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>>   {\n>>          const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n>> -       int32_t minExposure = v4l2Exposure.min().get<int32_t>();\n>> -       int32_t maxExposure = v4l2Exposure.max().get<int32_t>();\n>> +       minExposure_ = v4l2Exposure.min().get<int32_t>();\n>> +       maxExposure_ = v4l2Exposure.max().get<int32_t>();\n>> +       exposure_ = minExposure_;\n> Are the class members used elsewhere at all? (I.e. exposure_ etc?) or\n> could they be removed leaving the state stored only in\n> context_.configuration?\n\n\nThe class members dealing with min/max (i.e. static values) could be \nbrought under there, yes. I don't think the class members exposure_ and \ngain_ can be brought under the umbrella of IPASessionConfiguration since \nthey reflect the latest values computed by IPA\n\n>\n> I don't think it's in yet, but I'm sure one of JM's patches adds state\n> to a IPASessionConfiguration.sensor structure to keep sensor specfic\n> state tied together in the context.\n\n\nyes, I see [PATCH v4 3/4] ipa: ipu3: agc: Introduce lineDuration in \nIPASessionConfiguration\n\nWe can have min/max exposure/gain under them I think\n\n>\n> These properties might really belong in there.\n>\n>>          const ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\n>> -       int32_t minGain = v4l2Gain.min().get<int32_t>();\n>> -       int32_t maxGain = v4l2Gain.max().get<int32_t>();\n>> +       minGain_ = v4l2Gain.min().get<int32_t>();\n>> +       maxGain_ = v4l2Gain.max().get<int32_t>();\n>> +       gain_ = minGain_;\n>>   \n>>          /*\n>>           * When the AGC computes the new exposure values for a frame, it needs\n>> @@ -210,10 +212,10 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>>           *\n>>           * \\todo take VBLANK into account for maximum shutter speed\n>>           */\n>> -       context_.configuration.agc.minShutterSpeed = minExposure * lineDuration_;\n>> -       context_.configuration.agc.maxShutterSpeed = maxExposure * lineDuration_;\n>> -       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n>> -       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n>> +       context_.configuration.agc.minShutterSpeed = minExposure_ * lineDuration_;\n>> +       context_.configuration.agc.maxShutterSpeed = maxExposure_ * lineDuration_;\n>> +       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n>> +       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n>>   }\n>>   \n>>   /**\n>> @@ -430,32 +432,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>>           */\n>>          ctrls_ = configInfo.sensorControls;\n>>   \n>> -       const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\n>> -       if (itExp == ctrls_.end()) {\n>> -               LOG(IPAIPU3, Error) << \"Can't find exposure control\";\n>> -               return -EINVAL;\n>> -       }\n>> -\n>> -       const auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\n>> -       if (itGain == ctrls_.end()) {\n>> -               LOG(IPAIPU3, Error) << \"Can't find gain control\";\n>> -               return -EINVAL;\n>> -       }\n>> -\n>>          const auto itVBlank = ctrls_.find(V4L2_CID_VBLANK);\n>>          if (itVBlank == ctrls_.end()) {\n>>                  LOG(IPAIPU3, Error) << \"Can't find VBLANK control\";\n>>                  return -EINVAL;\n>>          }\n>>   \n>> -       minExposure_ = itExp->second.min().get<int32_t>();\n>> -       maxExposure_ = itExp->second.max().get<int32_t>();\n>> -       exposure_ = minExposure_;\n>> -\n>> -       minGain_ = itGain->second.min().get<int32_t>();\n>> -       maxGain_ = itGain->second.max().get<int32_t>();\n>> -       gain_ = minGain_;\n>> -\n>>          defVBlank_ = itVBlank->second.def().get<int32_t>();\n>>   \n>>          /* Clean context at configuration */\n>> @@ -465,12 +447,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>>   \n>>          lineDuration_ = sensorInfo_.lineLength * 1.0s / sensorInfo_.pixelRate;\n>>   \n>> -       /* Update the camera controls using the new sensor settings. */\n>> -       updateControls(sensorInfo_, ctrls_, ipaControls);\n>> -\n>>          /* Update the IPASessionConfiguration using the sensor settings. */\n>>          updateSessionConfiguration(ctrls_);\n>>   \n>> +       /* Update the camera controls using the new sensor settings. */\n>> +       updateControls(sensorInfo_, ctrls_, ipaControls);\n>> +\n>>          for (auto const &algo : algorithms_) {\n>>                  int ret = algo->configure(context_, configInfo);\n>>                  if (ret)\n>> -- \n>> 2.31.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 12409BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Feb 2022 13:52:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2DDD461166;\n\tMon, 28 Feb 2022 14:52:27 +0100 (CET)","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 703C861101\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Feb 2022 14:52:25 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.77])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 30EC2478;\n\tMon, 28 Feb 2022 14:52:23 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Uh4gSvy3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1646056345;\n\tbh=y7V8R9meI3ARlm+vc0sRTgc1n9Lk+XxH8i2aN0UoTzs=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Uh4gSvy3HH4dV18uOvrCGy++4431KBwzoJgQq6+JPx5kcwyEP3VweKnLPNrV0tLBq\n\tkgAA6WU0W4+6VpIsfuHCbGPQyMRu6dW5m/zbYWOSUkYwMIZbS05dVApMLmC85eyX/N\n\tJfHnifB3YMyGQUbYJbBrh4aSLhnHLV0AKNAuWS/U=","Message-ID":"<e685a88c-c6dc-0588-ab16-d1f97ca14875@ideasonboard.com>","Date":"Mon, 28 Feb 2022 19:22:19 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220228132250.116211-1-umang.jain@ideasonboard.com>\n\t<20220228132250.116211-3-umang.jain@ideasonboard.com>\n\t<164605518607.2091767.14461866903118975305@Monstersaurus>","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<164605518607.2091767.14461866903118975305@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","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":22206,"web_url":"https://patchwork.libcamera.org/comment/22206/","msgid":"<0a0a2f9a-5a1c-e328-568c-7e2c692df363@ideasonboard.com>","date":"2022-03-01T07:53:28","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran,\n\nOn 2/28/22 19:03, Kieran Bingham wrote:\n> Hi Umang,\n>\n> Quoting Umang Jain (2022-02-28 13:22:50)\n>> The exposure and gain limits are queried as part of\n>> IPAIPU3::configure(). Consolidate it.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   src/ipa/ipu3/ipu3.cpp | 44 +++++++++++++------------------------------\n>>   1 file changed, 13 insertions(+), 31 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 2fab4ee0..33fcf59b 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -196,12 +196,14 @@ private:\n>>   void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>>   {\n>>          const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n>> -       int32_t minExposure = v4l2Exposure.min().get<int32_t>();\n>> -       int32_t maxExposure = v4l2Exposure.max().get<int32_t>();\n>> +       minExposure_ = v4l2Exposure.min().get<int32_t>();\n>> +       maxExposure_ = v4l2Exposure.max().get<int32_t>();\n>> +       exposure_ = minExposure_;\n> Are the class members used elsewhere at all? (I.e. exposure_ etc?) or\n> could they be removed leaving the state stored only in\n> context_.configuration?\n\n\nRe-looking the patch now, and discussion from yesterday, I guess we can \ndrop these maximums and minimums members from IPAIPU3. And no, I don't \nthink we should add them to context_.configuration.sensor (yet) because \nI don't see max/min used anywhere else. I'll prep a follow-up patch\n\n>\n> I don't think it's in yet, but I'm sure one of JM's patches adds state\n> to a IPASessionConfiguration.sensor structure to keep sensor specfic\n> state tied together in the context.\n>\n> These properties might really belong in there.\n>\n>>          const ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\n>> -       int32_t minGain = v4l2Gain.min().get<int32_t>();\n>> -       int32_t maxGain = v4l2Gain.max().get<int32_t>();\n>> +       minGain_ = v4l2Gain.min().get<int32_t>();\n>> +       maxGain_ = v4l2Gain.max().get<int32_t>();\n>> +       gain_ = minGain_;\n>>   \n>>          /*\n>>           * When the AGC computes the new exposure values for a frame, it needs\n>> @@ -210,10 +212,10 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n>>           *\n>>           * \\todo take VBLANK into account for maximum shutter speed\n>>           */\n>> -       context_.configuration.agc.minShutterSpeed = minExposure * lineDuration_;\n>> -       context_.configuration.agc.maxShutterSpeed = maxExposure * lineDuration_;\n>> -       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n>> -       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n>> +       context_.configuration.agc.minShutterSpeed = minExposure_ * lineDuration_;\n>> +       context_.configuration.agc.maxShutterSpeed = maxExposure_ * lineDuration_;\n>> +       context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n>> +       context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n>>   }\n>>   \n>>   /**\n>> @@ -430,32 +432,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>>           */\n>>          ctrls_ = configInfo.sensorControls;\n>>   \n>> -       const auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\n>> -       if (itExp == ctrls_.end()) {\n>> -               LOG(IPAIPU3, Error) << \"Can't find exposure control\";\n>> -               return -EINVAL;\n>> -       }\n>> -\n>> -       const auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\n>> -       if (itGain == ctrls_.end()) {\n>> -               LOG(IPAIPU3, Error) << \"Can't find gain control\";\n>> -               return -EINVAL;\n>> -       }\n>> -\n>>          const auto itVBlank = ctrls_.find(V4L2_CID_VBLANK);\n>>          if (itVBlank == ctrls_.end()) {\n>>                  LOG(IPAIPU3, Error) << \"Can't find VBLANK control\";\n>>                  return -EINVAL;\n>>          }\n>>   \n>> -       minExposure_ = itExp->second.min().get<int32_t>();\n>> -       maxExposure_ = itExp->second.max().get<int32_t>();\n>> -       exposure_ = minExposure_;\n>> -\n>> -       minGain_ = itGain->second.min().get<int32_t>();\n>> -       maxGain_ = itGain->second.max().get<int32_t>();\n>> -       gain_ = minGain_;\n>> -\n>>          defVBlank_ = itVBlank->second.def().get<int32_t>();\n>>   \n>>          /* Clean context at configuration */\n>> @@ -465,12 +447,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n>>   \n>>          lineDuration_ = sensorInfo_.lineLength * 1.0s / sensorInfo_.pixelRate;\n>>   \n>> -       /* Update the camera controls using the new sensor settings. */\n>> -       updateControls(sensorInfo_, ctrls_, ipaControls);\n>> -\n>>          /* Update the IPASessionConfiguration using the sensor settings. */\n>>          updateSessionConfiguration(ctrls_);\n>>   \n>> +       /* Update the camera controls using the new sensor settings. */\n>> +       updateControls(sensorInfo_, ctrls_, ipaControls);\n>> +\n>>          for (auto const &algo : algorithms_) {\n>>                  int ret = algo->configure(context_, configInfo);\n>>                  if (ret)\n>> -- \n>> 2.31.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 420E6BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Mar 2022 07:53:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7666A604ED;\n\tTue,  1 Mar 2022 08:53:38 +0100 (CET)","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 BD21A604ED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Mar 2022 08:53:36 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.77])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7380C478;\n\tTue,  1 Mar 2022 08:53:35 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LqtuG4AG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1646121216;\n\tbh=aC6w00TtZe1Ray/+KBNS3L92CWUfcp7tGs7HIprnpNU=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=LqtuG4AGkMfO1P4NWUpxNUC9tY/RaD1N/AoQ+caM5ezF9Y2E2HmoKBmZE4SQBkrXS\n\tYm08WrRL3DRNEhDeQ8dAD2c0hxybNHTTYv7Ms0UXfK5FpDWmTqGyQRRaLSzRSudU8J\n\tledNunf4ymDjzIQut+4LRYcUi5LTgT7Vuk7yHfpI=","Message-ID":"<0a0a2f9a-5a1c-e328-568c-7e2c692df363@ideasonboard.com>","Date":"Tue, 1 Mar 2022 13:23:28 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220228132250.116211-1-umang.jain@ideasonboard.com>\n\t<20220228132250.116211-3-umang.jain@ideasonboard.com>\n\t<164605518607.2091767.14461866903118975305@Monstersaurus>","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<164605518607.2091767.14461866903118975305@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","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>"}}]