ipa: simple: Fix again10 value with sensor helper

`CameraSensorHelper::gain(uint32_t)` maps a gain code to the actual floating
point gain value. Calling it with `1.0` as the argument will simply get
the real gain for gain code 1. This is most likely not what was intended.

For example, in the case of the `ov2740` sensor, `againMin` is 1, but the
calculated `again10` (1 / 128 ~ 0.078) ends up being < 1, meaning that the
agc algorithm will never lower the exposure.

Fix that by using the maximum of the minimum gain and 1 as `again10`.

Fixes: 950ca85e8a ("ipa: software_isp: AGC: Do not lower gain below 1.0")
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
This commit is contained in:
Barnabás Pőcze
2026-03-06 15:10:29 +01:00
parent 20ea9ae1e5
commit 02277d4c1a
+1 -1
View File
@@ -227,7 +227,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)
if (camHelper_) {
context_.configuration.agc.againMin = camHelper_->gain(againMin);
context_.configuration.agc.againMax = camHelper_->gain(againMax);
context_.configuration.agc.again10 = camHelper_->gain(1.0);
context_.configuration.agc.again10 = std::max(context_.configuration.agc.againMin, 1.0);
context_.configuration.agc.againMinStep =
(context_.configuration.agc.againMax -
context_.configuration.agc.againMin) /