From patchwork Sun Nov 2 19:54:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 24948 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 C1CD2C3241 for ; Sun, 2 Nov 2025 19:54:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7EA476096B; Sun, 2 Nov 2025 20:54:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="m+8Mvudw"; 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 EA9F3606E6 for ; Sun, 2 Nov 2025 20:54:47 +0100 (CET) Received: from [100.93.44.16] (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9769599F; Sun, 2 Nov 2025 20:52:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1762113175; bh=6Op2FXYq7Evafhkdv/yc3AsXzhrPljFNNeX1SkNKI8s=; h=From:Date:Subject:To:Cc:From; b=m+8MvudwXsnPYJQcr/+1BYlOv10EnEU2SAOgDCVFJoK4vKlC8ps+jejU26p2ypy6Y xD9QqRayecIwBIAQPNhEjRli2FROv3j2oE6ftfT/iYByxeLkqtq9z/bwRprumE3Br1 evNU7y7N8bZXBfEaWZzk5gmRbbhaYArvYz26jIoA= From: Jacopo Mondi Date: Sun, 02 Nov 2025 20:54:33 +0100 Subject: [PATCH] libcamera: rkisp1: Mark VBLANK as priority MIME-Version: 1.0 Message-Id: <20251102-rkisp1-vblank-v1-1-fa8f8bb3e396@ideasonboard.com> X-B4-Tracking: v=1; b=H4sIAPi2B2kC/3XMQQ7CIBCF4as0sxbTIRSrq97DdDEUtJMqNGCIp uHuYvcu/5e8b4PkIrsEl2aD6DInDr4GHhqYZvJ3J9jWBtnKDrGVIi6cVhTZPMgvwpBse6WVNnS C+lmju/F7965j7ZnTK8TPzmf8rf+kjAKFlVarrtdnTTSwdZSCN4GiPU7hCWMp5QtKujnpsQAAA A== X-Change-ID: 20251102-rkisp1-vblank-ba2084646ba7 To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2076; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=6Op2FXYq7Evafhkdv/yc3AsXzhrPljFNNeX1SkNKI8s=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpB7cHZCrxgBjDgnK3Q96V4E+V8W+Z8mmQ2Utk8 Tq04v6KkRyJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaQe3BwAKCRByNAaPFqFW PHbgD/93CyXF/V/puNeMaSvba8mOdN+r1UfszLuMEPgFewhxiD57f/0YmM5F4sRhtws1jYE7+Iq yFuvtXMGYHeimOqVOPvQ657MPfUfBH7w1z8au55Hlz91dZJX83xV8YVnkFSMyMZfT02nHBh+lVp JI3eImwdPDtvPGf5b34+B0af/CMeS7Mw8MWeTWi4gXlOF/nKwb7qePBG/ETyNJoZNaoPGYRkDWG r3/CvK7iTMWGuhX85jp/if20S2nr4b7WqkUFn2YnHGvw6moL3lfZ0a2wdQr5Eqod6+Th+aZYysZ MmVem1tG6lRqiF8DUY5g/QTeDB2w6uLPPb776RE360k+pLmEynQuctwPtsir5z0IAUOZG5PMc2U bl2PTQgSCLC6pSwgUj6cWeKs8NJTH+WA/Ny8/Ag3QGp1t9pE48CVqsQeNcoHfBwJrZT4KFQw1vG aQyCnD7LB3oL+l/O0cN2++auHRGjqS91Qfld6O3v0xxXajFB9Fy8gry44xmD3arRt0sa6OEvuJM qmKflQ13Prunvkt1ytdBLOKbGwb6OAFKAXCb4WQ4vDr6g9an6KJKbm4TYkFHaSyeB5NXPPtRiKY Idp0onaDAZXWNRHOQh0i82fnz21FkgHgLrfXfS+Z2PEfT2yKV85iZVRfr5zbqvEBNAmBfIijWuP sQTml7oikB4BNQA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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 DelayedControls class works around a limitation of the V4L2 controls API by assigning to controls that modify the limits of other controls a 'priority' flag. 'Priority' controls are written to the device before others to make sure the limits of dependent controls are correctly updated. A typical example of a priority control is VBLANK, whose value changes the limits of the EXPOSURE control. This doesn't apply to a specific hardware platform but to all V4L2 sensors. The RkISP1 pipeline handler doesn't mark VBLANK as a priority control, an issue which might result in the exposure being clamped to an outdated frame length. Fix the rkisp1 pipeline by marking VBLANK as a priority control. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze --- A simpler version of "libcamera: delayed_controls: Make VBLANK priority by default" as automatically setting VBLANK would save pipeline handlers from doing it, but if anyone has to support HBLANK, in example, it has to modify DelayedControls, not sure what's better, so I'm sending both. --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: b1f09c013a01a82c739f0e30b71fd8d000ef5655 change-id: 20251102-rkisp1-vblank-ba2084646ba7 Best regards, diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index ecd13831539fdf5cb79da2ea4b33a353514328ae..d7195b6c484d091857a91de709e0e060810c7c32 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -1348,7 +1348,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor) std::unordered_map params = { { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, - { V4L2_CID_VBLANK, { delays.vblankDelay, false } }, + { V4L2_CID_VBLANK, { delays.vblankDelay, true } }, }; data->delayedCtrls_ =