| Message ID | 20261203195647.18475-1-johannes.goede@oss.qualcomm.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Hi all, Please ignore the 1/20 part of the subject, my bad. This is a standalone fix. Regards, Hans On 3-Dec-26 20:56, Hans de Goede wrote: > The agc::prepareControls() call to prepare the controls to pass to > the setSensorControls signal takes frameContext.agc.[exposure,gain] as > parameters. > > These are updated by the prepare() call of the agc algorithm. Doing > the agc::prepareControls() call + setSensorControls.emit() in > processStats() leads to previous or uninitialized (0) values being > used. > > Move these calls to computeParams() after the prepare() calls. This also > nicely groups the agc::prepareControls() call together with the other > prepare() calls. > > Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> > --- > src/ipa/softisp/softisp.cpp | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/ipa/softisp/softisp.cpp b/src/ipa/softisp/softisp.cpp > index 00249a300..96056865d 100644 > --- a/src/ipa/softisp/softisp.cpp > +++ b/src/ipa/softisp/softisp.cpp > @@ -237,6 +237,11 @@ void IPASoftIsp::computeParams(const uint32_t frame) > params_->combinedMatrix = context_.activeState.combinedMatrix; > > paramsComputed.emit(frame); > + > + ControlList ctrls(context_.sensorControls); > + agc::prepareControls(ctrls, context_.camHelper.get(), > + frameContext.agc.exposure, frameContext.agc.gain); > + setSensorControls.emit(ctrls); > } > > void IPASoftIsp::processStats(const uint32_t frame, > @@ -252,11 +257,6 @@ void IPASoftIsp::processStats(const uint32_t frame, > for (const auto &algo : algorithms()) > algo->process(context_, frame, frameContext, stats_, metadata); > metadataReady.emit(frame, metadata); > - > - ControlList ctrls(context_.sensorControls); > - agc::prepareControls(ctrls, context_.camHelper.get(), > - frameContext.agc.exposure, frameContext.agc.gain); > - setSensorControls.emit(ctrls); > } > > std::string IPASoftIsp::logPrefix() const
diff --git a/src/ipa/softisp/softisp.cpp b/src/ipa/softisp/softisp.cpp index 00249a300..96056865d 100644 --- a/src/ipa/softisp/softisp.cpp +++ b/src/ipa/softisp/softisp.cpp @@ -237,6 +237,11 @@ void IPASoftIsp::computeParams(const uint32_t frame) params_->combinedMatrix = context_.activeState.combinedMatrix; paramsComputed.emit(frame); + + ControlList ctrls(context_.sensorControls); + agc::prepareControls(ctrls, context_.camHelper.get(), + frameContext.agc.exposure, frameContext.agc.gain); + setSensorControls.emit(ctrls); } void IPASoftIsp::processStats(const uint32_t frame, @@ -252,11 +257,6 @@ void IPASoftIsp::processStats(const uint32_t frame, for (const auto &algo : algorithms()) algo->process(context_, frame, frameContext, stats_, metadata); metadataReady.emit(frame, metadata); - - ControlList ctrls(context_.sensorControls); - agc::prepareControls(ctrls, context_.camHelper.get(), - frameContext.agc.exposure, frameContext.agc.gain); - setSensorControls.emit(ctrls); } std::string IPASoftIsp::logPrefix() const
The agc::prepareControls() call to prepare the controls to pass to the setSensorControls signal takes frameContext.agc.[exposure,gain] as parameters. These are updated by the prepare() call of the agc algorithm. Doing the agc::prepareControls() call + setSensorControls.emit() in processStats() leads to previous or uninitialized (0) values being used. Move these calls to computeParams() after the prepare() calls. This also nicely groups the agc::prepareControls() call together with the other prepare() calls. Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> --- src/ipa/softisp/softisp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)