ipa: rkisp1: Initialise AGC from FrameDurationLimits controls

The IPA calculates and reports the FrameDurationLimits to applications
by configuring the ControlInfo accordingly during
IPARkISP1::updateControls()

We later need to know these limits during Agc::configure() for
initialising the ActiveState of the AGC implementation with the limits.

Store the FrameDurationLimits ControlInfo in the ControlInfoMap which is
now present in the IPAContext so that it is commonly available for the
AGC algorithm, removing the 'todo' accordingly.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2024-10-14 16:47:45 +01:00 committed by Paul Elder
parent 33ce463a46
commit 443ac36e12
2 changed files with 6 additions and 9 deletions

View file

@ -188,12 +188,9 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)
context.activeState.agc.meteringMode =
static_cast<controls::AeMeteringModeEnum>(meteringModes_.begin()->first);
/*
* \todo This should probably come from FrameDurationLimits instead,
* except it's computed in the IPA and not here so we'd have to
* recompute it.
*/
context.activeState.agc.maxFrameDuration = context.configuration.sensor.maxExposureTime;
/* Limit the frame duration to match current initialisation */
ControlInfo &frameDurationLimits = context.ctrlMap[&controls::FrameDurationLimits];
context.activeState.agc.maxFrameDuration = std::chrono::microseconds(frameDurationLimits.max().get<int64_t>());
/*
* Define the measurement window for AGC as a centered rectangle

View file

@ -435,9 +435,9 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);
}
ctrlMap[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],
frameDurations[1],
frameDurations[2]);
/* \todo Move this (and other agc-related controls) to agc */
context_.ctrlMap[&controls::FrameDurationLimits] =
ControlInfo(frameDurations[0], frameDurations[1], frameDurations[2]);
ctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end());
*ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);