From 7c9c1a2a9299a08e4f6ab09edb4b97f2ae50183d Mon Sep 17 00:00:00 2001 From: Jean-Michel Hautbois Date: Thu, 7 Oct 2021 10:03:49 +0200 Subject: 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/algorithms/agc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ipa/ipu3/algorithms') diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 970ec424..828e822c 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -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; } -- cgit v1.2.1