From patchwork Mon Nov 9 16:12:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28835 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 9ACB2C335C for ; Mon, 9 Nov 2026 16:13:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0F3036A7D8; Mon, 9 Nov 2026 17:13:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KZEmxZP8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 59AEE6A7EA for ; Mon, 9 Nov 2026 17:12:54 +0100 (CET) Received: from pb-laptop.local (185.221.143.99.nat.pool.zt.hu [185.221.143.99]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A46B11E6E; Mon, 9 Nov 2026 17:10:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794240632; bh=vI9a+TyG13Q6tbS62ot9wX1dvdteYr2z/1bxEEJXJNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KZEmxZP8Sh54EdQI6imWGrDgpgH1o8L07S5x6yjaefsMiLLzt/ebfNsY6BwtkOIMa MdYh5AMnanI97eRlmDO1xiVmTgPR6F1UTJBbgyTkDz4jhCzBDnfL8fxIy/ssVM6nOW ihs9oqSoff9jHhmTrGb0Q3FjvOzgmaXcJJ0aXI3w= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi Subject: [PATCH v8 17/18] ipa: libipa: agc: Do not run slower than 15fps by default Date: Mon, 9 Nov 2026 17:12:44 +0100 Message-ID: <20261109161246.513264-18-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261109161246.513264-1-barnabas.pocze@ideasonboard.com> References: <20261109161246.513264-1-barnabas.pocze@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" If the tuning file defines no exposure modes, then the "Maximize" mode will be implicitly instantiated and used. But in this case, do not let the camera run slower than 15fps, by default, unless the user explicitly requests it using `FrameDurationLimits`. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Stefan Klug --- src/ipa/libipa/agc.cpp | 11 +++++++++++ src/ipa/libipa/agc.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp index bed725e185..2326de53cb 100644 --- a/src/ipa/libipa/agc.cpp +++ b/src/ipa/libipa/agc.cpp @@ -313,6 +313,7 @@ int AgcAlgorithm::init(const ValueNode &tuningData, CameraSensorHelper *sensor, if (!agcConfig) return -EINVAL; + tuning_.hasExposureModes = !agcConfig->exposureModeHelpers.empty(); impl_.emplace(std::move(*agcConfig)); } else { impl_.emplace(); @@ -480,6 +481,16 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, state.minFrameDuration = std::clamp( utils::Duration(1.0s / 30), session.minFrameDuration, session.maxFrameDuration); + + if (!tuning_.hasExposureModes) { + /* + * By default do not run slower than 15fps + * if no exposure modes are defined. + */ + state.maxFrameDuration = std::clamp( + utils::Duration(1.0s / 15), + state.minFrameDuration, session.maxFrameDuration); + } } /* \todo Move this to the `Camera` class. */ diff --git a/src/ipa/libipa/agc.h b/src/ipa/libipa/agc.h index 3ca36aea64..d8057720d0 100644 --- a/src/ipa/libipa/agc.h +++ b/src/ipa/libipa/agc.h @@ -163,6 +163,10 @@ private: std::variant impl_; CameraSensorHelper *sensor_ = nullptr; + + struct { + bool hasExposureModes = false; + } tuning_; }; } /* namespace ipa */