{"id":22446,"url":"https://patchwork.libcamera.org/api/1.1/patches/22446/?format=json","web_url":"https://patchwork.libcamera.org/patch/22446/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241220162724.756494-7-stefan.klug@ideasonboard.com>","date":"2024-12-20T16:26:52","name":"[RFC,6/7] ipa: rkisp1: Add a lookahead of one frame when sending sensor controls","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2c680224236b6d81c4bf6702ea37790ee55375d8","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22446/mbox/","series":[{"id":4925,"url":"https://patchwork.libcamera.org/api/1.1/series/4925/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4925","date":"2024-12-20T16:26:46","name":"Improve regulation on rkisp1","version":1,"mbox":"https://patchwork.libcamera.org/series/4925/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22446/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22446/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C4A02C32A3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 16:27:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 53BD1684C4;\n\tFri, 20 Dec 2024 17:27:49 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E878D684B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 17:27:43 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:4eeb:7fa7:1fd0:c13d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 797F71063;\n\tFri, 20 Dec 2024 17:27:04 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cLGlxOan\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734712024;\n\tbh=DOyT3FbCJSGL13W/QCnUpBIAAX2xiv0cAjDkFggXV/g=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=cLGlxOanUQFnR2GOnMY2LpZANoDbU+SyL+VXMbeBXH1qKzmcoI8ntSUWtoxPaabIl\n\tPGIpfDkZF1xWkd3dGctGVpNQEr+22r+HIPZdcDdh6kXE68smiXAzcaIaoqTjEDKuJU\n\t1LTBza4Lpn2RjdTXrOEOyvbC3ztu8PplKWz+Xi6k=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[RFC PATCH 6/7] ipa: rkisp1: Add a lookahead of one frame when\n\tsending 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","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"When the delayed controls instance of the pipeline is reset, it initializes\nthe values for frame 0 as being sent out to the sensor (which is\ncorrect). The next sequence number that can be pushed to delayed\ncontrols is therefore number 1. Ensure that the IPA never tries to\nqueue controls for frame 0.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/ipa/rkisp1/rkisp1.cpp | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 799fe0846635..5d439e0d727b 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -386,10 +386,13 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n \n \t/*\n \t * \\todo: Here we should do a lookahead that takes the sensor delays\n-\t * into account.\n+\t * into account. A lookahead of 1 is the smallest lookahead possible to\n+\t * ensure we don't try to send the controls for a frame that we already\n+\t * received.\n \t */\n-\tControlList ctrls = getSensorControls(frame);\n-\tsetSensorControls.emit(frame, ctrls);\n+\tint lookahead = 1;\n+\tControlList ctrls = getSensorControls(frame + lookahead);\n+\tsetSensorControls.emit(frame + lookahead, ctrls);\n \n \tcontext_.debugMetadata.moveEntries(metadata);\n \tmetadataReady.emit(frame, metadata);\n","prefixes":["RFC","6/7"]}