From patchwork Fri Oct 17 09:00:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 24693 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 21FB1BE080 for ; Fri, 17 Oct 2025 09:00:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 65CA5606A6; Fri, 17 Oct 2025 11:00:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="T1HFoDWk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CE1226069D for ; Fri, 17 Oct 2025 11:00:15 +0200 (CEST) Received: from [192.168.1.182] (93-46-82-201.ip106.fastwebnet.it [93.46.82.201]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 58610F52; Fri, 17 Oct 2025 10:58:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760691515; bh=79xYYXqOMRja/UNui1e9e4sMSzKzHYpbAOYHikCOTII=; h=From:Subject:Date:To:Cc:From; b=T1HFoDWkfUDqOehOr+k2eCGbTV08z4n2iHAJN/3oyvTV/S1iVInSuB15pi7KE+K/W cYvcC2O1NLmXeGR3ryaprc3H+HYKYyXSZWhAdyL4gccZ7O3M86TFvHN5qbXX/cWhNC cE0IE7WuY7O/i7QK8y6Ab4Ue53a3qlOEGG6IaY+I= From: Jacopo Mondi Subject: [PATCH 0/3] rkisp1: Update exposure limits on vblank change Date: Fri, 17 Oct 2025 11:00:04 +0200 Message-Id: <20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJQF8mgC/x3MQQqAIBBA0avIrBNSkqSrRIuosQYqxakQxLsnL d/i/wyMkZBhEBkivsTkrwrVCFj2+dpQ0loNutVGtaqXmILnJ6I86KSbpVk6q412aDoLtQoRHaX /OE6lfDHyUOFhAAAA X-Change-ID: 20251017-exposure-limits-5c48252fe548 To: =?utf-8?q?Niklas_S=C3=B6derlund?= , libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2793; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=79xYYXqOMRja/UNui1e9e4sMSzKzHYpbAOYHikCOTII=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBo8gWekMHr4GKJVgbcN/tgJoeFcNf7UmPtMSWjo DU3q3Jcdl2JAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaPIFngAKCRByNAaPFqFW PKDCD/49h3rG5n573mCqe4W+Aunp7r1cPWJsJ0DxF/tG3H0O1iyiHCFk87rWq2H4my56EDx6GX/ gsmcB16WbcQyL6UmzxJL/EI3bvz0O3SAsn9NrgBMqKmCbESam88+IF0SVk9zzm4UCAPX6iZdshI HcUmsZSsQfruBCeTwGLh7259/Y5wmTMp7dIY/JoKtZziiqzsszsHmDYfCckaESt026KjT7gATqg v/KYFQCkWMv8A7Jn1TvzkEzipLKowllsoat5m9hmk+Wpd5ToW4goEGiXY76FCwtQo+ivl/NWyqg iI2qGA4kTbDfNfKCW+q+cfXOFTsc66TonNmTIMrJ0V2ly7GpRCz77MRFD0TxXmoJaYlGn86AWnm fu1r5abJ0I/ED9dIC4StWTSJnssAgiDdpexcxvfjxwc1HoteMUETtxMOkY0qFwLGmqfZRmoWs1E EYBr9LIrazs+mMdyOTPbxkXxiWMvCG26Gu1uPNWfcfYC0F6wz5midZJ8Bj+PNhBpfJErW3HMf/W 6gFkbP8QLHNOqO8btMCq5CmH6/uuug/iBNf7PbDhMA61RfS7B4qmPxq7OMgK5qqOfthMFhWSuC7 3JXQZQraPe8LGgsuFCAMBa4XF/x7Bz63GOeByNerXXXThuhEZQ5gVHyBpYbPOUZ/E1HAlwovfkx FwqkgvKvW/h3ppQ== 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" By definition, the exposure time that can be programmed on a sensor is limited by the frame duration and whenever the frame duration is updated, the exposure time limits should be updated as well. This is not the case in the RkISP1 IPA, where the exposure limits are computed at configure() time and never updated. This has two implications: 1) The AGC algorithms will always operate with an exposure time bound to the frame duration programmed at startup time 2) The Camera::controls() limits are not updated to reflect the new constraints This series addresses the above issues with 2 patches. The first one for the IPA simply updates the exposure limts whenever the VBLANK changes in response to a FrameDurationLimits change. The second one for the IPA/pipeline introduces a new operation in the IPA interface which the pipeline handler calls to have the limits of the controls registered by the IPA updated. The timing of these two operations is critical. The IPA limits should be updated whenever a new VBLANK is computed. The actual blanking value on the sensor will be changed with a few frames of latency by DelayedControls, but for the IPA this is not relevant as all the computations for the 'next' frames will be delayed by the same latency and should use the new limits. The Camera::controls() limits should instead be updated when the Request with the updated FrameDurationLimits completes. For this reason the new 'updateControlsLimits()' IPA operation is called before completing a Request on the pipeline handler side. Finally, the last patch, not meant for inclusion, validates that the Camera::controls() limits are updated correctly. The IPA limits update has been visually validated with camshark by tuning the FrameDurationLimits control and verifying the AGC algorithm limits are updated accordingly. Signed-off-by: Jacopo Mondi --- Jacopo Mondi (3): ipa: rkisp1: Update exposure limits on vblank change libcamera: rkisp1: Update camera::controls() on limit changes DNI: cam: Test Camera::controls() update with capture script change-frame-duration.yaml | 4 +++ include/libcamera/ipa/rkisp1.mojom | 2 ++ src/apps/cam/camera_session.cpp | 21 ++++++++++++ src/ipa/rkisp1/algorithms/agc.cpp | 3 ++ src/ipa/rkisp1/ipa_context.h | 5 ++- src/ipa/rkisp1/rkisp1.cpp | 57 ++++++++++++++++++++++++++++++-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 3 ++ 7 files changed, 91 insertions(+), 4 deletions(-) --- base-commit: b9fa6e0e61d3ea605fe4b1201ede5745cd5800e5 change-id: 20251017-exposure-limits-5c48252fe548 Best regards,