{"id":10375,"url":"https://patchwork.libcamera.org/api/patches/10375/?format=json","web_url":"https://patchwork.libcamera.org/patch/10375/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201106103707.49660-28-paul.elder@ideasonboard.com>","date":"2020-11-06T10:36:57","name":"[libcamera-devel,v4,27/37] libcamera: pipeline, ipa: vimc: Support the new IPC mechanism","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"18bcdf1e328e9ff343e74505acce8d56d8213f1f","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10375/mbox/","series":[{"id":1448,"url":"https://patchwork.libcamera.org/api/series/1448/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1448","date":"2020-11-06T10:36:30","name":"IPA isolation implementation","version":4,"mbox":"https://patchwork.libcamera.org/series/1448/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10375/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10375/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 35E89BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Nov 2020 10:38:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2CF162D3C;\n\tFri,  6 Nov 2020 11:38:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4026662D44\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Nov 2020 11:38:19 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD5BCA19;\n\tFri,  6 Nov 2020 11:38:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Pv6FRDkv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604659099;\n\tbh=n+3hbsHERxQ0IDqrHwtaxNks2ZzzydCAzrgm+OQrZPU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Pv6FRDkv4WYtNfgZcDq2WAFvIrScPAz9SqdIt4edrjWkQCZDfIagtgCa4CsmUlmGw\n\tW0V3WEa53Pzqa9/kc7uAAuphg3G8ajViqRVhxB+h82DazdimJOzQs3miiwQgmTuewk\n\tnFlPMAPh5h0MwVWXWG0tkIfKnHYTEs+8ODUn17/w=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  6 Nov 2020 19:36:57 +0900","Message-Id":"<20201106103707.49660-28-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20201106103707.49660-1-paul.elder@ideasonboard.com>","References":"<20201106103707.49660-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 27/37] libcamera: pipeline,\n\tipa: vimc: Support the new IPC mechanism","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add support to vimc pipeline handler and IPA for the new IPC mechanism.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v4:\n- rename Controls to controls\n- rename IPAVimcCallbackInterface to IPAVimcEventInterface\n- rename libcamera_generated_headers to libcamera_generated_ipa_headers\n  in meson\n- use the new header name, vimc_ipa_interface.h\n\nChanges in v3:\n- change namespacing of base ControlInfoMap structure\n\nNew in v2\n---\n include/libcamera/ipa/meson.build    |  1 +\n include/libcamera/ipa/vimc.h         |  8 ++++++++\n include/libcamera/ipa/vimc.mojom     | 12 ++++++++++++\n src/ipa/vimc/meson.build             |  2 +-\n src/ipa/vimc/vimc.cpp                | 16 ++++------------\n src/libcamera/pipeline/vimc/vimc.cpp |  8 +++++++-\n 6 files changed, 33 insertions(+), 14 deletions(-)\n create mode 100644 include/libcamera/ipa/vimc.mojom","diff":"diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\nindex d49dff7b..70f5dfc8 100644\n--- a/include/libcamera/ipa/meson.build\n+++ b/include/libcamera/ipa/meson.build\n@@ -26,6 +26,7 @@ ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module',\n \n ipa_mojom_files = [\n     'raspberrypi.mojom',\n+    'vimc.mojom',\n ]\n \n ipa_mojoms = []\ndiff --git a/include/libcamera/ipa/vimc.h b/include/libcamera/ipa/vimc.h\nindex 27a4a61d..2c5f3f8f 100644\n--- a/include/libcamera/ipa/vimc.h\n+++ b/include/libcamera/ipa/vimc.h\n@@ -8,6 +8,8 @@\n #ifndef __LIBCAMERA_IPA_VIMC_H__\n #define __LIBCAMERA_IPA_VIMC_H__\n \n+#include <libcamera/controls.h>\n+\n #ifndef __DOXYGEN__\n \n namespace libcamera {\n@@ -21,6 +23,12 @@ enum IPAOperationCode {\n \tIPAOperationStop,\n };\n \n+namespace Vimc {\n+\n+static ControlInfoMap controls;\n+\n+}\n+\n } /* namespace libcamera */\n \n #endif /* __DOXYGEN__ */\ndiff --git a/include/libcamera/ipa/vimc.mojom b/include/libcamera/ipa/vimc.mojom\nnew file mode 100644\nindex 00000000..d8e9b504\n--- /dev/null\n+++ b/include/libcamera/ipa/vimc.mojom\n@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+\n+import \"include/libcamera/ipa/core.mojom\";\n+\n+interface IPAVimcInterface {\n+\tinit(IPASettings settings) => (int32 ret);\n+\tstart() => (int32 ret);\n+\tstop();\n+};\n+\n+interface IPAVimcEventInterface {\n+};\ndiff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\nindex 8c9df854..e982ebba 100644\n--- a/src/ipa/vimc/meson.build\n+++ b/src/ipa/vimc/meson.build\n@@ -3,7 +3,7 @@\n ipa_name = 'ipa_vimc'\n \n mod = shared_module(ipa_name,\n-                    'vimc.cpp',\n+                    ['vimc.cpp', libcamera_generated_ipa_headers],\n                     name_prefix : '',\n                     include_directories : [ipa_includes, libipa_includes],\n                     dependencies : libcamera_dep,\ndiff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp\nindex cf841135..fbf7325e 100644\n--- a/src/ipa/vimc/vimc.cpp\n+++ b/src/ipa/vimc/vimc.cpp\n@@ -6,6 +6,7 @@\n  */\n \n #include <libcamera/ipa/vimc.h>\n+#include <libcamera/ipa/vimc_ipa_interface.h>\n \n #include <fcntl.h>\n #include <string.h>\n@@ -26,7 +27,7 @@ namespace libcamera {\n \n LOG_DEFINE_CATEGORY(IPAVimc)\n \n-class IPAVimc : public IPAInterface\n+class IPAVimc : public IPAVimcInterface\n {\n public:\n \tIPAVimc();\n@@ -37,15 +38,6 @@ public:\n \tint start() override;\n \tvoid stop() override;\n \n-\tvoid configure([[maybe_unused]] const CameraSensorInfo &sensorInfo,\n-\t\t       [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t       [[maybe_unused]] const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n-\t\t       [[maybe_unused]] const IPAOperationData &ipaConfig,\n-\t\t       [[maybe_unused]] IPAOperationData *result) override {}\n-\tvoid mapBuffers([[maybe_unused]] const std::vector<IPABuffer> &buffers) override {}\n-\tvoid unmapBuffers([[maybe_unused]] const std::vector<unsigned int> &ids) override {}\n-\tvoid processEvent([[maybe_unused]] const IPAOperationData &event) override {}\n-\n private:\n \tvoid initTrace();\n \tvoid trace(enum IPAOperationCode operation);\n@@ -141,9 +133,9 @@ const struct IPAModuleInfo ipaModuleInfo = {\n \t\"vimc\",\n };\n \n-struct ipa_context *ipaCreate()\n+IPAInterface *ipaCreate()\n {\n-\treturn new IPAInterfaceWrapper(std::make_unique<IPAVimc>());\n+\treturn new IPAVimc();\n }\n }\n \ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 7416c37c..9dddb891 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -34,6 +34,10 @@\n #include \"libcamera/internal/v4l2_subdevice.h\"\n #include \"libcamera/internal/v4l2_videodevice.h\"\n \n+#include <libcamera/ipa/vimc.h>\n+#include <libcamera/ipa/vimc_ipa_interface.h>\n+#include <libcamera/ipa/ipa_proxy_vimc.h>\n+\n namespace libcamera {\n \n LOG_DEFINE_CATEGORY(VIMC)\n@@ -67,6 +71,8 @@ public:\n \tV4L2VideoDevice *video_;\n \tV4L2VideoDevice *raw_;\n \tStream stream_;\n+\n+\tstd::unique_ptr<IPAProxyVimc> ipa_;\n };\n \n class VimcCameraConfiguration : public CameraConfiguration\n@@ -428,7 +434,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \n \tstd::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);\n \n-\tdata->ipa_ = IPAManager::createIPA(this, 0, 0);\n+\tdata->ipa_ = IPAManager::createIPA<IPAProxyVimc>(this, 0, 0);\n \tif (data->ipa_ != nullptr) {\n \t\tstd::string conf = data->ipa_->configurationFile(\"vimc.conf\");\n \t\tdata->ipa_->init(IPASettings{ conf });\n","prefixes":["libcamera-devel","v4","27/37"]}