ipa: rpi: agc: Remove digital gain from AgcPrepareStatus

All platforms are now using the digital gain from the AgcStatus, so
the AgcPrepareStatus and prepare() methods can be tidied up.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
David Plowman
2025-07-21 08:47:27 +01:00
committed by Kieran Bingham
parent fd56dd6268
commit 68e8476d56
2 changed files with 1 additions and 18 deletions

View File

@@ -44,6 +44,5 @@ struct AgcStatus {
};
struct AgcPrepareStatus {
double digitalGain;
int locked;
};

View File

@@ -480,26 +480,10 @@ void AgcChannel::prepare(Metadata *imageMetadata)
AgcPrepareStatus prepareStatus;
prepareStatus.locked = false;
prepareStatus.digitalGain = 1.0;
if (!imageMetadata->get("device.status", deviceStatus)) {
if (!imageMetadata->get("device.status", deviceStatus))
prepareStatus.locked = updateLockStatus(deviceStatus);
/*
* For now, the IPA code is still expecting the digital gain to come back in
* the prepare_status. To keep things happy, we'll just fill in the value that
* we calculated previously and put in the AgcStatus (which comes back as the
* "delayed" status). Once the rest of the IPA code is updated, we'll be able
* to remove this, and indeed remove the digitalGain from the AgcPrepareStatus.
*/
AgcStatus delayedStatus;
if (!imageMetadata->get("agc.delayed_status", delayedStatus))
prepareStatus.digitalGain = delayedStatus.digitalGain;
else
/* After a mode switch, this must be correct until new values come through. */
prepareStatus.digitalGain = status_.digitalGain;
}
imageMetadata->set("agc.prepare_status", prepareStatus);
}