ipa: software_isp: AGC: Raise exposure or gain not both at the same time

Raise either exposure or gain; not both at the same time.

Before this change when the last exposure raise is done, hitting
exposure-max, gain would be increased at the same time.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Tested-by: Milan Zamazal <mzamazal@redhat.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Hans de Goede
2025-09-30 17:04:25 +02:00
committed by Kieran Bingham
parent 950ca85e8a
commit 5d62463915
+7 -6
View File
@@ -56,12 +56,13 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou
double &again = frameContext.sensor.gain;
if (exposureMSV < kExposureOptimal - kExposureSatisfactory) {
next = exposure * kExpNumeratorUp / kExpDenominator;
if (next - exposure < 1)
exposure += 1;
else
exposure = next;
if (exposure >= context.configuration.agc.exposureMax) {
if (exposure < context.configuration.agc.exposureMax) {
next = exposure * kExpNumeratorUp / kExpDenominator;
if (next - exposure < 1)
exposure += 1;
else
exposure = next;
} else {
next = again * kExpNumeratorUp / kExpDenominator;
if (next - again < context.configuration.agc.againMinStep)
again += context.configuration.agc.againMinStep;