[{"id":39822,"web_url":"https://patchwork.libcamera.org/comment/39822/","msgid":"<3657695d-22f5-4ff2-8593-8b603e580df4@ideasonboard.com>","date":"2026-07-24T12:15:11","subject":"Re: [RFC PATCH v2 25/43] ipa: libipa: agc: Use default exposure","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 07. 23. 17:43 keltezéssel, Barnabás Pőcze írta:\n> Instead of hard-coding 10ms, just use the default exposure time\n> as determined by the V4L2 control. This ensures that the advertised\n> default in the `ControlInfo` matches what actually happens.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>   src/ipa/libipa/agc.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp\n> index edcbab1e0b..54c5c6c349 100644\n> --- a/src/ipa/libipa/agc.cpp\n> +++ b/src/ipa/libipa/agc.cpp\n> @@ -355,7 +355,7 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons\n>   \t/* Configure the default exposure and gain. */\n>   \tstate = {};\n>   \tstate.automatic.gain = session.minAnalogueGain;\n> -\tstate.automatic.exposure = clampExposure(10ms, session);\n> +\tstate.automatic.exposure = clampExposure(defExposure * session.lineDuration, session);\n>   \tstate.automatic.quantizationGain = 1;\n>   \tstate.automatic.yTarget = impl_.effectiveYTarget(0, 1);\n>   \tstate.manual.gain = state.automatic.gain;\n\nNote that I have just updated this change:\n\ndiff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp\nindex c0d690c802..876f11f5ad 100644\n--- a/src/ipa/libipa/agc.cpp\n+++ b/src/ipa/libipa/agc.cpp\n@@ -355,7 +355,7 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons\n         /* Configure the default exposure and gain. */\n         state = {};\n         state.automatic.gain = session.minAnalogueGain;\n-       state.automatic.exposure = clampExposure(10ms, session);\n+       state.automatic.exposure = defExposure;\n         state.automatic.quantizationGain = 1;\n         state.automatic.yTarget = impl_.effectiveYTarget(0, 1);\n         state.manual.gain = state.automatic.gain;","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 A9FDDBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jul 2026 12:15:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 11FAB67EFB;\n\tFri, 24 Jul 2026 14:15:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 857C067E89\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2026 14:15:15 +0200 (CEST)","from [192.168.33.42] (185.182.215.156.nat.pool.zt.hu\n\t[185.182.215.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DD9D3524\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2026 14:14:13 +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=\"KHmaB4fX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784895254;\n\tbh=E8I3cLdixRbPmist2ElwVPZttxUuhoHbB4MF2RPnBt8=;\n\th=Date:Subject:From:To:References:In-Reply-To:From;\n\tb=KHmaB4fXCDJ8RJiFoiVStgzyJt3Lha4WIKrJRCZiIg4uvy424O754FGbEnF7UKXg3\n\tFZgnv4mGfa88205cR2xYCkdAT+uNAW5rOHPjjrxcUn86vls8ghWm7l+qK5HIwU6ge3\n\t9CQpu765VRSbkOgA7wanUIdE8HAYxvIqTNfpJZYQ=","Message-ID":"<3657695d-22f5-4ff2-8593-8b603e580df4@ideasonboard.com>","Date":"Fri, 24 Jul 2026 14:15:11 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v2 25/43] ipa: libipa: agc: Use default exposure","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","References":"<20260723154327.1357866-1-barnabas.pocze@ideasonboard.com>\n\t<20260723154327.1357866-26-barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260723154327.1357866-26-barnabas.pocze@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":39876,"web_url":"https://patchwork.libcamera.org/comment/39876/","msgid":"<amdkRxGARNOjeM3t@zed>","date":"2026-07-27T14:00:57","subject":"Re: [RFC PATCH v2 25/43] ipa: libipa: agc: Use default exposure","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Fri, Jul 24, 2026 at 02:15:11PM +0200, Barnabás Pőcze wrote:\n> 2026. 07. 23. 17:43 keltezéssel, Barnabás Pőcze írta:\n> > Instead of hard-coding 10ms, just use the default exposure time\n> > as determined by the V4L2 control. This ensures that the advertised\n> > default in the `ControlInfo` matches what actually happens.\n> >\n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> >   src/ipa/libipa/agc.cpp | 2 +-\n> >   1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp\n> > index edcbab1e0b..54c5c6c349 100644\n> > --- a/src/ipa/libipa/agc.cpp\n> > +++ b/src/ipa/libipa/agc.cpp\n> > @@ -355,7 +355,7 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons\n> >   \t/* Configure the default exposure and gain. */\n> >   \tstate = {};\n> >   \tstate.automatic.gain = session.minAnalogueGain;\n> > -\tstate.automatic.exposure = clampExposure(10ms, session);\n> > +\tstate.automatic.exposure = clampExposure(defExposure * session.lineDuration, session);\n> >   \tstate.automatic.quantizationGain = 1;\n> >   \tstate.automatic.yTarget = impl_.effectiveYTarget(0, 1);\n> >   \tstate.manual.gain = state.automatic.gain;\n>\n> Note that I have just updated this change:\n>\n> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp\n> index c0d690c802..876f11f5ad 100644\n> --- a/src/ipa/libipa/agc.cpp\n> +++ b/src/ipa/libipa/agc.cpp\n> @@ -355,7 +355,7 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons\n>         /* Configure the default exposure and gain. */\n>         state = {};\n>         state.automatic.gain = session.minAnalogueGain;\n> -       state.automatic.exposure = clampExposure(10ms, session);\n> +       state.automatic.exposure = defExposure;\n\nSo you can probably drop this patch as do this when introducing\nAgcAlgorithm ?\n\nOr maybe, as the code is copied, highlighting the change has value\n\nEither ways\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n\n\n>         state.automatic.quantizationGain = 1;\n>         state.automatic.yTarget = impl_.effectiveYTarget(0, 1);\n>         state.manual.gain = state.automatic.gain;\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 5B7EABE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jul 2026 14:01:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 350CF67F7E;\n\tMon, 27 Jul 2026 16:01:02 +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 D1FE967EB2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jul 2026 16:01:00 +0200 (CEST)","from ideasonboard.com (mob-5-90-50-102.net.vodafone.it\n\t[5.90.50.102])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E354B492;\n\tMon, 27 Jul 2026 15:59:56 +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=\"Pa0Qpf/G\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1785160797;\n\tbh=HXsvgYItSa36UpBmvRYmcv8yUWF1AmLfMz/BR5AaZwM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Pa0Qpf/GhXRsZUJaTVR4I+hatWnEspSMFTGGaPQyfnUmgDkkWWdHA/RMFRYSU60ao\n\tN5a10HCfyq5FqHiVqEWYWhfb+ckBgO7LkH2wMKqt1RekJS7xTyWQpigZYVzeI0HAzm\n\tsoB5cbOgVkUOlwzldXierwnYv/KvXCHXGcYPyxOo=","Date":"Mon, 27 Jul 2026 16:00:57 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 25/43] ipa: libipa: agc: Use default exposure","Message-ID":"<amdkRxGARNOjeM3t@zed>","References":"<20260723154327.1357866-1-barnabas.pocze@ideasonboard.com>\n\t<20260723154327.1357866-26-barnabas.pocze@ideasonboard.com>\n\t<3657695d-22f5-4ff2-8593-8b603e580df4@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<3657695d-22f5-4ff2-8593-8b603e580df4@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>"}}]