[RFC,v2,39/43] ipa: libipa: agc_msv: Handle min gain > 1.0 case
diff mbox series

Message ID 20260723154327.1357866-40-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • ipa: libipa: agc rework
Related show

Commit Message

Barnabás Pőcze July 23, 2026, 3:43 p.m. UTC
When manual gain control is enabled in `AgcAlgorithm`, the limits will
be set to that particular value. This is very likely larger than 1.0.
In this case, however, the algorithm should still adjust the exposure
time if it can. So compare the gain with the minimum of 1.0 and the
configured min gain, in order to ensure that the exposure will be
adjusted if the lower boundary of the allowed analogue gains is reached.

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

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc_msv.cpp b/src/ipa/libipa/agc_msv.cpp
index 956551685c..9fec2ba48a 100644
--- a/src/ipa/libipa/agc_msv.cpp
+++ b/src/ipa/libipa/agc_msv.cpp
@@ -206,7 +206,7 @@  AgcMSV::Result AgcMSV::updateExposure(uint32_t exposure, double again, float exp
 			}
 		} else {
 			/* Scene too bright: decrease gain first, then exposure. */
-			if (again > limits_.gain1) {
+			if (again > std::max(limits_.gain1, limits_.gain[0])) {
 				double next = again * factor;
 				again = std::min(next, again - limits_.gainMinStep);
 			} else {