From patchwork Thu Dec 24 08:16:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10724 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 36B82C0F1A for ; Thu, 24 Dec 2020 08:16:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 05DED615B2; Thu, 24 Dec 2020 09:16:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OfaxFQX2"; 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 D09DB615AF for ; Thu, 24 Dec 2020 09:16:22 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 60BA5A1D; Thu, 24 Dec 2020 09:16:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1608797782; bh=XabP+/os1UVHmvNbACiNuBPdFyaJC4Sa1xhACY3nHrA=; h=From:To:Cc:Subject:Date:From; b=OfaxFQX2VHzrhxJKTn4zGWjxyhZ3wwY9wzigTdfV0n8NzovkR3aW/vDgR/junHyX/ 81cw7sS2/OgiRxHocf0Tsj/t46NHgLuI4Y/CP/YAJVt6eSxYNBGYh97lL7NgnemNCb wJrAmYbVQdIhBRTJ8v4RhHTp0t7fRezIbOJn0Qqc= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Dec 2020 17:16:02 +0900 Message-Id: <20201224081613.41662-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 00/11] IPA isolation: Part 2: Conversion and plumbing 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" v6 is split in three parts, core components, conversion + plumbing, and tests + documentation. This is part 2, and implements the plumbing for IPA isolation. Patches 4/9 to 11/11 must be squashed together to avoid bisection breakage. Patch 8/11 may be of interest, as it shows how one would write the interface and data definition. In v2 I have customized the raspberrypi mojom file to take advantage of the freedom in definition the IPA interface and data structures (as opposed to v1, where it was practically a direct translation of IPAOperationData). In v3 I have added namespace support to the data definition, and this is reflected in its usage. In v6 I added support for custom start(), and used it. Also in v6, support for consts was added, so I moved all the enum and const definitions to the mojom file. As of v6, namespacing in the mojom files is required, in the form of /^ipa\.[0-9A-Za-z]+/ and this is reflected in the three mojom files in this series. Patch 9/11 is also noteworthy, as it shows how one would use the interface that has been defined. Since the headers and proxies are autogenerated, there isn't a patch where the generated code can be seen, however. Patches 10/11 and 11/11 also define mojom files and use them, but are for vimc and rkisp1, respectively. These will also give an idea on how the mojom definition looks and how it will be used. Changes in v6: - move definitions of libcamera structs to core.mojom (in Part 1) - move enums and consts from the ipa header to the mojom file - remove vimc.h, use the ipa::vimc namespace, and use the new start() - same for rkisp1.h - remove postfix _ in generated struct fields - use the required ipa namespace - fill the LS table handle in the raspberry pi pipeline handler, instead of passing it from the IPA - remove per-pipeline ContrlInfoMap from the ipa header - remove the ControlInfoMap initializer from raspberrypi header Paul Elder (11): meson: ipa, proxy: Generate headers and proxy with mojo tests: Remove IPA wrappers test ipa: raspberrypi: meson: Add dependency on generated headers libcamera: IPAInterface: Replace C API with the new C++-only API libcamera: IPAProxy: Remove stop() override libcamera: IPAProxy, IPAManager: Switch to one-proxy-per-pipeline scheme libcamera: PipelineHandler: Remove IPA from base class ipa: raspberrypi: Add mojom data definition file libcamera: pipeline, ipa: raspberrypi: Use new data definition libcamera: pipeline, ipa: vimc: Support the new IPC mechanism libcamera: pipeline, ipa: rkisp1: Support the new IPC mechanism Documentation/Doxyfile.in | 1 - .../libcamera/internal/ipa_context_wrapper.h | 53 -- include/libcamera/internal/ipa_manager.h | 31 +- include/libcamera/internal/ipa_module.h | 4 +- include/libcamera/internal/ipa_proxy.h | 31 - include/libcamera/internal/meson.build | 1 - include/libcamera/internal/pipeline_handler.h | 1 - include/libcamera/ipa/ipa_interface.h | 147 +--- include/libcamera/ipa/meson.build | 124 ++++ include/libcamera/ipa/raspberrypi.h | 31 - include/libcamera/ipa/raspberrypi.mojom | 134 ++++ include/libcamera/ipa/rkisp1.h | 22 - include/libcamera/ipa/rkisp1.mojom | 44 ++ include/libcamera/ipa/vimc.h | 28 - include/libcamera/ipa/vimc.mojom | 24 + src/ipa/libipa/ipa_interface_wrapper.cpp | 287 -------- src/ipa/libipa/ipa_interface_wrapper.h | 61 -- src/ipa/libipa/meson.build | 2 - src/ipa/raspberrypi/meson.build | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 183 +++-- src/ipa/rkisp1/meson.build | 2 +- src/ipa/rkisp1/rkisp1.cpp | 63 +- src/ipa/vimc/meson.build | 2 +- src/ipa/vimc/vimc.cpp | 39 +- src/libcamera/ipa_context_wrapper.cpp | 298 -------- src/libcamera/ipa_interface.cpp | 650 +----------------- src/libcamera/ipa_manager.cpp | 47 +- src/libcamera/ipa_module.cpp | 18 +- src/libcamera/ipa_proxy.cpp | 101 --- src/libcamera/meson.build | 2 +- .../pipeline/raspberrypi/raspberrypi.cpp | 244 +++---- .../pipeline/raspberrypi/rpi_stream.cpp | 6 +- .../pipeline/raspberrypi/rpi_stream.h | 5 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 79 ++- src/libcamera/pipeline/vimc/vimc.cpp | 10 +- src/libcamera/pipeline_handler.cpp | 8 - src/libcamera/proxy/ipa_proxy_linux.cpp | 104 --- src/libcamera/proxy/ipa_proxy_thread.cpp | 175 ----- src/libcamera/proxy/meson.build | 21 +- .../proxy/worker/ipa_proxy_linux_worker.cpp | 90 --- src/libcamera/proxy/worker/meson.build | 23 +- test/ipa/ipa_interface_test.cpp | 44 +- test/ipa/ipa_wrappers_test.cpp | 453 ------------ test/ipa/meson.build | 3 +- utils/ipc/generators/meson.build | 3 + utils/ipc/meson.build | 13 + 46 files changed, 778 insertions(+), 2936 deletions(-) delete mode 100644 include/libcamera/internal/ipa_context_wrapper.h create mode 100644 include/libcamera/ipa/raspberrypi.mojom delete mode 100644 include/libcamera/ipa/rkisp1.h create mode 100644 include/libcamera/ipa/rkisp1.mojom delete mode 100644 include/libcamera/ipa/vimc.h create mode 100644 include/libcamera/ipa/vimc.mojom delete mode 100644 src/ipa/libipa/ipa_interface_wrapper.cpp delete mode 100644 src/ipa/libipa/ipa_interface_wrapper.h delete mode 100644 src/libcamera/ipa_context_wrapper.cpp delete mode 100644 src/libcamera/proxy/ipa_proxy_linux.cpp delete mode 100644 src/libcamera/proxy/ipa_proxy_thread.cpp delete mode 100644 src/libcamera/proxy/worker/ipa_proxy_linux_worker.cpp delete mode 100644 test/ipa/ipa_wrappers_test.cpp create mode 100644 utils/ipc/generators/meson.build Reviewed-by: Niklas Söderlund Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart