From patchwork Wed Oct 28 01:00:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10273 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 DBE73C3B5C for ; Wed, 28 Oct 2020 01:01:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4388B62237; Wed, 28 Oct 2020 02:01:11 +0100 (CET) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A8F0621C2 for ; Wed, 28 Oct 2020 02:01:09 +0100 (CET) X-Halon-ID: 07a5e639-18b9-11eb-954c-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 07a5e639-18b9-11eb-954c-0050569116f7; Wed, 28 Oct 2020 02:01:01 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org, david.plowman@raspberrypi.com, naush@raspberrypi.com Date: Wed, 28 Oct 2020 02:00:42 +0100 Message-Id: <20201028010051.3830668-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/9] libcamera: Add helper for controls that take effect with a delay 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" Hello, This series adds a new helper class to libcamera-core based on the StaggerdCtrl principle from the Raspberry Pi pipeline handler. The new helper matches perfectly the RPi implementation and can therefore replace the pipeline specific implementation. There are slight changes in the API of the two but noting preventing it to be a drop in replacement. The major new addition to the DelayedControls implementation is the ability to queue controls a hard of time. This allows the concept of pipeline depth we already have for buffers to be extended to controls. Patch 1/9 and 2/9 adds the new core helper and its unit test. Patch 3/9 and 4/9 replaces StaggerdCtrl with DelayedControls in the Raspberry Pi pipeline handler. Patch 5/9 adds an interface based on DelayedControls to CameraSensor. And last 6/9 - 9/9 make use of the new helper in the RkISP1 pipeline to completely remove another local helper (Timeline). The RkISP1 IPA feels much snappier after this change but this is anecdotal and no real measurements have been done as the RkISP1 IPA at this stage is neither advanced nor tuned. Niklas Söderlund (9): libcamera: v4l2_device: Move start of frame detection to V4L2Device libcamera: delayed_controls: Add helper for controls that applies with a delay test: delayed_controls: Add test case for DelayedControls libcamera: raspberrypi: Switch to DelayedControls libcamera: raspberrypi: Remove StaggeredCtrl libcamera: camera_sensor: Expose a DelayedControls interface libcamera: pipeline: rkisp1: Use CameraSensor and delayed controls libcamera: pipeline: rkisp1: Use SOF event to warn about late parameters libcamera: pipeline: rkisp1: Remove Timeline include/libcamera/internal/camera_sensor.h | 5 + include/libcamera/internal/delayed_controls.h | 87 +++++ include/libcamera/internal/v4l2_device.h | 13 +- include/libcamera/internal/v4l2_videodevice.h | 8 - src/libcamera/camera_sensor.cpp | 31 ++ src/libcamera/delayed_controls.cpp | 282 ++++++++++++++++ src/libcamera/meson.build | 1 + .../pipeline/raspberrypi/meson.build | 1 - .../pipeline/raspberrypi/raspberrypi.cpp | 44 ++- .../pipeline/raspberrypi/staggered_ctrl.cpp | 174 ---------- .../pipeline/raspberrypi/staggered_ctrl.h | 96 ------ src/libcamera/pipeline/rkisp1/meson.build | 1 - src/libcamera/pipeline/rkisp1/rkisp1.cpp | 158 +++------ src/libcamera/pipeline/rkisp1/timeline.cpp | 227 ------------- src/libcamera/pipeline/rkisp1/timeline.h | 72 ---- src/libcamera/v4l2_device.cpp | 76 ++++- src/libcamera/v4l2_videodevice.cpp | 75 +---- test/delayed_contols.cpp | 307 ++++++++++++++++++ test/meson.build | 1 + 19 files changed, 858 insertions(+), 801 deletions(-) create mode 100644 include/libcamera/internal/delayed_controls.h create mode 100644 src/libcamera/delayed_controls.cpp delete mode 100644 src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp delete mode 100644 src/libcamera/pipeline/raspberrypi/staggered_ctrl.h delete mode 100644 src/libcamera/pipeline/rkisp1/timeline.cpp delete mode 100644 src/libcamera/pipeline/rkisp1/timeline.h create mode 100644 test/delayed_contols.cpp