[v4,23/49] ipa: libipa: agc: Use default exposure
diff mbox series

Message ID 20260810103846.1075936-24-barnabas.pocze@ideasonboard.com
State Superseded
Headers show
Series
  • ipa: libipa: agc rework
Related show

Commit Message

Barnabás Pőcze Aug. 10, 2026, 10:38 a.m. UTC
Instead of hard-coding 10ms, just use the default exposure time
as determined by the V4L2 control. This ensures that the advertised
default in the `ControlInfo` matches what actually happens.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/ipa/libipa/agc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Klug Aug. 11, 2026, 4:09 p.m. UTC | #1
Hi Barnabás,

Quoting Barnabás Pőcze (2026-08-10 12:38:19)
> Instead of hard-coding 10ms, just use the default exposure time
> as determined by the V4L2 control. This ensures that the advertised
> default in the `ControlInfo` matches what actually happens.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>

Cheers,
Stefan

> ---
>  src/ipa/libipa/agc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
> index 05d6442000..fbda9038e2 100644
> --- a/src/ipa/libipa/agc.cpp
> +++ b/src/ipa/libipa/agc.cpp
> @@ -318,7 +318,7 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
>         /* Configure the default exposure and gain. */
>         state = {};
>         state.automatic.gain = session.minAnalogueGain;
> -       state.automatic.exposure = 10ms / session.lineDuration;
> +       state.automatic.exposure = defExposure;
>         state.automatic.quantizationGain = 1;
>         state.automatic.yTarget = impl_.effectiveYTarget(0, 1);
>         state.manual.gain = state.automatic.gain;
> -- 
> 2.55.0
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index 05d6442000..fbda9038e2 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -318,7 +318,7 @@  int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
 	/* Configure the default exposure and gain. */
 	state = {};
 	state.automatic.gain = session.minAnalogueGain;
-	state.automatic.exposure = 10ms / session.lineDuration;
+	state.automatic.exposure = defExposure;
 	state.automatic.quantizationGain = 1;
 	state.automatic.yTarget = impl_.effectiveYTarget(0, 1);
 	state.manual.gain = state.automatic.gain;