From patchwork Fri Dec 20 16:26:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22446 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 C4A02C32A3 for ; Fri, 20 Dec 2024 16:27:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 53BD1684C4; Fri, 20 Dec 2024 17:27:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cLGlxOan"; 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 E878D684B0 for ; Fri, 20 Dec 2024 17:27:43 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:4eeb:7fa7:1fd0:c13d]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 797F71063; Fri, 20 Dec 2024 17:27:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734712024; bh=DOyT3FbCJSGL13W/QCnUpBIAAX2xiv0cAjDkFggXV/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cLGlxOanUQFnR2GOnMY2LpZANoDbU+SyL+VXMbeBXH1qKzmcoI8ntSUWtoxPaabIl PGIpfDkZF1xWkd3dGctGVpNQEr+22r+HIPZdcDdh6kXE68smiXAzcaIaoqTjEDKuJU 1LTBza4Lpn2RjdTXrOEOyvbC3ztu8PplKWz+Xi6k= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [RFC PATCH 6/7] ipa: rkisp1: Add a lookahead of one frame when sending sensor controls Date: Fri, 20 Dec 2024 17:26:52 +0100 Message-ID: <20241220162724.756494-7-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220162724.756494-1-stefan.klug@ideasonboard.com> References: <20241220162724.756494-1-stefan.klug@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" When the delayed controls instance of the pipeline is reset, it initializes the values for frame 0 as being sent out to the sensor (which is correct). The next sequence number that can be pushed to delayed controls is therefore number 1. Ensure that the IPA never tries to queue controls for frame 0. Signed-off-by: Stefan Klug --- src/ipa/rkisp1/rkisp1.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 799fe0846635..5d439e0d727b 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -386,10 +386,13 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId, /* * \todo: Here we should do a lookahead that takes the sensor delays - * into account. + * into account. A lookahead of 1 is the smallest lookahead possible to + * ensure we don't try to send the controls for a frame that we already + * received. */ - ControlList ctrls = getSensorControls(frame); - setSensorControls.emit(frame, ctrls); + int lookahead = 1; + ControlList ctrls = getSensorControls(frame + lookahead); + setSensorControls.emit(frame + lookahead, ctrls); context_.debugMetadata.moveEntries(metadata); metadataReady.emit(frame, metadata);