From patchwork Thu Oct 29 12:58:43 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: 28689 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 570ACC3316 for ; Thu, 29 Oct 2026 12:59:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D9FA7690F4; Thu, 29 Oct 2026 13:59:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="n3cO22sv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F8A6690BB for ; Thu, 29 Oct 2026 13:58:53 +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 C979A6DC for ; Thu, 29 Oct 2026 13:56:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1793278599; bh=EZzR8IV/wUDAhbVsa4ObykQNIgc/STXvL4uufwaOG+Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n3cO22svDRvLtgL/p40Hk9bzUbeB5cKjjxOqwOSyyPIPNyIjmHb9EO2MBgCIKw/Ba x9/IbzfIAiVw7t3yH2Nl/fOkwoLx7eL81XDeSabZFqxfJto+CaHbr+dMipU8/6+cZK VCaePI+157c+ryLl2UFXA8o3pz1imzWhJAxO8aFo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v5 23/24] ipa: libipa: agc: Do not run slower than 15fps by default Date: Thu, 29 Oct 2026 13:58:43 +0100 Message-ID: <20261029125844.170324-24-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029125844.170324-1-barnabas.pocze@ideasonboard.com> References: <20261029125844.170324-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 --- src/ipa/libipa/agc.cpp | 12 ++++++++++++ src/ipa/libipa/agc.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp index 775dc12002..60e8614777 100644 --- a/src/ipa/libipa/agc.cpp +++ b/src/ipa/libipa/agc.cpp @@ -564,6 +564,8 @@ int AgcAlgorithm::init(const ValueNode &tuningData, CameraSensorHelper *sensor, if (ret) return ret; + tuning_.hasExposureModes = !agcConfig.exposureModeHelpers.empty(); + addFallbacks(agcConfig); impl_.emplace(std::move(agcConfig)); @@ -733,6 +735,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 */