From patchwork Wed Nov 11 11:55:58 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: 28857 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 F17ECC335D for ; Wed, 11 Nov 2026 11:56:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 978AA6A808; Wed, 11 Nov 2026 12:56:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="LPaYp1RL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AC9B66A7B6 for ; Wed, 11 Nov 2026 12:56:08 +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 934142014; Wed, 11 Nov 2026 12:53:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794398025; bh=IkHHQL1UfD69OEMvnC+bMRbExiTyjB+dRoTf6Dhyvoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LPaYp1RLRoXfB5lvMZWlzGzcpaeulJ40im9fty0mmN2SBWuYHDayUVxzUFdRa4P38 BYsfHo+Zwq3QgXTodF2JQUaMLlY8MzKMoasGhP4NM8Y/4luXHNtPH/jLdoaXOmxof9 bzt9LIZlHgpYtkwz3ngp6AFr4vLihI1GzKIVo0MI= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Stefan Klug Subject: [PATCH v9 17/18] ipa: libipa: agc: Do not run slower than 15fps by default Date: Wed, 11 Nov 2026 12:55:58 +0100 Message-ID: <20261111115600.1097488-18-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261111115600.1097488-1-barnabas.pocze@ideasonboard.com> References: <20261111115600.1097488-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 dc52a98f7d..f4f4e147f8 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 58be445da1..6284d5f888 100644 --- a/src/ipa/libipa/agc.h +++ b/src/ipa/libipa/agc.h @@ -162,6 +162,10 @@ private: std::variant impl_; CameraSensorHelper *sensor_ = nullptr; + + struct { + bool hasExposureModes = false; + } tuning_; }; } /* namespace ipa */