{"id":25064,"url":"https://patchwork.libcamera.org/api/patches/25064/?format=json","web_url":"https://patchwork.libcamera.org/patch/25064/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com>","date":"2025-11-14T14:17:07","name":"[v3,12/19] ipa: libipa: agc: Compute max shutter time with frame duration","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"2269e75b03da327ecc13c8a9895b138ec9017450","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25064/mbox/","series":[{"id":5590,"url":"https://patchwork.libcamera.org/api/series/5590/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5590","date":"2025-11-14T14:16:55","name":"libipa: agc: Calculate exposure limits","version":3,"mbox":"https://patchwork.libcamera.org/series/5590/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25064/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25064/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 309A0C32DC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 14:17:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8CE8C60AB8;\n\tFri, 14 Nov 2025 15:17:37 +0100 (CET)","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 63E7F60AAD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 15:17:22 +0100 (CET)","from [192.168.1.101] (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 65CB01D1C;\n\tFri, 14 Nov 2025 15:15:21 +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=\"NQjgSpPb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763129721;\n\tbh=lQmnDDamLSikk20qIZdtHOhjYACIlSPUtQ790iq2k5Q=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=NQjgSpPb2X5Lx5LeIRm6kIQYOZEV2GnkWLHTIqZD4Dl2xAe/B8BHAIytT6fzzgbR3\n\teQcBiRBtKTew6OFxzLTuqqYHa6+N3Ffcc6xbzCUy39WbDe1Re539qInnIbWdXw/dNE\n\tjua0F/QruUyJ5Zfzo6Sz53NKjk4FUG3wcUS7IX4M=","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Date":"Fri, 14 Nov 2025 15:17:07 +0100","Subject":"[PATCH v3 12/19] ipa: libipa: agc: Compute max shutter time with\n\tframe duration","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com>","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>","In-Reply-To":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tRobert Mader <robert.mader@collabora.com>, \n\tlibcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=openpgp-sha256; l=1973;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=lQmnDDamLSikk20qIZdtHOhjYACIlSPUtQ790iq2k5Q=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpFznrRVYLC7tg859E8weKoLqE5vsMtFGC1IYrv\n\tbqDtqVvYamJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaRc56wAKCRByNAaPFqFW\n\tPK2aD/9MP47aDnjjwEUilItmYTvs3kvGKeaegtqoyzKDgcj27PBvVCVcd4MNE1OB3eaS0ERJzFw\n\tE0UyyW3Pwzei2+x05EE8pOF+//d5Jx9nbL4/j9hji6HHsVkxrOrWSbtoFxXjnXbjNAQlXHkoISm\n\t9FMH/T6t8PSz/c1/1mkjAbMbt6+HnXFVhNRDGpW7vX5d6VBMJutYPmwDSZNnL3lvC9SQVP68vGg\n\tmdsYexQyL4CHF9rNHFXw3ZVNxYoqnJ+e8eifU58mxzpms8Bp0uP+1LdDDvyJi5MjrCfMVhDzf8L\n\t9IOuCwLLvte2ITBj94Vq2ysqlZEpA0QQYIB3uxxdMl71Z4ixSnMDITfLbHR0cVlCQxiYjZZgqvJ\n\tGbjY3PGnHUvKCPKYXJubeK2W/DurPI2Hc0CxjjDf6WuGBL2FsefGFE4TKWQVewosQ46bk/c2qjz\n\tMKkvqPD6wQArvzX3CIoAI/eZPzlfYqs6iqXjjC5JG+3PDjugfGKz2TW1t47JCbLpSnflQUwHcd7\n\toKi1lxOTXhrpE+doC7Be6Gn9QcR8vvzPiadPU1fSgfJG24Iktw2vU/c4SWc/9CvuhEoLOP0DEcR\n\tNgVSQIwS/+s7qd+0TLk9vsPd1gmhhfpRUdLze/T6+zBXmB2HD+ezkujSR7CXGS0zGOk4oU64uk0\n\tup6oDNv55URlb1Q==","X-Developer-Key":"i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B","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":"The maximum shutter time the AGC algorithm can achieve is, by definition,\nlimited by the maximum programmed frame duration.\n\nWhen configuring the AGC algorithm, use the frame duration to calculate\nthe maximum shutter time by using the CameraSensorHelper::maxShutterTime()\nfunction, unless the IPA has asked for a fixed exposure by setting min ==\nmax.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++--\n 1 file changed, 18 insertions(+), 2 deletions(-)","diff":"diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp\nindex 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 \t\t\t\t   const CameraSensorHelper *sensorHelper)\n {\n+\tASSERT(sensorHelper);\n+\n \tsensor_ = sensorConfig;\n \tsensorHelper_ = sensorHelper;\n \n \t/* Initialize run-time limits with sensor's default. */\n-\tminExposureTime_ = sensor_.minExposureTime_;\n-\tmaxExposureTime_ = sensor_.maxExposureTime_;\n \tminGain_ = sensor_.minGain_;\n \tmaxGain_ = sensor_.maxGain_;\n+\n+\tminExposureTime_ = sensor_.minExposureTime_;\n+\n+\t/*\n+\t * Compute the maximum shutter time.\n+\t *\n+\t * If maxExposureTime is equal to minExposureTime then we use them\n+\t * to fix the exposure time.\n+\t *\n+\t * Otherwise, if the exposure can range between a min and max delegate\n+\t * the maximum shutter time calculation to the sensor helper.\n+\t */\n+\tmaxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_\n+\t\t\t ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_,\n+\t\t\t\t\t\t\t sensorConfig.lineDuration_)\n+\t\t\t : minExposureTime_;\n }\n \n /**\n","prefixes":["v3","12/19"]}