| Message ID | 20260803131435.153927-28-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
Hi Barnabás On Mon, Aug 03, 2026 at 03:14:12PM +0200, Barnabás Pőcze wrote: > `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. Missing Signed-off-by line > --- > src/ipa/libipa/agc.cpp | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > 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; s/auto/uint32_t let's not overuse auto when the type is trivial to type out Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > + > 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{ > -- > 2.55.0 >
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{