[{"id":20515,"web_url":"https://patchwork.libcamera.org/comment/20515/","msgid":"<3d867f91-fed4-96f8-65ec-b15096bc6a12@ideasonboard.com>","date":"2021-10-26T08:52:30","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi JM,\n\nOn 10/26/21 1:51 PM, Jean-Michel Hautbois wrote:\n> In case the maximum exposure received from the sensor is very high, we\n> can have a very high shutter speed with a small analogue gain, and it\n> may result in very slow framerate. We are not really supporting it for\n> the moment, so clamp the shutter speed to an arbitrary value of 60ms.\n>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\n\nTested on nautilus and most of the CTS regressions were fixed (which \nwere https://i.imgur.com/vv9Sjyh.png)\n\nTested-by: Umang Jain <umang.jain@ideasonboard.com>\n\nI'll be trying to run low-light situations too, will keep you updated on \nthe results.\n\n> ---\n>   src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n>   1 file changed, 5 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 6c151232..5927b5d3 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;\n>   static constexpr double kMinAnalogueGain = 1.0;\n>   static constexpr double kMaxAnalogueGain = 8.0;\n>   \n> +/* Maximum shutter speed allowed */\n> +static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n> +\n>   /* Histogram constants */\n>   static constexpr uint32_t knumHistogramBins = 256;\n>   static constexpr double kEvGainTarget = 0.5;\n> @@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n>   \n>   \t/* \\todo replace the exposure in lines storage with time based ones. */\n>   \tminExposureLines_ = context.configuration.agc.minShutterSpeed / lineDuration_;\n> -\tmaxExposureLines_ = context.configuration.agc.maxShutterSpeed / lineDuration_;\n> +\tmaxExposureLines_ = std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,\n> +\t\t\t\t     kMaxShutterSpeed / lineDuration_);\n>   \n>   \tminAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n>   \tmaxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);","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 7A652BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 08:52:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D989E64874;\n\tTue, 26 Oct 2021 10:52:36 +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 5FE0860123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 10:52:35 +0200 (CEST)","from [192.168.1.106] (unknown [103.251.226.211])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A058292;\n\tTue, 26 Oct 2021 10:52:34 +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=\"NAbQodDs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635238355;\n\tbh=+uewb+lSAe21hauoZkOH5AcFoUEsGEGZdAu8OmF1syw=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=NAbQodDsUUpF7sHG9NPPbULsH43V8vuS5BmGudwQic3j71cy3mFhtCgTsGRI5FlXM\n\tD1zYm0G2KSBCzX8CzKJKZ4SKlw89yZOqxXtmhDKeq0g90dFeLQ88ftdvdFIc8z62A/\n\t2VE+gxUZNkNHvuESTecou2RpMc/pob1/kVzmYdYE=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<3d867f91-fed4-96f8-65ec-b15096bc6a12@ideasonboard.com>","Date":"Tue, 26 Oct 2021 14:22:30 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","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":20516,"web_url":"https://patchwork.libcamera.org/comment/20516/","msgid":"<01bfeddd-e573-2657-e706-662b5ff46443@ideasonboard.com>","date":"2021-10-26T08:54:16","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"On 26/10/2021 10:52, Umang Jain wrote:\n> Hi JM,\n> \n> On 10/26/21 1:51 PM, Jean-Michel Hautbois wrote:\n>> In case the maximum exposure received from the sensor is very high, we\n>> can have a very high shutter speed with a small analogue gain, and it\n>> may result in very slow framerate. We are not really supporting it for\n>> the moment, so clamp the shutter speed to an arbitrary value of 60ms.\n>>\n>> Signed-off-by: Jean-Michel Hautbois \n>> <jeanmichel.hautbois@ideasonboard.com>\n> \n> \n> Tested on nautilus and most of the CTS regressions were fixed (which \n> were https://i.imgur.com/vv9Sjyh.png)\n\nIs \"most\" meaning \"all the ones introduced by this new series\" or is \nthere still new ones ?\n\n> \n> Tested-by: Umang Jain <umang.jain@ideasonboard.com>\n> \n> I'll be trying to run low-light situations too, will keep you updated on \n> the results.\n> \n>> ---\n>>   src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n>>   1 file changed, 5 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/agc.cpp \n>> b/src/ipa/ipu3/algorithms/agc.cpp\n>> index 6c151232..5927b5d3 100644\n>> --- a/src/ipa/ipu3/algorithms/agc.cpp\n>> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n>> @@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;\n>>   static constexpr double kMinAnalogueGain = 1.0;\n>>   static constexpr double kMaxAnalogueGain = 8.0;\n>> +/* Maximum shutter speed allowed */\n>> +static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n>> +\n>>   /* Histogram constants */\n>>   static constexpr uint32_t knumHistogramBins = 256;\n>>   static constexpr double kEvGainTarget = 0.5;\n>> @@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const \n>> IPAConfigInfo &configInfo)\n>>       /* \\todo replace the exposure in lines storage with time based \n>> ones. */\n>>       minExposureLines_ = context.configuration.agc.minShutterSpeed / \n>> lineDuration_;\n>> -    maxExposureLines_ = context.configuration.agc.maxShutterSpeed / \n>> lineDuration_;\n>> +    maxExposureLines_ = \n>> std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,\n>> +                     kMaxShutterSpeed / lineDuration_);\n>>       minAnalogueGain_ = \n>> std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n>>       maxAnalogueGain_ = \n>> std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);","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 CAE4EBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 08:54:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61BC264878;\n\tTue, 26 Oct 2021 10:54:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C04D60123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 10:54:19 +0200 (CEST)","from [IPV6:2a01:e0a:169:7140:dce3:eb54:18d7:6f3d] (unknown\n\t[IPv6:2a01:e0a:169:7140:dce3:eb54:18d7:6f3d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CFA31292;\n\tTue, 26 Oct 2021 10:54:18 +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=\"ghRCVdH1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635238458;\n\tbh=WjuxTii+qtQiKgpIrGoE1KIjU/m3blRuD7L+4i/U98w=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=ghRCVdH1unZzgycN5YGhnBJQFX63+r0eziNjBDvnCVYajDjAUA1zrqp5K6bB+ycXT\n\tyGmsQdn2jBjS9YcOG778afr9ElZ+oABUmnwCW/zcz6UA99R+urgE05sKreBuusTlep\n\t3RnlN0lJgMOmIHa3JGEd3suZvNUwbL56HHZxCcMI=","Message-ID":"<01bfeddd-e573-2657-e706-662b5ff46443@ideasonboard.com>","Date":"Tue, 26 Oct 2021 10:54:16 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.1.2","Content-Language":"en-US","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>\n\t<3d867f91-fed4-96f8-65ec-b15096bc6a12@ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","In-Reply-To":"<3d867f91-fed4-96f8-65ec-b15096bc6a12@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","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":20517,"web_url":"https://patchwork.libcamera.org/comment/20517/","msgid":"<ba1064d0-b5db-d7a6-7a7b-a2c8b1a3922d@ideasonboard.com>","date":"2021-10-26T08:58:04","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi JM,\n\nOn 10/26/21 2:24 PM, Jean-Michel Hautbois wrote:\n>\n>\n> On 26/10/2021 10:52, Umang Jain wrote:\n>> Hi JM,\n>>\n>> On 10/26/21 1:51 PM, Jean-Michel Hautbois wrote:\n>>> In case the maximum exposure received from the sensor is very high, we\n>>> can have a very high shutter speed with a small analogue gain, and it\n>>> may result in very slow framerate. We are not really supporting it for\n>>> the moment, so clamp the shutter speed to an arbitrary value of 60ms.\n>>>\n>>> Signed-off-by: Jean-Michel Hautbois \n>>> <jeanmichel.hautbois@ideasonboard.com>\n>>\n>>\n>> Tested on nautilus and most of the CTS regressions were fixed (which \n>> were https://i.imgur.com/vv9Sjyh.png)\n>\n> Is \"most\" meaning \"all the ones introduced by this new series\" or is \n> there still new ones ?\n\n\nSorry, I mean the latter. All the regressions I saw with AGC fix \nseries(merged), were fixed by this patch.\n\n>\n>>\n>> Tested-by: Umang Jain <umang.jain@ideasonboard.com>\n>>\n>> I'll be trying to run low-light situations too, will keep you updated \n>> on the results.\n>>\n>>> ---\n>>>   src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n>>>   1 file changed, 5 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/src/ipa/ipu3/algorithms/agc.cpp \n>>> b/src/ipa/ipu3/algorithms/agc.cpp\n>>> index 6c151232..5927b5d3 100644\n>>> --- a/src/ipa/ipu3/algorithms/agc.cpp\n>>> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n>>> @@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;\n>>>   static constexpr double kMinAnalogueGain = 1.0;\n>>>   static constexpr double kMaxAnalogueGain = 8.0;\n>>> +/* Maximum shutter speed allowed */\n>>> +static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n>>> +\n>>>   /* Histogram constants */\n>>>   static constexpr uint32_t knumHistogramBins = 256;\n>>>   static constexpr double kEvGainTarget = 0.5;\n>>> @@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const \n>>> IPAConfigInfo &configInfo)\n>>>       /* \\todo replace the exposure in lines storage with time based \n>>> ones. */\n>>>       minExposureLines_ = context.configuration.agc.minShutterSpeed \n>>> / lineDuration_;\n>>> -    maxExposureLines_ = context.configuration.agc.maxShutterSpeed / \n>>> lineDuration_;\n>>> +    maxExposureLines_ = \n>>> std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,\n>>> +                     kMaxShutterSpeed / lineDuration_);\n>>>       minAnalogueGain_ = \n>>> std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n>>>       maxAnalogueGain_ = \n>>> std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);","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 00C2BBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 08:58:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4DE2264878;\n\tTue, 26 Oct 2021 10:58:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F41C60123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 10:58:08 +0200 (CEST)","from [192.168.1.106] (unknown [103.251.226.211])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DB855292;\n\tTue, 26 Oct 2021 10:58:07 +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=\"gS2rcWSI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635238688;\n\tbh=vd4S6gh02toEIH69ns7kptE/Q8nc3s1jeyvYiqBqkZ4=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=gS2rcWSInAdnCNIwBKIho8RtURbcipuU/g6qTH+0Q/rn1/DSOqrD3WlXT3OHckak+\n\tqKBQCrvhVJzHoN6cZerMzV5H1vscsOtVhQU8Fl8AwW6HF2ncjBi2JjBvBDmQs7tlKL\n\thZwCn50AmLleU14qI7c1Xpj3hbIYABm9Jilg9nZA=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>\n\t<3d867f91-fed4-96f8-65ec-b15096bc6a12@ideasonboard.com>\n\t<01bfeddd-e573-2657-e706-662b5ff46443@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<ba1064d0-b5db-d7a6-7a7b-a2c8b1a3922d@ideasonboard.com>","Date":"Tue, 26 Oct 2021 14:28:04 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<01bfeddd-e573-2657-e706-662b5ff46443@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"8bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","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":20524,"web_url":"https://patchwork.libcamera.org/comment/20524/","msgid":"<YXfItS7ueFEIbZwH@pendragon.ideasonboard.com>","date":"2021-10-26T09:21:57","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Tue, Oct 26, 2021 at 10:21:42AM +0200, Jean-Michel Hautbois wrote:\n> In case the maximum exposure received from the sensor is very high, we\n> can have a very high shutter speed with a small analogue gain, and it\n> may result in very slow framerate. We are not really supporting it for\n> the moment, so clamp the shutter speed to an arbitrary value of 60ms.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 6c151232..5927b5d3 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;\n>  static constexpr double kMinAnalogueGain = 1.0;\n>  static constexpr double kMaxAnalogueGain = 8.0;\n>  \n> +/* Maximum shutter speed allowed */\n\n/* \\todo Honour the FrameDurationLimits control instead of hardcoding a limit */\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n> +\n>  /* Histogram constants */\n>  static constexpr uint32_t knumHistogramBins = 256;\n>  static constexpr double kEvGainTarget = 0.5;\n> @@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n>  \n>  \t/* \\todo replace the exposure in lines storage with time based ones. */\n>  \tminExposureLines_ = context.configuration.agc.minShutterSpeed / lineDuration_;\n> -\tmaxExposureLines_ = context.configuration.agc.maxShutterSpeed / lineDuration_;\n> +\tmaxExposureLines_ = std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,\n> +\t\t\t\t     kMaxShutterSpeed / lineDuration_);\n>  \n>  \tminAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n>  \tmaxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);","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 F259FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 09:22:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6236A64878;\n\tTue, 26 Oct 2021 11:22:21 +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 375C660123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 11:22:20 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 961053F0;\n\tTue, 26 Oct 2021 11:22:19 +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=\"kV3DJWtU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635240139;\n\tbh=xPUusTKF6cdqwtP3IRlqN493RbuhxrOuWwt3Z2UpRh0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kV3DJWtUBTswq81r5NEizxHxAPRPmLhTVorc/Eiv+Y813dOVXIuN4NBvSVia3MFRm\n\t5gomouttz4fWDgjEeU6mKE17Y+sg1yKiq2kOKWXSrg4Sw6NpM9eaaIE5jsX5fpf23F\n\tgjp0xtjWC4y+cx69f5oxarlAXVfF6HmhmCdyl4x0=","Date":"Tue, 26 Oct 2021 12:21:57 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YXfItS7ueFEIbZwH@pendragon.ideasonboard.com>","References":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20543,"web_url":"https://patchwork.libcamera.org/comment/20543/","msgid":"<163524520438.1184428.10372955328849874932@Monstersaurus>","date":"2021-10-26T10:46:44","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-10-26 10:21:57)\n> Hi Jean-Michel,\n> \n> Thank you for the patch.\n> \n> On Tue, Oct 26, 2021 at 10:21:42AM +0200, Jean-Michel Hautbois wrote:\n> > In case the maximum exposure received from the sensor is very high, we\n> > can have a very high shutter speed with a small analogue gain, and it\n> > may result in very slow framerate. We are not really supporting it for\n> > the moment, so clamp the shutter speed to an arbitrary value of 60ms.\n> > \n> > Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> > ---\n> >  src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n> >  1 file changed, 5 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> > index 6c151232..5927b5d3 100644\n> > --- a/src/ipa/ipu3/algorithms/agc.cpp\n> > +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> > @@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;\n> >  static constexpr double kMinAnalogueGain = 1.0;\n> >  static constexpr double kMaxAnalogueGain = 8.0;\n> >  \n> > +/* Maximum shutter speed allowed */\n> \n> /* \\todo Honour the FrameDurationLimits control instead of hardcoding a limit */\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> > +static constexpr utils::Duration kMaxShutterSpeed = 60ms;\n> > +\n> >  /* Histogram constants */\n> >  static constexpr uint32_t knumHistogramBins = 256;\n> >  static constexpr double kEvGainTarget = 0.5;\n> > @@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n> >  \n> >       /* \\todo replace the exposure in lines storage with time based ones. */\n> >       minExposureLines_ = context.configuration.agc.minShutterSpeed / lineDuration_;\n> > -     maxExposureLines_ = context.configuration.agc.maxShutterSpeed / lineDuration_;\n> > +     maxExposureLines_ = std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,\n> > +                                  kMaxShutterSpeed / lineDuration_);\n> >  \n> >       minAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);\n> >       maxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 8D493BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 10:46:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A77560237;\n\tTue, 26 Oct 2021 12:46:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2C6960123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 12:46:47 +0200 (CEST)","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 64C463F0;\n\tTue, 26 Oct 2021 12:46:47 +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=\"rHRSoDJ1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635245207;\n\tbh=MuOyXA7K+LpxVWfokw8bvzkrQ3LXT1B7bHR8f2FT89I=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=rHRSoDJ1UVbAIFfU3eKZsFZnEWjpyUrCW9zhw2ecoJCLZFxaRQAlygofkpSZafTl4\n\tvmnPF7SXRv1Ww47UDM9s4s8Tl1qcbZoZYs/aF6QUnYk3FA6mp3vt5c5sFg+XmTfiEM\n\tooZpU4MUt38Gi4bty63rr4Pfn5NBbO+9H8zDW6lU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YXfItS7ueFEIbZwH@pendragon.ideasonboard.com>","References":"<20211026082142.69023-1-jeanmichel.hautbois@ideasonboard.com>\n\t<YXfItS7ueFEIbZwH@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Tue, 26 Oct 2021 11:46:44 +0100","Message-ID":"<163524520438.1184428.10372955328849874932@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: agc: Clamp shutter speed","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]