[{"id":27160,"web_url":"https://patchwork.libcamera.org/comment/27160/","msgid":"<20230529124722.GD15292@pendragon.ideasonboard.com>","date":"2023-05-29T12:47:22","subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: rkisp1: agc: Restore minimum\n\tanalogue gain limit","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Mon, May 29, 2023 at 02:39:26PM +0200, Jacopo Mondi via libcamera-devel wrote:\n> Commit a3178dd0391f (\"ipa: rkisp1: agc: drop hard-coded analogue gain range\")\n> removed both minimum and maximum limits for the analogue gain value.\n> \n> However, as some sensors can potentially have a minimum gain lower than\n> 1.0, restore the check for the minimum limit.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index a4e5500e72d6..e5aeb3426eff 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -36,6 +36,9 @@ namespace ipa::rkisp1::algorithms {\n> \n>  LOG_DEFINE_CATEGORY(RkISP1Agc)\n> \n> +/* Minimum limit for analogue gain value */\n> +static constexpr double kMinAnalogueGain = 1.0;\n> +\n>  /* \\todo Honour the FrameDurationLimits control instead of hardcoding a limit */\n>  static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n> \n> @@ -254,7 +257,8 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext,\n>  \tutils::Duration maxShutterSpeed = std::min(configuration.sensor.maxShutterSpeed,\n>  \t\t\t\t\t\t   kMaxShutterSpeed);\n> \n> -\tdouble minAnalogueGain = configuration.sensor.minAnalogueGain;\n> +\tdouble minAnalogueGain = std::max(configuration.sensor.minAnalogueGain,\n> +\t\t\t\t\t  kMinAnalogueGain);\n>  \tdouble maxAnalogueGain = configuration.sensor.maxAnalogueGain;\n> \n>  \t/* Consider within 1% of the target as correctly exposed. */","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 9F1B4C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 May 2023 12:47:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 132BB626F5;\n\tMon, 29 May 2023 14:47:24 +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 D1A566038E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 May 2023 14:47:21 +0200 (CEST)","from pendragon.ideasonboard.com (om126255106133.24.openmobile.ne.jp\n\t[126.255.106.133])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C5166D5;\n\tMon, 29 May 2023 14:47:00 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685364444;\n\tbh=i4JmIFiShyXZhQIuIM04bKl4fkjt7BgNBEh4WDiRQiI=;\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=lYyeZRxx35NR+jkxe1RtH/SnEuRKjyRm+CGmc/JGmNS7NqNWYeyOWQPEGW7FSP3CV\n\tqwSe/LrZ+tor1Hh0/bcd9cHjd1eH7mXN1ZUPmuKYwl05ay2cLusppLW7o7JdTL7gdG\n\tREytf7W/WXT0Hik/fcH2dPXf9lxwhWYoGajL7W9cNPLYJRsL88HSXeJDZQNoXmFtJO\n\tIhDCKyXkFNjIdWlv7lgfNcNME2ss5Gc1u6Hrao509+eKVrRosGLTPgMcOvH1Ibfn7H\n\t+TT4wV9+3zg1VPiEIX2sKIQxqV805bnTTZwAHg3QIbgLisEsv800UAxopOl3Zll5K1\n\tpB94+P/nseTOw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1685364421;\n\tbh=i4JmIFiShyXZhQIuIM04bKl4fkjt7BgNBEh4WDiRQiI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mKXLUVWIZgx9iNg+SJSs8fAweYIbHO/L3B68ACZ3yThKbZh5w84Jmz4qNH5pKaA0f\n\tpusDW0haAS6NGKgJJIBM3Ut+laUTvuARFD3R6Ud+3lpFvQvU+XXzdSXR0JEXyWjjIL\n\tpCfWEN7TZmmFRDGJk6wpYFxY4bkHmx6mfzkpr9QU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mKXLUVWI\"; dkim-atps=neutral","Date":"Mon, 29 May 2023 15:47:22 +0300","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Message-ID":"<20230529124722.GD15292@pendragon.ideasonboard.com>","References":"<20230529123926.74775-1-jacopo.mondi@ideasonboard.com>\n\t<20230529123926.74775-2-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230529123926.74775-2-jacopo.mondi@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] ipa: rkisp1: agc: Restore minimum\n\tanalogue gain limit","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tBenjamin Bara <benjamin.bara@skidata.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]