[v4,07/19] libipa: agc_mean_luminance: Fix constraint logging
diff mbox series

Message ID 20250918144333.108695-8-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Implement WDR algorithm
Related show

Commit Message

Stefan Klug Sept. 18, 2025, 2:43 p.m. UTC
The debug log statements in constraintClampGain() are after the
assignment of gain. So they correctly log when the constraint applies,
but the gain values logged are the same. Fix that.

Fixes: 42e18c96bcb7 ("libipa: agc_mean_luminance: Add debug logging")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

---

Changes in v4:
- Collected tags

Changes in v3:
- Added this patch
---
 src/ipa/libipa/agc_mean_luminance.cpp | 4 ++--
 1 file changed, 2 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 ff96a381ffce..fce1a5064870 100644
--- a/src/ipa/libipa/agc_mean_luminance.cpp
+++ b/src/ipa/libipa/agc_mean_luminance.cpp
@@ -488,18 +488,18 @@  double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
 
 		if (constraint.bound == AgcConstraint::Bound::Lower &&
 		    newGain > gain) {
-			gain = newGain;
 			LOG(AgcMeanLuminance, Debug)
 				<< "Apply lower bound: " << gain << " to "
 				<< newGain;
+			gain = newGain;
 		}
 
 		if (constraint.bound == AgcConstraint::Bound::Upper &&
 		    newGain < gain) {
-			gain = newGain;
 			LOG(AgcMeanLuminance, Debug)
 				<< "Apply upper bound: " << gain << " to "
 				<< newGain;
+			gain = newGain;
 		}
 	}