[{"id":29980,"web_url":"https://patchwork.libcamera.org/comment/29980/","msgid":"<171861666862.2248009.2693360984380412489@ping.linuxembedded.co.uk>","date":"2024-06-17T09:31:08","subject":"Re: [PATCH 10/12] ipa: rkisp1: agc: Rename maxShutterSpeed to\n\tmaxFrameDuration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-06-16 17:39:08)\n> The AGC active state and frame context both contain a variable named\n> maxShutterSpeed. The variable is used to limit the maximum shutter speed\n> when computing the exposure time and gains, but stores the maximum frame\n> duration, not clamped by the sensor's maximum shutter speed. Rename it\n> to maxFrameDuration.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 10 +++++-----\n>  src/ipa/rkisp1/ipa_context.cpp    |  4 ++--\n>  src/ipa/rkisp1/ipa_context.h      |  4 ++--\n>  3 files changed, 9 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 6a199b47c9ad..5b917557b887 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -182,7 +182,7 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n>          * except it's computed in the IPA and not here so we'd have to\n>          * recompute it.\n>          */\n> -       context.activeState.agc.maxShutterSpeed = context.configuration.sensor.maxShutterSpeed;\n> +       context.activeState.agc.maxFrameDuration = context.configuration.sensor.maxShutterSpeed;\n>  \n>         /*\n>          * Define the measurement window for AGC as a centered rectangle\n> @@ -269,11 +269,11 @@ void Agc::queueRequest(IPAContext &context,\n>  \n>         const auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n>         if (frameDurationLimits) {\n> -               utils::Duration maxShutterSpeed =\n> +               utils::Duration maxFrameDuration =\n>                         std::chrono::milliseconds((*frameDurationLimits).back());\n> -               agc.maxShutterSpeed = maxShutterSpeed;\n> +               agc.maxFrameDuration = maxFrameDuration;\n>         }\n> -       frameContext.agc.maxShutterSpeed = agc.maxShutterSpeed;\n> +       frameContext.agc.maxFrameDuration = agc.maxFrameDuration;\n>  }\n>  \n>  /**\n> @@ -421,7 +421,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>         expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\n>  \n>         utils::Duration maxShutterSpeed = std::min(context.configuration.sensor.maxShutterSpeed,\n> -                                                  frameContext.agc.maxShutterSpeed);\n> +                                                  frameContext.agc.maxFrameDuration);\n>         setLimits(context.configuration.sensor.minShutterSpeed,\n>                   maxShutterSpeed,\n>                   context.configuration.sensor.minAnalogueGain,\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 9e445dcca933..ab6cfae17feb 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -172,7 +172,7 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\var IPAActiveState::agc.meteringMode\n>   * \\brief Metering mode as set by the AeMeteringMode control\n>   *\n> - * \\var IPAActiveState::agc.maxShutterSpeed\n> + * \\var IPAActiveState::agc.maxFrameDuration\n>   * \\brief Maximum frame duration as set by the FrameDurationLimits control\n>   */\n>  \n> @@ -314,7 +314,7 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\var IPAFrameContext::agc.meteringMode\n>   * \\brief Metering mode as set by the AeMeteringMode control\n>   *\n> - * \\var IPAFrameContext::agc.maxShutterSpeed\n> + * \\var IPAFrameContext::agc.maxFrameDuration\n>   * \\brief Maximum frame duration as set by the FrameDurationLimits control\n>   *\n>   * \\var IPAFrameContext::agc.update\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index 6022480d4fd2..734856cdb199 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -72,7 +72,7 @@ struct IPAActiveState {\n>                 controls::AeConstraintModeEnum constraintMode;\n>                 controls::AeExposureModeEnum exposureMode;\n>                 controls::AeMeteringModeEnum meteringMode;\n> -               utils::Duration maxShutterSpeed;\n> +               utils::Duration maxFrameDuration;\n>         } agc;\n>  \n>         struct {\n> @@ -121,7 +121,7 @@ struct IPAFrameContext : public FrameContext {\n>                 controls::AeConstraintModeEnum constraintMode;\n>                 controls::AeExposureModeEnum exposureMode;\n>                 controls::AeMeteringModeEnum meteringMode;\n> -               utils::Duration maxShutterSpeed;\n> +               utils::Duration maxFrameDuration;\n>                 bool update;\n>         } agc;\n>  \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 69A70BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 09:31:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A61C265495;\n\tMon, 17 Jun 2024 11:31:12 +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 B19A261A1C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 11:31:11 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C96189C1;\n\tMon, 17 Jun 2024 11:30:54 +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=\"JkJQAOyi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718616654;\n\tbh=OO6lnTR0IJpS14y/hldBL5ko3pM/9odagoYh6sEvkzA=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=JkJQAOyih6R+H3s+E6LnOSrdLO6t//zgnFSh2uGhdYIEj/3Gb5f1mnB8Dk+0hWzKB\n\tOMXYV70gjYxikOONNeMh28jMPMk6LKiSg7Ory1kRcJQRcTtn8bR5CybYne9wttpJd+\n\t+B74hrzfjSJ6URnjUyB4U6uGjXdn88azY2FlD+po=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240616163910.5506-11-laurent.pinchart@ideasonboard.com>","References":"<20240616163910.5506-1-laurent.pinchart@ideasonboard.com>\n\t<20240616163910.5506-11-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 10/12] ipa: rkisp1: agc: Rename maxShutterSpeed to\n\tmaxFrameDuration","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 17 Jun 2024 10:31:08 +0100","Message-ID":"<171861666862.2248009.2693360984380412489@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":29994,"web_url":"https://patchwork.libcamera.org/comment/29994/","msgid":"<ZnAjm1elxhTZ-60i@pyrite.rasen.tech>","date":"2024-06-17T11:52:59","subject":"Re: [PATCH 10/12] ipa: rkisp1: agc: Rename maxShutterSpeed to\n\tmaxFrameDuration","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Sun, Jun 16, 2024 at 07:39:08PM +0300, Laurent Pinchart wrote:\n> The AGC active state and frame context both contain a variable named\n> maxShutterSpeed. The variable is used to limit the maximum shutter speed\n> when computing the exposure time and gains, but stores the maximum frame\n> duration, not clamped by the sensor's maximum shutter speed. Rename it\n> to maxFrameDuration.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 10 +++++-----\n>  src/ipa/rkisp1/ipa_context.cpp    |  4 ++--\n>  src/ipa/rkisp1/ipa_context.h      |  4 ++--\n>  3 files changed, 9 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 6a199b47c9ad..5b917557b887 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -182,7 +182,7 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n>  \t * except it's computed in the IPA and not here so we'd have to\n>  \t * recompute it.\n>  \t */\n> -\tcontext.activeState.agc.maxShutterSpeed = context.configuration.sensor.maxShutterSpeed;\n> +\tcontext.activeState.agc.maxFrameDuration = context.configuration.sensor.maxShutterSpeed;\n>  \n>  \t/*\n>  \t * Define the measurement window for AGC as a centered rectangle\n> @@ -269,11 +269,11 @@ void Agc::queueRequest(IPAContext &context,\n>  \n>  \tconst auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n>  \tif (frameDurationLimits) {\n> -\t\tutils::Duration maxShutterSpeed =\n> +\t\tutils::Duration maxFrameDuration =\n>  \t\t\tstd::chrono::milliseconds((*frameDurationLimits).back());\n> -\t\tagc.maxShutterSpeed = maxShutterSpeed;\n> +\t\tagc.maxFrameDuration = maxFrameDuration;\n>  \t}\n> -\tframeContext.agc.maxShutterSpeed = agc.maxShutterSpeed;\n> +\tframeContext.agc.maxFrameDuration = agc.maxFrameDuration;\n>  }\n>  \n>  /**\n> @@ -421,7 +421,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \texpMeans_ = { params->ae.exp_mean, context.hw->numAeCells };\n>  \n>  \tutils::Duration maxShutterSpeed = std::min(context.configuration.sensor.maxShutterSpeed,\n> -\t\t\t\t\t\t   frameContext.agc.maxShutterSpeed);\n> +\t\t\t\t\t\t   frameContext.agc.maxFrameDuration);\n>  \tsetLimits(context.configuration.sensor.minShutterSpeed,\n>  \t\t  maxShutterSpeed,\n>  \t\t  context.configuration.sensor.minAnalogueGain,\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 9e445dcca933..ab6cfae17feb 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -172,7 +172,7 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\var IPAActiveState::agc.meteringMode\n>   * \\brief Metering mode as set by the AeMeteringMode control\n>   *\n> - * \\var IPAActiveState::agc.maxShutterSpeed\n> + * \\var IPAActiveState::agc.maxFrameDuration\n>   * \\brief Maximum frame duration as set by the FrameDurationLimits control\n>   */\n>  \n> @@ -314,7 +314,7 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\var IPAFrameContext::agc.meteringMode\n>   * \\brief Metering mode as set by the AeMeteringMode control\n>   *\n> - * \\var IPAFrameContext::agc.maxShutterSpeed\n> + * \\var IPAFrameContext::agc.maxFrameDuration\n>   * \\brief Maximum frame duration as set by the FrameDurationLimits control\n>   *\n>   * \\var IPAFrameContext::agc.update\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index 6022480d4fd2..734856cdb199 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -72,7 +72,7 @@ struct IPAActiveState {\n>  \t\tcontrols::AeConstraintModeEnum constraintMode;\n>  \t\tcontrols::AeExposureModeEnum exposureMode;\n>  \t\tcontrols::AeMeteringModeEnum meteringMode;\n> -\t\tutils::Duration maxShutterSpeed;\n> +\t\tutils::Duration maxFrameDuration;\n>  \t} agc;\n>  \n>  \tstruct {\n> @@ -121,7 +121,7 @@ struct IPAFrameContext : public FrameContext {\n>  \t\tcontrols::AeConstraintModeEnum constraintMode;\n>  \t\tcontrols::AeExposureModeEnum exposureMode;\n>  \t\tcontrols::AeMeteringModeEnum meteringMode;\n> -\t\tutils::Duration maxShutterSpeed;\n> +\t\tutils::Duration maxFrameDuration;\n>  \t\tbool update;\n>  \t} agc;\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 57490BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 11:53:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F21816549B;\n\tMon, 17 Jun 2024 13:53:06 +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 E36C365491\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 13:53:05 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5066B39F;\n\tMon, 17 Jun 2024 13:52:48 +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=\"h93gmVo/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718625169;\n\tbh=ioJqbunHZZO7DSV0fq/kxeEZFSHcQmgMk8B02nw5Djo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=h93gmVo//5LOxAxzeVLELD0Tu6qVXFSfue2OFysB/LAmu1MOU2XTkms5zmJdQPetW\n\tOz7FVYcpukDvSl1XPOqAqfyDEqKF5H1XTyd2RUONRNGpPd21hcHhrEszTdw2OhmCSR\n\tlofH7/s6GhGQLHI8FpTLpEPuL2L6bkn6Ogcaw7tM=","Date":"Mon, 17 Jun 2024 20:52:59 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 10/12] ipa: rkisp1: agc: Rename maxShutterSpeed to\n\tmaxFrameDuration","Message-ID":"<ZnAjm1elxhTZ-60i@pyrite.rasen.tech>","References":"<20240616163910.5506-1-laurent.pinchart@ideasonboard.com>\n\t<20240616163910.5506-11-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240616163910.5506-11-laurent.pinchart@ideasonboard.com>","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>"}}]