summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-07 10:03:49 +0200
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-22 07:25:48 +0200
commit7c9c1a2a9299a08e4f6ab09edb4b97f2ae50183d (patch)
tree374d215a331b3fb5ea3e7f72b3174adcfc0c030e /src/ipa/ipu3/algorithms
parent59687683a16c64c6821db89c7a1be35b161bf917 (diff)
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>
Diffstat (limited to 'src/ipa/ipu3/algorithms')
-rw-r--r--src/ipa/ipu3/algorithms/agc.cpp8
1 files changed, 7 insertions, 1 deletions
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;
}