From patchwork Sun Jun 16 16:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20337 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4B549C32D0 for ; Sun, 16 Jun 2024 16:39:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5C21A654A5; Sun, 16 Jun 2024 18:39:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="P8FJwDhZ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 93DC9654A2 for ; Sun, 16 Jun 2024 18:39:43 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4464B581 for ; Sun, 16 Jun 2024 18:39:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718555967; bh=wV66rHTTxgF6HYtzo7gxMBuiUra1Pb0uzhzCBTZfLik=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P8FJwDhZudfGTOKdaMpknTYOtcmj3nP2Yl5aj1wD9C7KemIsPCOqMnnB0S3P9KvT3 unP2HraBL4b/70YR6uxhh6jxfjUfwmYpRrIrAXCfG4kwje+kdzFGfIfXWmceQHZ62x MpGIkqiAAeSMkUKx5dwNevKJDDus22Qv8Ceu9E5M= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 09/12] ipa: rkisp1: agc: Use mode from frame context to calculate new EV Date: Sun, 16 Jun 2024 19:39:07 +0300 Message-ID: <20240616163910.5506-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240616163910.5506-1-laurent.pinchart@ideasonboard.com> References: <20240616163910.5506-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- 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)