From patchwork Mon Aug 3 13:14:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 27574 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 29C54C333B for ; Mon, 3 Aug 2026 13:15:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 74DCD680A7; Mon, 3 Aug 2026 15:15:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ckvrRZgk"; 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 08B7A6809B for ; Mon, 3 Aug 2026 15:14:45 +0200 (CEST) Received: from pb-laptop.local (185.221.141.208.nat.pool.zt.hu [185.221.141.208]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 249435B3 for ; Mon, 3 Aug 2026 15:13:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1785762816; bh=QGU7SH5jLslYQ2ZvW3px3dppTJ8XOHsiwgoDXuP6T0Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ckvrRZgkiPO1YJz2xSTN/sT8SUqDW/2yY+O8N6jYdZpaVOCKbU11knL0VcO45/Bjn /O7gZ0vC5YN5f/aSPfPWG+r3cg/qPiyqV/JFdT9v7t9Hawxal5PgyY1PA7UBPm1ERU Ss2hsFT9Xs8ptPSjrp1WjNkaZVWucz0d+XHbaI88= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v3 27/50] ipa: libipa: agc: Use minimum line length Date: Mon, 3 Aug 2026 15:14:12 +0200 Message-ID: <20260803131435.153927-28-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260803131435.153927-1-barnabas.pocze@ideasonboard.com> References: <20260803131435.153927-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" `IPACameraSensorInfo::minLineLength` already contains the minimum line length, taking the output format and minimum horizontal blanking into account. Furthermore, the `CameraSensor` implementations already set the horizontal blanking to the minimum when initializing the sensor. And finally the line duration is already calculated with the minimum line length. So use the minimum for the frame duration calculations as well. --- src/ipa/libipa/agc.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp index e9055ddd7b..0f787925cb 100644 --- a/src/ipa/libipa/agc.cpp +++ b/src/ipa/libipa/agc.cpp @@ -250,10 +250,11 @@ int AgcAlgorithm::init(const ValueNode &tuningData) int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, const ConfigurationParams &config) { + const auto lineLength = config.sensorInfo.minLineLength; + session = {}; session.autoAllowed = config.autoAllowed; - session.lineDuration = - config.sensorInfo.minLineLength * 1.0s / config.sensorInfo.pixelRate; + session.lineDuration = lineLength * 1.0s / config.sensorInfo.pixelRate; session.sensor.outputSize = config.sensorInfo.outputSize; const double lineDurationUs = session.lineDuration.get(); @@ -286,9 +287,6 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, * The frame length is computed assuming a fixed line length combined * with the vertical frame sizes. */ - const ControlInfo &v4l2HBlank = config.sensorControls.find(V4L2_CID_HBLANK)->second; - uint32_t hblank = v4l2HBlank.def().get(); - uint32_t lineLength = config.sensorInfo.outputSize.width + hblank; const ControlInfo &v4l2VBlank = config.sensorControls.find(V4L2_CID_VBLANK)->second; std::array frameHeights{