From patchwork Tue Nov 30 23:36:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 14914 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 B2622BDB13 for ; Tue, 30 Nov 2021 23:35:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5E2460720; Wed, 1 Dec 2021 00:35:48 +0100 (CET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 79BFC60592 for ; Wed, 1 Dec 2021 00:35:47 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 85AA41BF207; Tue, 30 Nov 2021 23:35:46 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 1 Dec 2021 00:36:23 +0100 Message-Id: <20211130233634.34173-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 00/11] libcamera: Add support for Fence 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" Substantial changes from v2. the first of which is the rebase on top of Laurent's UniqueFD v4 which greatly simplifies the interface to set/reset a Fence. Substantial changes compared to v2 Series tested with CTS, openCamera and CCA I'm more happy than v2, most if not all of my concerns are solved, and the usage of UniqueFD really clarify the ownership model. Last concern is: all the handling of fences notification is done by Request::prepare() and Fence is a really thin class whose sole purpose is to define an interface that will not change when new fence mechanism will be supported. Won't having the code to do so in Request::prepare() instead than in the Fence itself kind of defeat that purpose ? Thanks j v2->v3 - Documentation - Fence: - use UniqueFD - drop Extensible - Framebuffer: - Add FrameBuffer::resetFence -Request: - do not overload addBuffer but use optional argument - Remove Private::Status - simplify prepare() by using a map of buffers to notifiers - Add the prepared_ flag - PipelineHandler: - Simplify request preparation - Android - Use UniqueFD v1->v2: Major changes: - removed notifiers and timers from Fence. A Fence is now an wrapper that owns a file descriptor - Add timers and notifiers to Request::Private and add the Request::Private::prepare interface Smaller changes: - Expand Request::Private to move all internal fields - Remove Fence move semantic. A Fence lives in a Framebuffer. - A few minor patches on top Jacopo Mondi (10): libcamera: Print Timer identifier libcamera: fence: Introduce Fence libcamera: framebuffer: Add Fence to FrameBuffer libcamera: request: Add Fence to Request::addBuffer() test: fence: Add test for the Fence class libcamera: pipeline_handler: Split request queueing libcamera: pipeline: Introduce stopDevice() libcamera: request: Add Request::Private::prepare() libcamera: pipeline_handler: Prepare Request android: Remove CameraWorker Laurent Pinchart (1): libcamera: request: Make Request class Extensible include/libcamera/fence.h | 31 ++ include/libcamera/framebuffer.h | 4 + include/libcamera/internal/framebuffer.h | 7 + include/libcamera/internal/meson.build | 1 + include/libcamera/internal/pipeline_handler.h | 9 +- include/libcamera/internal/request.h | 64 +++ .../libcamera/internal/tracepoints/request.tp | 22 +- include/libcamera/meson.build | 1 + include/libcamera/request.h | 23 +- src/android/camera_device.cpp | 46 +-- src/android/camera_device.h | 3 - src/android/camera_request.cpp | 8 +- src/android/camera_request.h | 6 +- src/android/camera_stream.cpp | 10 +- src/android/camera_worker.cpp | 129 ------ src/android/camera_worker.h | 70 ---- src/android/meson.build | 1 - src/libcamera/base/event_dispatcher_poll.cpp | 3 +- src/libcamera/base/timer.cpp | 4 +- src/libcamera/fence.cpp | 108 +++++ src/libcamera/framebuffer.cpp | 66 +++ src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +- .../pipeline/raspberrypi/raspberrypi.cpp | 4 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +- src/libcamera/pipeline/simple/simple.cpp | 4 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 +- src/libcamera/pipeline/vimc/vimc.cpp | 4 +- src/libcamera/pipeline_handler.cpp | 107 ++++- src/libcamera/request.cpp | 387 ++++++++++++++---- test/fence.cpp | 343 ++++++++++++++++ test/meson.build | 1 + 32 files changed, 1110 insertions(+), 369 deletions(-) create mode 100644 include/libcamera/fence.h create mode 100644 include/libcamera/internal/request.h delete mode 100644 src/android/camera_worker.cpp delete mode 100644 src/android/camera_worker.h create mode 100644 src/libcamera/fence.cpp create mode 100644 test/fence.cpp --- 2.33.1