ipa: ipu3: set frameContext before controls

The AGC frame context needs to be initialised correctly for the first
iteration. Until now, the IPA uses the minimum exposure and gain values
and caches those in local variables.

In order to give the sensor limits to AGC, create a new structure in
IPASessionConfiguration. Store the exposure in time (and not line
duration) and the analogue gain after CameraSensorHelper conversion.

Set the gain and exposure appropriately to the current values known to
the IPA and remove the setting of exposure and gain in IPAIPU3 as those
are now fully controlled by IPU3Agc.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jean-Michel Hautbois 2021-10-07 10:03:49 +02:00
parent 59687683a1
commit 7c9c1a2a92
3 changed files with 73 additions and 8 deletions

View file

@ -60,7 +60,13 @@ int Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo)
lineDuration_ = configInfo.sensorInfo.lineLength * 1.0s
/ configInfo.sensorInfo.pixelRate;
maxExposureTime_ = kMaxExposure * lineDuration_;
maxExposureTime_ = context.configuration.agc.maxShutterSpeed;
/* Configure the default exposure and gain. */
context.frameContext.agc.gain =
context.configuration.agc.minAnalogueGain;
context.frameContext.agc.exposure =
context.configuration.agc.minShutterSpeed / lineDuration_;
return 0;
}