Patch Detail
Show a patch.
GET /api/patches/10359/?format=api
{ "id": 10359, "url": "https://patchwork.libcamera.org/api/patches/10359/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10359/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "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-12-paul.elder@ideasonboard.com>", "date": "2020-11-06T10:36:41", "name": "[libcamera-devel,v4,11/37] meson: ipa, proxy: Generate headers and proxy with mojo", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "dc4f92b48bf70ea420b88d4a319580c7b68e7c1b", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10359/mbox/", "series": [ { "id": 1448, "url": "https://patchwork.libcamera.org/api/series/1448/?format=api", "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/10359/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10359/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 2BD3ABDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 6 Nov 2020 10:37:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ECDAA62D26;\n\tFri, 6 Nov 2020 11:37:47 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E01B462D20\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Nov 2020 11:37:46 +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 09C6BB16;\n\tFri, 6 Nov 2020 11:37:44 +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=\"jyPGshyW\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604659066;\n\tbh=Z10yAF5WVfGs3xHbsPYNgVSbijfkSNyNsgkRAW25wpY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jyPGshyW9K4Hq3JM7F1LfKiG8iD6W97ErEfAMFSY1rtN9YxQF63reeQ+94FhWSZqa\n\tZdPMVZTuDA0qDdYCCa1JhvFWak5ASatw+nnpMxkCsO9WQCMqcg3PM+S4rG5gpdf/7m\n\tPMynqX8F4yN5dXDNzzw012CMeQ4Tv+Ope5xWwO9Q=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 6 Nov 2020 19:36:41 +0900", "Message-Id": "<20201106103707.49660-12-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 11/37] meson: ipa,\n\tproxy: Generate headers and proxy with mojo", "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": "Run mojo from meson to generate the header, serializer, and proxy files\nfor every pipeline's mojom data definition file.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v4:\n- rename module_generated.h.tmpl to module_ipa_interface.h.tmpl\n- rename module_serializer.h.tmpl to module_ipa_serializer.h.tmpl\n- rename libcamera_generated headers to libcamera_generated_ipa_headers\n in meson\n\nChanges in v3:\n- change parser path to our wrapper parser script, instead of running\n mojo's directly\n\nChanges in v2:\n- clean up loops\n- remove non-literal keys in maps\n- move loading the mojom scripts to utils/\n- declare the template files in meson\n- add the generated headers into libcamera_generated_headers instead of\n libcamera_internal_headers\n- add libcamera_generated_headers to libcamera_sources\n---\n include/libcamera/ipa/meson.build | 78 +++++++++++++++++++\n src/libcamera/meson.build | 1 +\n src/libcamera/proxy/meson.build | 18 +++++\n src/libcamera/proxy/worker/meson.build | 19 ++++-\n .../libcamera_templates/meson.build | 11 +++\n utils/ipc/generators/meson.build | 3 +\n utils/ipc/meson.build | 13 ++++\n 7 files changed, 141 insertions(+), 2 deletions(-)\n create mode 100644 utils/ipc/generators/libcamera_templates/meson.build\n create mode 100644 utils/ipc/generators/meson.build", "diff": "diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\nindex 508c6bd1..d7a2b6b2 100644\n--- a/include/libcamera/ipa/meson.build\n+++ b/include/libcamera/ipa/meson.build\n@@ -8,3 +8,81 @@ libcamera_ipa_headers = files([\n \n install_headers(libcamera_ipa_headers,\n subdir: join_paths(libcamera_include_dir, 'ipa'))\n+\n+#\n+# Prepare IPA/IPC generation components\n+#\n+\n+ipa_mojom_files = []\n+\n+ipa_mojoms = []\n+\n+#\n+# Generate headers from templates.\n+#\n+\n+libcamera_generated_ipa_headers = []\n+\n+foreach file : ipa_mojom_files\n+ name = file.split('.')[0]\n+\n+ # {pipeline}.mojom-module\n+ mojom = custom_target(file.split('.')[0] + '_mojom_module',\n+ input : file,\n+ output : file + '-module',\n+ command : [\n+ mojom_parser,\n+ '--output-root', meson.build_root(),\n+ '--input-root', meson.source_root(),\n+ '--mojoms', '@INPUT@'\n+ ])\n+\n+ # {pipeline}_generated.h\n+ header = custom_target(name + '_ipa_interface_h',\n+ input : mojom,\n+ output : name + '_ipa_interface.h',\n+ depends : mojom_templates,\n+ command : [\n+ mojom_generator, 'generate',\n+ '-g', 'libcamera',\n+ '--bytecode_path', mojom_templates_dir,\n+ '--libcamera_generate_header',\n+ '--libcamera_output_path=@OUTPUT@',\n+ './' +'@INPUT@'\n+ ])\n+\n+ # {pipeline}_serializer.h\n+ serializer = custom_target(name + '_ipa_serializer_h',\n+ input : mojom,\n+ output : name + '_ipa_serializer.h',\n+ depends : mojom_templates,\n+ command : [\n+ mojom_generator, 'generate',\n+ '-g', 'libcamera',\n+ '--bytecode_path', mojom_templates_dir,\n+ '--libcamera_generate_serializer',\n+ '--libcamera_output_path=@OUTPUT@',\n+ './' +'@INPUT@'\n+ ])\n+\n+ # ipa_proxy_{pipeline}.h\n+ proxy_header = custom_target(name + '_proxy_h',\n+ input : mojom,\n+ output : 'ipa_proxy_' + name + '.h',\n+ depends : mojom_templates,\n+ command : [\n+ mojom_generator, 'generate',\n+ '-g', 'libcamera',\n+ '--bytecode_path', mojom_templates_dir,\n+ '--libcamera_generate_proxy_h',\n+ '--libcamera_output_path=@OUTPUT@',\n+ './' +'@INPUT@'\n+ ])\n+\n+ ipa_mojoms += {\n+ 'name': name,\n+ 'mojom': mojom,\n+ }\n+\n+ libcamera_generated_ipa_headers += [header, serializer, proxy_header]\n+endforeach\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex d6bd9a05..9c889a4f 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -58,6 +58,7 @@ libcamera_sources = files([\n ])\n \n libcamera_sources += libcamera_public_headers\n+libcamera_sources += libcamera_generated_ipa_headers\n libcamera_sources += libcamera_tracepoint_header\n \n includes = [\ndiff --git a/src/libcamera/proxy/meson.build b/src/libcamera/proxy/meson.build\nindex bd804750..ac68ad08 100644\n--- a/src/libcamera/proxy/meson.build\n+++ b/src/libcamera/proxy/meson.build\n@@ -4,3 +4,21 @@ libcamera_sources += files([\n 'ipa_proxy_linux.cpp',\n 'ipa_proxy_thread.cpp',\n ])\n+\n+# generate ipa_proxy_{pipeline}.cpp\n+foreach mojom : ipa_mojoms\n+ proxy = custom_target(mojom['name'] + '_proxy_cpp',\n+ input : mojom['mojom'],\n+ output : 'ipa_proxy_' + mojom['name'] + '.cpp',\n+ depends : [mojom_templates],\n+ command : [\n+ mojom_generator, 'generate',\n+ '-g', 'libcamera',\n+ '--bytecode_path', mojom_templates_dir,\n+ '--libcamera_generate_proxy_cpp',\n+ '--libcamera_output_path=@OUTPUT@',\n+ './' + '@INPUT@'\n+ ])\n+\n+ libcamera_sources += proxy\n+endforeach\ndiff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\nindex ac0310a7..8e0b978a 100644\n--- a/src/libcamera/proxy/worker/meson.build\n+++ b/src/libcamera/proxy/worker/meson.build\n@@ -6,8 +6,23 @@ ipa_proxy_sources = [\n \n proxy_install_dir = join_paths(get_option('libexecdir'), 'libcamera')\n \n-foreach t : ipa_proxy_sources\n- proxy = executable(t[0], t[1],\n+# generate ipa_proxy_{pipeline}_worker.cpp\n+foreach mojom : ipa_mojoms\n+ worker = custom_target(mojom['name'] + '_proxy_worker',\n+ input : mojom['mojom'],\n+ output : 'ipa_proxy_' + mojom['name'] + '_worker.cpp',\n+ depends : [mojom_templates],\n+ command : [\n+ mojom_generator, 'generate',\n+ '-g', 'libcamera',\n+ '--bytecode_path', mojom_templates_dir,\n+ '--libcamera_generate_proxy_worker',\n+ '--libcamera_output_path=@OUTPUT@',\n+ './' + '@INPUT@'\n+ ])\n+\n+ proxy = executable('ipa_proxy_' + mojom['name'],\n+ [worker, libcamera_generated_ipa_headers],\n install : true,\n install_dir : proxy_install_dir,\n dependencies : libcamera_dep)\ndiff --git a/utils/ipc/generators/libcamera_templates/meson.build b/utils/ipc/generators/libcamera_templates/meson.build\nnew file mode 100644\nindex 00000000..d7c9dea7\n--- /dev/null\n+++ b/utils/ipc/generators/libcamera_templates/meson.build\n@@ -0,0 +1,11 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+mojom_template_files = files([\n+ 'module_ipa_interface.h.tmpl',\n+ 'module_ipa_proxy.cpp.tmpl',\n+ 'module_ipa_proxy.h.tmpl',\n+ 'module_ipa_proxy_worker.cpp.tmpl',\n+ 'module_ipa_serializer.h.tmpl',\n+ 'proxy_functions.tmpl',\n+ 'serializer.tmpl',\n+])\ndiff --git a/utils/ipc/generators/meson.build b/utils/ipc/generators/meson.build\nnew file mode 100644\nindex 00000000..504f1a46\n--- /dev/null\n+++ b/utils/ipc/generators/meson.build\n@@ -0,0 +1,3 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+subdir('libcamera_templates')\ndiff --git a/utils/ipc/meson.build b/utils/ipc/meson.build\nindex 59f097f0..4a41b9c1 100644\n--- a/utils/ipc/meson.build\n+++ b/utils/ipc/meson.build\n@@ -1,3 +1,16 @@\n # SPDX-License-Identifier: CC0-1.0\n \n+subdir('generators')\n+\n py_modules += ['jinja2', 'ply']\n+\n+mojom_parser = find_program('./parser.py')\n+\n+mojom_generator = find_program('./generate.py')\n+\n+mojom_templates = custom_target('mojom_templates',\n+ input : mojom_template_files,\n+ output : 'libcamera_templates.zip',\n+ command : [mojom_generator, '-o', '@OUTDIR@', 'precompile'])\n+\n+mojom_templates_dir = meson.current_build_dir()\n", "prefixes": [ "libcamera-devel", "v4", "11/37" ] }