From patchwork Sun Jun 16 16:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20338 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 C1C7FC3237 for ; Sun, 16 Jun 2024 16:39:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D293654AE; Sun, 16 Jun 2024 18:39:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rTAqpTA0"; 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 03B4E6549A for ; Sun, 16 Jun 2024 18:39:45 +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 99FE9669 for ; Sun, 16 Jun 2024 18:39:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718555968; bh=ec3VZDnl/loOa8Me0JXcaDm2cGq95C0t9RVxYa4T6VA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rTAqpTA0a7pINwQaDekaK37SznK56IkN77JZs6L3ihtFCx5hA2deL94KAOyGNxl5p 6RA1ADOlAs/AODrc79dtD7UPMQUvsni4KrHIv6kTJZxZHHcyYOF7hgIAkhjduZvbfY w8/onGYukbmnRcJ6Q+J2oIgjJmCK7Z5tIGD+jnhk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 10/12] ipa: rkisp1: agc: Rename maxShutterSpeed to maxFrameDuration Date: Sun, 16 Jun 2024 19:39:08 +0300 Message-ID: <20240616163910.5506-11-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 AGC active state and frame context both contain a variable named maxShutterSpeed. The variable is used to limit the maximum shutter speed when computing the exposure time and gains, but stores the maximum frame duration, not clamped by the sensor's maximum shutter speed. Rename it to maxFrameDuration. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/agc.cpp | 10 +++++----- src/ipa/rkisp1/ipa_context.cpp | 4 ++-- src/ipa/rkisp1/ipa_context.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 6a199b47c9ad..5b917557b887 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -182,7 +182,7 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) * except it's computed in the IPA and not here so we'd have to * recompute it. */ - context.activeState.agc.maxShutterSpeed = context.configuration.sensor.maxShutterSpeed; + context.activeState.agc.maxFrameDuration = context.configuration.sensor.maxShutterSpeed; /* * Define the measurement window for AGC as a centered rectangle @@ -269,11 +269,11 @@ void Agc::queueRequest(IPAContext &context, const auto &frameDurationLimits = controls.get(controls::FrameDurationLimits); if (frameDurationLimits) { - utils::Duration maxShutterSpeed = + utils::Duration maxFrameDuration = std::chrono::milliseconds((*frameDurationLimits).back()); - agc.maxShutterSpeed = maxShutterSpeed; + agc.maxFrameDuration = maxFrameDuration; } - frameContext.agc.maxShutterSpeed = agc.maxShutterSpeed; + frameContext.agc.maxFrameDuration = agc.maxFrameDuration; } /** @@ -421,7 +421,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, expMeans_ = { params->ae.exp_mean, context.hw->numAeCells }; utils::Duration maxShutterSpeed = std::min(context.configuration.sensor.maxShutterSpeed, - frameContext.agc.maxShutterSpeed); + frameContext.agc.maxFrameDuration); setLimits(context.configuration.sensor.minShutterSpeed, maxShutterSpeed, context.configuration.sensor.minAnalogueGain, diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 9e445dcca933..ab6cfae17feb 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -172,7 +172,7 @@ namespace libcamera::ipa::rkisp1 { * \var IPAActiveState::agc.meteringMode * \brief Metering mode as set by the AeMeteringMode control * - * \var IPAActiveState::agc.maxShutterSpeed + * \var IPAActiveState::agc.maxFrameDuration * \brief Maximum frame duration as set by the FrameDurationLimits control */ @@ -314,7 +314,7 @@ namespace libcamera::ipa::rkisp1 { * \var IPAFrameContext::agc.meteringMode * \brief Metering mode as set by the AeMeteringMode control * - * \var IPAFrameContext::agc.maxShutterSpeed + * \var IPAFrameContext::agc.maxFrameDuration * \brief Maximum frame duration as set by the FrameDurationLimits control * * \var IPAFrameContext::agc.update diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 6022480d4fd2..734856cdb199 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -72,7 +72,7 @@ struct IPAActiveState { controls::AeConstraintModeEnum constraintMode; controls::AeExposureModeEnum exposureMode; controls::AeMeteringModeEnum meteringMode; - utils::Duration maxShutterSpeed; + utils::Duration maxFrameDuration; } agc; struct { @@ -121,7 +121,7 @@ struct IPAFrameContext : public FrameContext { controls::AeConstraintModeEnum constraintMode; controls::AeExposureModeEnum exposureMode; controls::AeMeteringModeEnum meteringMode; - utils::Duration maxShutterSpeed; + utils::Duration maxFrameDuration; bool update; } agc;