[RFC,v3,27/50] ipa: libipa: agc: Use minimum line length
diff mbox series

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

Commit Message

Barnabás Pőcze Aug. 3, 2026, 1:14 p.m. UTC
`IPACameraSensorInfo::minLineLength` already contains the minimum
line length, taking the output format and minimum horizontal blanking
into account.

Furthermore, the `CameraSensor` implementations already set the horizontal
blanking to the minimum when initializing the sensor.

And finally the line duration is already calculated with the minimum
line length.

So use the minimum for the frame duration calculations as well.
---
 src/ipa/libipa/agc.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index e9055ddd7b..0f787925cb 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -250,10 +250,11 @@  int AgcAlgorithm::init(const ValueNode &tuningData)
 int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
 			    const ConfigurationParams &config)
 {
+	const auto lineLength = config.sensorInfo.minLineLength;
+
 	session = {};
 	session.autoAllowed = config.autoAllowed;
-	session.lineDuration =
-		config.sensorInfo.minLineLength * 1.0s / config.sensorInfo.pixelRate;
+	session.lineDuration = lineLength * 1.0s / config.sensorInfo.pixelRate;
 	session.sensor.outputSize = config.sensorInfo.outputSize;
 
 	const double lineDurationUs = session.lineDuration.get<std::micro>();
@@ -286,9 +287,6 @@  int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,
 	 * The frame length is computed assuming a fixed line length combined
 	 * with the vertical frame sizes.
 	 */
-	const ControlInfo &v4l2HBlank = config.sensorControls.find(V4L2_CID_HBLANK)->second;
-	uint32_t hblank = v4l2HBlank.def().get<int32_t>();
-	uint32_t lineLength = config.sensorInfo.outputSize.width + hblank;
 
 	const ControlInfo &v4l2VBlank = config.sensorControls.find(V4L2_CID_VBLANK)->second;
 	std::array<uint32_t, 3> frameHeights{