[v8,16/18] ipa: libipa: agc: Do not run faster than 30fps by default
diff mbox series

Message ID 20261109161246.513264-17-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 Nov. 9, 2026, 4:12 p.m. UTC
In auto mode, by default the camera should not run faster than 30fps
unless the user explicitly adjusts `FrameDurationLimits`. This matches
the behaviour of the raspberry pi agc algorithm.

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>
---
 src/ipa/libipa/agc.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index 298e403d2d..bed725e185 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -475,6 +475,13 @@  int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
 		},
 	}, impl_);
 
+	if (session.autoAllowed) {
+		/* By default do not run faster than 30fps. */
+		state.minFrameDuration = std::clamp(
+			utils::Duration(1.0s / 30),
+			session.minFrameDuration, session.maxFrameDuration);
+	}
+
 	/* \todo Move this to the `Camera` class. */
 	config.ctrlMap[&controls::AeEnable] = ControlInfo{
 		false, session.autoAllowed, session.autoAllowed