[PATCH 09/12] ipa: rkisp1: agc: Use mode from frame context to calculate new EV

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Jun 16 18:39:07 CEST 2024


The effective exposure value for each frame is split into shutter time,
analog gain and digital gain based on the AGC constraint mode and
exposure mode. The algorithm uses the modes from the active state, which
tracks the latest queued request, instead of the frame context, which
tracks the value of the controls requested for that frame. Fix it by
using the correct modes.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/agc.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index a61201bb05c9..6a199b47c9ad 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -439,8 +439,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
 	utils::Duration shutterTime;
 	double aGain, dGain;
 	std::tie(shutterTime, aGain, dGain) =
-		calculateNewEv(context.activeState.agc.constraintMode,
-			       context.activeState.agc.exposureMode,
+		calculateNewEv(frameContext.agc.constraintMode,
+			       frameContext.agc.exposureMode,
 			       hist, effectiveExposureValue);
 
 	LOG(RkISP1Agc, Debug)
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list