[7/7] ipa: rpi: agc: Remove digital gain from AgcPrepareStatus
diff mbox series

Message ID 20250617082956.5699-8-david.plowman@raspberrypi.com
State New
Headers show
Series
  • Raspberry Pi AEC/AGC update
Related show

Commit Message

David Plowman June 17, 2025, 8:29 a.m. UTC
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>
---
 src/ipa/rpi/controller/agc_status.h        |  1 -
 src/ipa/rpi/controller/rpi/agc_channel.cpp | 18 +-----------------
 2 files changed, 1 insertion(+), 18 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/rpi/controller/agc_status.h b/src/ipa/rpi/controller/agc_status.h
index 956d6abf..1ae069f2 100644
--- a/src/ipa/rpi/controller/agc_status.h
+++ b/src/ipa/rpi/controller/agc_status.h
@@ -44,6 +44,5 @@  struct AgcStatus {
 };
 
 struct AgcPrepareStatus {
-	double digitalGain;
 	int locked;
 };
diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp
index 3829534c..acc67b71 100644
--- a/src/ipa/rpi/controller/rpi/agc_channel.cpp
+++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp
@@ -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);
 }