From patchwork Fri Sep 25 10:25: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: 28368 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 2D884BE173 for ; Fri, 25 Sep 2026 10:26:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3FBE2689BC; Fri, 25 Sep 2026 12:25:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IcU9W93H"; 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 39F9768978 for ; Fri, 25 Sep 2026 12:25:55 +0200 (CEST) Received: from pb-laptop.local (185.221.142.173.nat.pool.zt.hu [185.221.142.173]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D0F2C1; Fri, 25 Sep 2026 12:24:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1790331847; bh=fxopFTjvewALSkFgMIGCSlE6eM5iwVWmRwbU2qr0Vus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IcU9W93H1texdS2D8rb3aY0tWifLOYPLSrZsJ6fE0f41VDyRL2DPzG/sw+TP5tb0n U6B35qtoeBWpQMtMcSevHlqW/egeXkj9k9bTAtcXbdpbP7sK87UbZxsqazaxxh08VN o4CBZPVKw8wKXUfT97LjCzYFmBDk+/915Fmdnu1g= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Jacopo Mondi Subject: [PATCH v2 1/9] ipa: libipa: agc: Keep frame duration limits ordered Date: Fri, 25 Sep 2026 12:25:43 +0200 Message-ID: <20260925102551.137108-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260925102551.137108-1-barnabas.pocze@ideasonboard.com> References: <20260925102551.137108-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" The frame duration limits from controls are already clamped to the session limits, but that does not prevent a situation where min > max. Use the just computed `state.minFrameDuration` as the lower bound when clamping the max value in order to avoid this possibility. Signed-off-by: Barnabás Pőcze Reviewed-by: Stefan Klug Reviewed-by: Jacopo Mondi --- src/ipa/libipa/agc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp index 51b05e3c2a..c20d0ad2af 100644 --- a/src/ipa/libipa/agc.cpp +++ b/src/ipa/libipa/agc.cpp @@ -642,7 +642,7 @@ void AgcAlgorithm::queueRequest(const agc::Session &session, agc::ActiveState &s state.maxFrameDuration = std::clamp( std::chrono::microseconds((*frameDurationLimits).back()), - session.minFrameDuration, session.maxFrameDuration); + state.minFrameDuration, session.maxFrameDuration); } frameContext.minFrameDuration = state.minFrameDuration; frameContext.maxFrameDuration = state.maxFrameDuration;