From patchwork Fri Nov 6 10:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10372 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 7E320BDB89 for ; Fri, 6 Nov 2020 10:38:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4855262D25; Fri, 6 Nov 2020 11:38:14 +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="iwQu1KUp"; 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 6141462D22 for ; Fri, 6 Nov 2020 11:38:13 +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 CC5ABB16; Fri, 6 Nov 2020 11:38:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604659093; bh=payW1DbDLSPMi7lfYd/f1U8V3uc5yyN16GTKuh/Bkbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iwQu1KUpTJgNk3/3NDsGU7ewGjybKKmJ94VpLZgrfBQSUhlZPM+ta9ZDz1oVsLUsN QME4ctJp1zYf0tgdG8BWPHYBXD7nIDXrTOg939OZeDDmmnMp6Q7b8iCs2CVr+2g3H7 5iPSlygiOy7UpnrnpWU2RtHHLD8hi8Z+Ixae8Wmo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Nov 2020 19:36:54 +0900 Message-Id: <20201106103707.49660-25-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 24/37] ipa: Add core.mojom 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" Add a base mojom file to contain empty mojom definitions of libcamera objects, as well as documentation for the IPA interfaces that need to be defined in the mojom files. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v4: - move docs to IPA guide Changes in v3: - add doc that structs need to be defined - add doc to recommend namespacing - change indentation - add requirement that base controls *must* be defined in libcamera::{pipeline_name}::Controls New in v2 --- include/libcamera/ipa/core.mojom | 18 ++++++++++++++++++ include/libcamera/ipa/meson.build | 18 +++++++++++++++--- src/libcamera/proxy/meson.build | 2 +- src/libcamera/proxy/worker/meson.build | 2 +- 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 include/libcamera/ipa/core.mojom diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom new file mode 100644 index 00000000..ed26aaad --- /dev/null +++ b/include/libcamera/ipa/core.mojom @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +/* + * Any libcamera objects that are used by any interfaces must be declared + * here, and a de/serializer be implemented in IPADataSerializer. In addition, + * the corresponding header file (or forward-declarations) must be placed in + * {pipeline_name}.h. + * + * For libcamera types, the [hasFd] attribute is needed to notify the compiler + * that the struct embeds a FileDescriptor. + */ +struct CameraSensorInfo {}; +struct ControlInfoMap {}; +struct ControlList {}; +struct FileDescriptor {}; +[hasFd] struct IPABuffer {}; +struct IPASettings {}; +struct IPAStream {}; diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build index d7a2b6b2..b7caec95 100644 --- a/include/libcamera/ipa/meson.build +++ b/include/libcamera/ipa/meson.build @@ -13,6 +13,17 @@ install_headers(libcamera_ipa_headers, # Prepare IPA/IPC generation components # +core_mojom_file = 'core.mojom' +ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module', + input : core_mojom_file, + output : core_mojom_file + '-module', + command : [ + mojom_parser, + '--output-root', meson.build_root(), + '--input-root', meson.source_root(), + '--mojoms', '@INPUT@' + ]) + ipa_mojom_files = [] ipa_mojoms = [] @@ -30,6 +41,7 @@ foreach file : ipa_mojom_files mojom = custom_target(file.split('.')[0] + '_mojom_module', input : file, output : file + '-module', + depends : ipa_mojom_core, command : [ mojom_parser, '--output-root', meson.build_root(), @@ -41,7 +53,7 @@ foreach file : ipa_mojom_files header = custom_target(name + '_ipa_interface_h', input : mojom, output : name + '_ipa_interface.h', - depends : mojom_templates, + depends : [mojom_templates, ipa_mojom_core], command : [ mojom_generator, 'generate', '-g', 'libcamera', @@ -55,7 +67,7 @@ foreach file : ipa_mojom_files serializer = custom_target(name + '_ipa_serializer_h', input : mojom, output : name + '_ipa_serializer.h', - depends : mojom_templates, + depends : [mojom_templates, ipa_mojom_core], command : [ mojom_generator, 'generate', '-g', 'libcamera', @@ -69,7 +81,7 @@ foreach file : ipa_mojom_files proxy_header = custom_target(name + '_proxy_h', input : mojom, output : 'ipa_proxy_' + name + '.h', - depends : mojom_templates, + depends : [mojom_templates, ipa_mojom_core], command : [ mojom_generator, 'generate', '-g', 'libcamera', diff --git a/src/libcamera/proxy/meson.build b/src/libcamera/proxy/meson.build index ac68ad08..f27b453a 100644 --- a/src/libcamera/proxy/meson.build +++ b/src/libcamera/proxy/meson.build @@ -10,7 +10,7 @@ foreach mojom : ipa_mojoms proxy = custom_target(mojom['name'] + '_proxy_cpp', input : mojom['mojom'], output : 'ipa_proxy_' + mojom['name'] + '.cpp', - depends : [mojom_templates], + depends : [mojom_templates, ipa_mojom_core], command : [ mojom_generator, 'generate', '-g', 'libcamera', diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build index 8e0b978a..628bb050 100644 --- a/src/libcamera/proxy/worker/meson.build +++ b/src/libcamera/proxy/worker/meson.build @@ -11,7 +11,7 @@ foreach mojom : ipa_mojoms worker = custom_target(mojom['name'] + '_proxy_worker', input : mojom['mojom'], output : 'ipa_proxy_' + mojom['name'] + '_worker.cpp', - depends : [mojom_templates], + depends : [mojom_templates, ipa_mojom_core], command : [ mojom_generator, 'generate', '-g', 'libcamera',