[v2,1/9] ipa: libipa: agc: Keep frame duration limits ordered
diff mbox series

Message ID 20260925102551.137108-2-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • ipa: libipa: agc: Take exposure margin into account
Related show

Commit Message

Barnabás Pőcze Sept. 25, 2026, 10:25 a.m. UTC
The frame duration limits from controls are already clamped to the session
limits, but that does not prevent a situation where min > max. Use the just
computed `state.minFrameDuration` as the lower bound when clamping the max
value in order to avoid this possibility.

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

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index 51b05e3c2a..c20d0ad2af 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -642,7 +642,7 @@  void AgcAlgorithm::queueRequest(const agc::Session &session, agc::ActiveState &s
 
 		state.maxFrameDuration = std::clamp<utils::Duration>(
 			std::chrono::microseconds((*frameDurationLimits).back()),
-			session.minFrameDuration, session.maxFrameDuration);
+			state.minFrameDuration, session.maxFrameDuration);
 	}
 	frameContext.minFrameDuration = state.minFrameDuration;
 	frameContext.maxFrameDuration = state.maxFrameDuration;