{"id":14353,"url":"https://patchwork.libcamera.org/api/1.1/patches/14353/?format=json","web_url":"https://patchwork.libcamera.org/patch/14353/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211026112750.113641-1-jeanmichel.hautbois@ideasonboard.com>","date":"2021-10-26T11:27:50","name":"[libcamera-devel,v2] ipa: ipu3: agc: Clamp shutter speed","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"36f24d07557482f1b7e2abfef60ca290a66ea3c6","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14353/mbox/","series":[{"id":2659,"url":"https://patchwork.libcamera.org/api/1.1/series/2659/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2659","date":"2021-10-26T11:27:50","name":"[libcamera-devel,v2] ipa: ipu3: agc: Clamp shutter speed","version":2,"mbox":"https://patchwork.libcamera.org/series/2659/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14353/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14353/checks/","tags":{},"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 CB4A9BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Oct 2021 11:27:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4685560237;\n\tTue, 26 Oct 2021 13:27:56 +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 E6F6B60123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Oct 2021 13:27:54 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:dce3:eb54:18d7:6f3d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 80C023F0;\n\tTue, 26 Oct 2021 13:27:54 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Z3Vyi0aS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635247674;\n\tbh=2zWWA1QKuyRlkxS6tA4JR9KKrtQUqn66ffo+Sou2ARg=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=Z3Vyi0aS4wA5h/FnQPAPHiUvXAEljq1I7EZHJw39eQff7eXXY6EJUhjjAnwDcdZ3c\n\tyzWhcuj/IGTJ8NRWXgEUP8rbdPekmkEzYFwCmTCLOpLbr9OrkcNg+27poJcWbI2s+S\n\tdKFM7e8rU+LCWgSjLsuWPcENSBHRVyxYqwClbXVY=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 26 Oct 2021 13:27:50 +0200","Message-Id":"<20211026112750.113641-1-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] 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>"},"content":"In case the maximum exposure received from the sensor is very high, we\ncan have a very high shutter speed with a small analogue gain, and it\nmay result in very slow framerate. We are not really supporting it for\nthe moment, so clamp the shutter speed to an arbitrary value of 60ms.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nTested-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nv2:\n- Reword the todo according to Laurent's comment\n---\n src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex 6c151232..6b4ba4bf 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+/* \\todo Honour the FrameDurationLimits control instead of hardcoding a limit */\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);\n","prefixes":["libcamera-devel","v2"]}