| Message ID | 20251024085130.995967-16-stefan.klug@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Stefan Klug (2025-10-24 17:50:39) > If the agc is in auto mode, exposure time and gain used to be set on the s/on/in/ > frame context within prepare(). As exposure time and gain are used by > getSensorControls(0) from within start() that is too late (prepare() > hasn't run yet). Also prepare() is documented as the place to initialize > the params buffer, not the frame context. From the pipeline point of > view, prepare() gets called immediately after queueRequest(). Therefore > we can safely move setting the frame context into queueRequest() to fix > the sensor controls for start(). This feels weird again because we've put the algo's queueRequest() into start() even though the pipeline hasn't actually received a queueRequest yet. But other than that it seems sound to me. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/agc.cpp | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp > index f5a3c917cb69..c67106339ef8 100644 > --- a/src/ipa/rkisp1/algorithms/agc.cpp > +++ b/src/ipa/rkisp1/algorithms/agc.cpp > @@ -284,9 +284,13 @@ void Agc::queueRequest(IPAContext &context, > frameContext.agc.autoExposureEnabled = agc.autoExposureEnabled; > frameContext.agc.autoGainEnabled = agc.autoGainEnabled; > > - if (!frameContext.agc.autoExposureEnabled) > + if (frameContext.agc.autoExposureEnabled) > + frameContext.agc.exposure = context.activeState.agc.automatic.exposure; > + else > frameContext.agc.exposure = agc.manual.exposure; > - if (!frameContext.agc.autoGainEnabled) > + if (frameContext.agc.autoGainEnabled) > + frameContext.agc.gain = context.activeState.agc.automatic.gain; > + else > frameContext.agc.gain = agc.manual.gain; > > if (!frameContext.agc.autoExposureEnabled && > -- > 2.48.1 >
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index f5a3c917cb69..c67106339ef8 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -284,9 +284,13 @@ void Agc::queueRequest(IPAContext &context, frameContext.agc.autoExposureEnabled = agc.autoExposureEnabled; frameContext.agc.autoGainEnabled = agc.autoGainEnabled; - if (!frameContext.agc.autoExposureEnabled) + if (frameContext.agc.autoExposureEnabled) + frameContext.agc.exposure = context.activeState.agc.automatic.exposure; + else frameContext.agc.exposure = agc.manual.exposure; - if (!frameContext.agc.autoGainEnabled) + if (frameContext.agc.autoGainEnabled) + frameContext.agc.gain = context.activeState.agc.automatic.gain; + else frameContext.agc.gain = agc.manual.gain; if (!frameContext.agc.autoExposureEnabled &&
If the agc is in auto mode, exposure time and gain used to be set on the frame context within prepare(). As exposure time and gain are used by getSensorControls(0) from within start() that is too late (prepare() hasn't run yet). Also prepare() is documented as the place to initialize the params buffer, not the frame context. From the pipeline point of view, prepare() gets called immediately after queueRequest(). Therefore we can safely move setting the frame context into queueRequest() to fix the sensor controls for start(). Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/agc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)