[{"id":14286,"web_url":"https://patchwork.libcamera.org/comment/14286/","msgid":"<X9zbT80G/32rznWw@wyvern>","date":"2020-12-18T16:39:43","subject":"Re: [libcamera-devel] [PATCH v5 15/23] ipa: Add core.mojom","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Paul,\n\nThanks for your patch.\n\nOn 2020-12-05 19:30:58 +0900, Paul Elder wrote:\n> Add a base mojom file to contain empty mojom definitions of libcamera\n> objects, as well as documentation for the IPA interfaces that need to be\n> defined in the mojom files.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> \n> ---\n> Changes in v5:\n> - add todo for defining some libcamera ipa structs in mojom\n> - remove ipa_mojom_core from dependencies of everything in the generator\n>   stage\n> - add documentation for the base IPA functions (init, stop, start)\n> \n> Changes in v4:\n> - move docs to IPA guide\n> \n> Changes in v3:\n> - add doc that structs need to be defined\n> - add doc to recommend namespacing\n> - change indentation\n> - add requirement that base controls *must* be defined in\n>   libcamera::{pipeline_name}::Controls\n> \n> New in v2\n> ---\n>  include/libcamera/ipa/core.mojom       | 48 ++++++++++++++++++++++++++\n>  include/libcamera/ipa/meson.build      | 14 +++++++-\n>  src/libcamera/proxy/meson.build        |  4 +--\n>  src/libcamera/proxy/worker/meson.build |  4 +--\n>  4 files changed, 65 insertions(+), 5 deletions(-)\n>  create mode 100644 include/libcamera/ipa/core.mojom\n> \n> diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\n> new file mode 100644\n> index 00000000..95d12b63\n> --- /dev/null\n> +++ b/include/libcamera/ipa/core.mojom\n> @@ -0,0 +1,48 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +\n> +/*\n> + * Any libcamera objects that are used by any interfaces that aren't defined\n> + * in mojom must be declared here, and a (de)serializer be implemented as a\n> + * template specialization of IPADataSerializer. In addition, the corresponding\n> + * header file (or forward-declarations) must be included in {pipeline_name}.h.\n> + *\n> + * For libcamera types, the [hasFd] attribute is needed to notify the compiler\n> + * that the struct embeds a FileDescriptor.\n> + */\n> +struct CameraSensorInfo {};\n> +struct ControlInfoMap {};\n> +struct ControlList {};\n> +struct FileDescriptor {};\n> +\n> +/* \\todo Define these structures fully in mojom. */\n> +[hasFd] struct IPABuffer {};\n> +struct IPASettings {};\n> +struct IPAStream {};\n> +\n> +/**\n> + * \\fn init()\n> + * \\brief Initialise the IPAInterface\n> + * \\param[in] settings The IPA initialization settings\n> + *\n> + * This function initializes the IPA interface. It shall be called before any\n> + * other function of the IPAInterface. The \\a settings carry initialization\n> + * parameters that are valid for the whole life time of the IPA interface.\n> + */\n> +\n> +/**\n> + * \\fn start()\n> + * \\brief Start the IPA\n> + *\n> + * This method informs the IPA module that the camera is about to be started.\n> + * The IPA module shall prepare any resources it needs to operate.\n> + *\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +\n> +/**\n> + * \\fn stop()\n> + * \\brief Stop the IPA\n> + *\n> + * This method informs the IPA module that the camera is stopped. The IPA module\n> + * shall release resources prepared in start().\n> + */\n> diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build\n> index d7a2b6b2..087f5bbd 100644\n> --- a/include/libcamera/ipa/meson.build\n> +++ b/include/libcamera/ipa/meson.build\n> @@ -13,6 +13,17 @@ install_headers(libcamera_ipa_headers,\n>  # Prepare IPA/IPC generation components\n>  #\n>  \n> +core_mojom_file = 'core.mojom'\n> +ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module',\n> +                               input : core_mojom_file,\n> +                               output : core_mojom_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>  ipa_mojom_files = []\n>  \n>  ipa_mojoms = []\n> @@ -30,6 +41,7 @@ foreach file : ipa_mojom_files\n>      mojom = custom_target(file.split('.')[0] + '_mojom_module',\n>                            input : file,\n>                            output : file + '-module',\n> +                          depends : ipa_mojom_core,\n>                            command : [\n>                                mojom_parser,\n>                                '--output-root', meson.build_root(),\n> @@ -68,7 +80,7 @@ foreach file : ipa_mojom_files\n>      # ipa_proxy_{pipeline}.h\n>      proxy_header = custom_target(name + '_proxy_h',\n>                                   input : mojom,\n> -                                 output : 'ipa_proxy_' + name + '.h',\n> +                                 output : name + '_ipa_proxy.h',\n>                                   depends : mojom_templates,\n>                                   command : [\n>                                       mojom_generator, 'generate',\n> diff --git a/src/libcamera/proxy/meson.build b/src/libcamera/proxy/meson.build\n> index 5965589f..a3f6b223 100644\n> --- a/src/libcamera/proxy/meson.build\n> +++ b/src/libcamera/proxy/meson.build\n> @@ -4,8 +4,8 @@\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> +                          output : mojom['name'] + '_ipa_proxy.cpp',\n> +                          depends : mojom_templates,\n>                            command : [\n>                                mojom_generator, 'generate',\n>                                '-g', 'libcamera',\n> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n> index f3129b76..cc55078f 100644\n> --- a/src/libcamera/proxy/worker/meson.build\n> +++ b/src/libcamera/proxy/worker/meson.build\n> @@ -6,8 +6,8 @@ proxy_install_dir = join_paths(get_option('libexecdir'), 'libcamera')\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> +                           output : mojom['name'] + '_ipa_proxy_worker.cpp',\n> +                           depends : mojom_templates,\n>                             command : [\n>                                 mojom_generator, 'generate',\n>                                 '-g', 'libcamera',\n> -- \n> 2.27.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 D6BB8BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Dec 2020 16:39:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4AE3C61597;\n\tFri, 18 Dec 2020 17:39:49 +0100 (CET)","from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 886B56052C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 17:39:47 +0100 (CET)","by mail-lf1-x142.google.com with SMTP id a9so7030221lfh.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Dec 2020 08:39:47 -0800 (PST)","from localhost ([185.224.57.161]) by smtp.gmail.com with ESMTPSA id\n\ta7sm979292lfg.243.2020.12.18.08.39.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 18 Dec 2020 08:39:46 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"TRii7nCb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=kvVBWA5xptI+WkPrqfSKUH0DzzBnM5E3haKhYlDARac=;\n\tb=TRii7nCbQ4mmBROU4LRJo5B8axW/iU1HQiT7CZjDlDxkrNjJ4VAuzPhLPM+iDPRvlN\n\tvu7V46vMHiM08o4Cr18EfTh2bZY4Odrplwdor3juIRFYg5Ctnv/WgoEq1VSJQlNqs2YU\n\tFsIQCqqciMy3rgAhI/TVJQHwJ05iJjd91r04tabTtMs847a4EqH5W0rDB8/+IcF/XcYL\n\t8lYhgsLuMcGAKOUdyx86vwFhAo3qobz2kvS1VvHvWEyutU5zZ1/BhvjMYbuCF8vz414e\n\tCbPgBFxc6wfuH7W/+9nwz94nTZAllS9q66FRBsSSezq40RLUGu/5Evf169Yl987neS55\n\tygoQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=kvVBWA5xptI+WkPrqfSKUH0DzzBnM5E3haKhYlDARac=;\n\tb=uT/XCr2Ao1WWMy78vnjuptB9tVDEtPNIUmyXWVOKD7iyV/SiMi9rGcJCJpGWnoexBq\n\te8m8OQr/OpJ5ZXJPRG5mXzBSRpf3DkxffuZ72alZFyvEc93vwYnbliGEwZMn5mlrsHBY\n\tw8WLmB0vQOjzYVvtM/eH3sFXJ8/k7xlJMaiT+jjmg9Jy7Xwz1HofCW4KgxOxWoO7AfDS\n\tW3R6scpA64JJSFq+PjkFPulcUdOUkoavfYxVAzVBPHlYsKlYbydpYPynx/+H0WBqqHOx\n\tOK3Dr+C0BEuInbfJR4bd+XS22ZgedF2aVcbBsehXc3kGlEGIz1d6xqKlrcHAfbPypMGr\n\tDquA==","X-Gm-Message-State":"AOAM5321vv/WhbqrvVU7cwPN4HZVRCsjp5Tobe1r4WmUphSS8eD7B77L\n\twJmXWMJChy9tNTrbR89nU5Qs2w==","X-Google-Smtp-Source":"ABdhPJz/lm2B11av6W9SnVZo5t6htIkKpsLYcC+aFfvBu4I+sEUDloyjhgvxPwcn7mj/u5lU0yFSqw==","X-Received":"by 2002:a19:770c:: with SMTP id\n\ts12mr1821111lfc.367.1608309586982; \n\tFri, 18 Dec 2020 08:39:46 -0800 (PST)","Date":"Fri, 18 Dec 2020 17:39:43 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<X9zbT80G/32rznWw@wyvern>","References":"<20201205103106.242080-1-paul.elder@ideasonboard.com>\n\t<20201205103106.242080-16-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201205103106.242080-16-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v5 15/23] ipa: Add core.mojom","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]