[v3,20/41] libipa: awb: Populate metadata when stats are invalid
diff mbox series

Message ID 20260914140309.3354666-21-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • rkisp1: pipeline rework for PFC
Related show

Commit Message

Stefan Klug Sept. 14, 2026, 2:02 p.m. UTC
A pipeline handler can call processStats() on the IPA even in the case
that no valid stats are available, just to populate the metadata with
the values from the frame context.

Add support for that to the AWB algorithm by populating the metadata
before checking if stats are valid.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/libipa/awb.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/libipa/awb.cpp b/src/ipa/libipa/awb.cpp
index da835bec018d..81d616c3a646 100644
--- a/src/ipa/libipa/awb.cpp
+++ b/src/ipa/libipa/awb.cpp
@@ -372,6 +372,12 @@  void AwbAlgorithmBase::process(awb::ActiveState &state,
 			       const AwbStats &stats, unsigned int lux,
 			       ControlList &metadata)
 {
+	/* Populate metadata. */
+	metadata.set(controls::AwbEnable, frameContext.autoEnabled);
+	metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()),
+					      static_cast<float>(frameContext.gains.b()) });
+	metadata.set(controls::ColourTemperature, frameContext.colourTemperature);
+
 	if (!stats.valid())
 		return;
 
@@ -393,12 +399,6 @@  void AwbAlgorithmBase::process(awb::ActiveState &state,
 	state.automatic.gains = awbResult.gains * speed +
 				state.automatic.gains * (1 - speed);
 
-	/* Populate metadata. */
-	metadata.set(controls::AwbEnable, frameContext.autoEnabled);
-	metadata.set(controls::ColourGains, { static_cast<float>(frameContext.gains.r()),
-					      static_cast<float>(frameContext.gains.b()) });
-	metadata.set(controls::ColourTemperature, frameContext.colourTemperature);
-
 	LOG(Awb, Debug) << std::showpoint << "Means " << stats.rgbMeans()
 			<< ", gains " << state.automatic.gains
 			<< ", temp " << state.automatic.colourTemperature << "K";