[v3,4/9] libipa: agc_mean_luminance: Add debug logging
diff mbox series

Message ID 20250707085520.39777-5-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Wdr preparations
Related show

Commit Message

Stefan Klug July 7, 2025, 8:55 a.m. UTC
When debugging the AEGC it is important to know when the constraints
apply. As this is important information for anyone doing tuning file
optimization, add it upstream.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

---

Changes in v3:
- Fixed line wrapping
- Collected tags

Changes in v2:
- Collected tags
---
 src/ipa/libipa/agc_mean_luminance.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp
index d37a9b66103f..ebdb4d755741 100644
--- a/src/ipa/libipa/agc_mean_luminance.cpp
+++ b/src/ipa/libipa/agc_mean_luminance.cpp
@@ -467,12 +467,20 @@  double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
 				 hist.interQuantileMean(constraint.qLo, constraint.qHi);
 
 		if (constraint.bound == AgcConstraint::Bound::Lower &&
-		    newGain > gain)
+		    newGain > gain) {
 			gain = newGain;
+			LOG(AgcMeanLuminance, Debug)
+				<< "Apply lower bound: " << gain << " to "
+				<< newGain;
+		}
 
 		if (constraint.bound == AgcConstraint::Bound::Upper &&
-		    newGain < gain)
+		    newGain < gain) {
 			gain = newGain;
+			LOG(AgcMeanLuminance, Debug)
+				<< "Apply upper bound: " << gain << " to "
+				<< newGain;
+		}
 	}
 
 	return gain;