[{"id":38126,"web_url":"https://patchwork.libcamera.org/comment/38126/","msgid":"<177039188540.607498.2136232235053485447@neptunite.rasen.tech>","date":"2026-02-06T15:31:25","subject":"Re: [PATCH v3 12/19] ipa: libipa: agc: Compute max shutter time with\n\tframe duration","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2025-11-14 23:17:07)\n> The maximum shutter time the AGC algorithm can achieve is, by definition,\n> limited by the maximum programmed frame duration.\n> \n> When configuring the AGC algorithm, use the frame duration to calculate\n> the maximum shutter time by using the CameraSensorHelper::maxShutterTime()\n> function, unless the IPA has asked for a fixed exposure by setting min ==\n\ns/exposure/frame duration/ ?\n\n> max.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++--\n>  1 file changed, 18 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp\n> index f771b10a28eead2976c0000cf099ba5cfbe78e0f..45f51f9088170c983bb0de2c18714627514c5641 100644\n> --- a/src/ipa/libipa/exposure_mode_helper.cpp\n> +++ b/src/ipa/libipa/exposure_mode_helper.cpp\n> @@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou\n>  void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig,\n>                                    const CameraSensorHelper *sensorHelper)\n>  {\n> +       ASSERT(sensorHelper);\n> +\n>         sensor_ = sensorConfig;\n>         sensorHelper_ = sensorHelper;\n>  \n>         /* Initialize run-time limits with sensor's default. */\n> -       minExposureTime_ = sensor_.minExposureTime_;\n> -       maxExposureTime_ = sensor_.maxExposureTime_;\n>         minGain_ = sensor_.minGain_;\n>         maxGain_ = sensor_.maxGain_;\n> +\n> +       minExposureTime_ = sensor_.minExposureTime_;\n> +\n> +       /*\n> +        * Compute the maximum shutter time.\n> +        *\n> +        * If maxExposureTime is equal to minExposureTime then we use them\n> +        * to fix the exposure time.\n> +        *\n> +        * Otherwise, if the exposure can range between a min and max delegate\n> +        * the maximum shutter time calculation to the sensor helper.\n> +        */\n> +       maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_\n> +                        ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_,\n> +                                                        sensorConfig.lineDuration_)\n> +                        : minExposureTime_;\n>  }\n>  \n>  /**\n> \n> -- \n> 2.51.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 E0D79C32E7\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Feb 2026 15:31:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FFA16209B;\n\tFri,  6 Feb 2026 16:31:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DD0926209B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Feb 2026 16:31:30 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:5247:7b72:2b7:10da])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D82472E0;\n\tFri,  6 Feb 2026 16:30:46 +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=\"PdnFC+6o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770391847;\n\tbh=CyaB7RDAik4xdEzBTOmCYQJLJU0QFWixxQDVczeMgZk=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=PdnFC+6o6F8qNqx1QABnG0EuMiU+IzqV8Au/mRGseFSw8A+7IPtQb4sHFp+czdiZX\n\tEjqyIL0/49rpWzFwKx9nM1EgNXsO3VDXGNgJb7CEwA2m83q2fcSsghSm2bAlYH1sA4\n\tJdplvssQpIcACf0RCOCuMs1EbynCIMmf0sKj9ZsM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com>","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>\n\t<20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com>","Subject":"Re: [PATCH v3 12/19] ipa: libipa: agc: Compute max shutter time with\n\tframe duration","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, Niklas =?utf-8?b?U8O2?=\n\t=?utf-8?q?derlund?= <niklas.soderlund@ragnatech.se>, Robert Mader\n\t<robert.mader@collabora.com>, libcamera-devel@lists.libcamera.org","Date":"Sat, 07 Feb 2026 00:31:25 +0900","Message-ID":"<177039188540.607498.2136232235053485447@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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":38131,"web_url":"https://patchwork.libcamera.org/comment/38131/","msgid":"<177039220647.607498.2480897708229257814@neptunite.rasen.tech>","date":"2026-02-06T15:36:46","subject":"Re: [PATCH v3 12/19] ipa: libipa: agc: Compute max shutter time with\n\tframe duration","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Paul Elder (2026-02-07 00:31:25)\n> Quoting Jacopo Mondi (2025-11-14 23:17:07)\n> > The maximum shutter time the AGC algorithm can achieve is, by definition,\n> > limited by the maximum programmed frame duration.\n> > \n> > When configuring the AGC algorithm, use the frame duration to calculate\n> > the maximum shutter time by using the CameraSensorHelper::maxShutterTime()\n> > function, unless the IPA has asked for a fixed exposure by setting min ==\n> \n> s/exposure/frame duration/ ?\n\noic it's from the IPA not the application, lgtm.\n\n\nPaul\n\n> \n> > max.\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> > ---\n> >  src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++--\n> >  1 file changed, 18 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp\n> > index f771b10a28eead2976c0000cf099ba5cfbe78e0f..45f51f9088170c983bb0de2c18714627514c5641 100644\n> > --- a/src/ipa/libipa/exposure_mode_helper.cpp\n> > +++ b/src/ipa/libipa/exposure_mode_helper.cpp\n> > @@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou\n> >  void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig,\n> >                                    const CameraSensorHelper *sensorHelper)\n> >  {\n> > +       ASSERT(sensorHelper);\n> > +\n> >         sensor_ = sensorConfig;\n> >         sensorHelper_ = sensorHelper;\n> >  \n> >         /* Initialize run-time limits with sensor's default. */\n> > -       minExposureTime_ = sensor_.minExposureTime_;\n> > -       maxExposureTime_ = sensor_.maxExposureTime_;\n> >         minGain_ = sensor_.minGain_;\n> >         maxGain_ = sensor_.maxGain_;\n> > +\n> > +       minExposureTime_ = sensor_.minExposureTime_;\n> > +\n> > +       /*\n> > +        * Compute the maximum shutter time.\n> > +        *\n> > +        * If maxExposureTime is equal to minExposureTime then we use them\n> > +        * to fix the exposure time.\n> > +        *\n> > +        * Otherwise, if the exposure can range between a min and max delegate\n> > +        * the maximum shutter time calculation to the sensor helper.\n> > +        */\n> > +       maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_\n> > +                        ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_,\n> > +                                                        sensorConfig.lineDuration_)\n> > +                        : minExposureTime_;\n> >  }\n> >  \n> >  /**\n> > \n> > -- \n> > 2.51.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 85AACBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Feb 2026 15:36:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 34B8E620BE;\n\tFri,  6 Feb 2026 16:36:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 15117620AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Feb 2026 16:36:52 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:5247:7b72:2b7:10da])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 092332E0;\n\tFri,  6 Feb 2026 16:36:07 +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=\"KQhj0+ET\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770392168;\n\tbh=P8e3FLLkJjlVofM44EMThcyJjKjKpN2k4ylR5IJZJjU=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=KQhj0+ETjv58E1pASwfQ/DR/o0fg64GNTWm3vpiic+/VAxR6PSUMxi7Y3uzp92ix0\n\tGCdJLSuwmzftSp1aUroR+AYfJHGlHXMvAKFBuU+WUS10brJDoI5hBMxjwBRjBqdcRW\n\tmzwYh5k57vZjZu29a1jSrE+nphKUZmOMrXI8JmaY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<177039188540.607498.2136232235053485447@neptunite.rasen.tech>","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>\n\t<20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com>\n\t<177039188540.607498.2136232235053485447@neptunite.rasen.tech>","Subject":"Re: [PATCH v3 12/19] ipa: libipa: agc: Compute max shutter time with\n\tframe duration","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, Niklas =?utf-8?b?U8O2?=\n\t=?utf-8?q?derlund?= <niklas.soderlund@ragnatech.se>, Robert Mader\n\t<robert.mader@collabora.com>, libcamera-devel@lists.libcamera.org","Date":"Sat, 07 Feb 2026 00:36:46 +0900","Message-ID":"<177039220647.607498.2480897708229257814@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>"}}]