[RFC,v4,11/23] ipa: libipa: agc: Keep frame duration limits ordered
diff mbox series

Message ID 20261026132045.269007-12-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 Oct. 26, 2026, 1:20 p.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 7e85faf649..90850a296b 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -900,7 +900,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;