From patchwork Wed Apr 26 13:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18549 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 7A3F0BDCBD for ; Wed, 26 Apr 2023 13:13:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 07BFA627E3; Wed, 26 Apr 2023 15:13:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682514794; bh=+OAnu+Axde/BMS9n1Q6b1MB3Ox2AkYx1tR/z6tYFUkw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=b/44w4q6+7Qt/tgFmmnN5k2/qS5Cw93bMm7OmGSpuQiI+n27AqTHK4KcAN4sttsEQ 2py5yqIYFH/n8cPPQZnXzHLRENT8SSzfj69x4NkfHLVn4675EwifJilXQiB3u8+dd+ uZvZ7E4QLGvzCX2JJ7dt8fEmEeMsZ7b9olz3roHU09ceY9+zO7+JfHBKUCEMNFsswx W2TMYyX3ZtGhrAsnsrJdr7GHwUoFsEqocRBmSEcxCJPWb9dgIFgoBa1oOaN5Snb5Tm BcAAa3bxdTgjGsBRo7wy7UzMQ2apnA7AxFMsYakPlTeOLdH++a5H8AeMrJbsvJxwP7 l0NJ96vXtTGeA== Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8AA94627D6 for ; Wed, 26 Apr 2023 15:13:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Hzj3PBJr"; dkim-atps=neutral Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f196e8e2c6so52626715e9.1 for ; Wed, 26 Apr 2023 06:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1682514791; x=1685106791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5a8LR0uxpT9CI908IO5AGVgppN0gjMdZsaYRnh9qcDc=; b=Hzj3PBJrKbWlLoVY48yAtPyNEDZIaHFnQ55V+iFtVsGkF10sQRdfjbkEZWVJdCkeLo Mqq2aetNs61QeeLBpPHeRaqzHP5BIIrVBQdh0A5ifG6ckIK/EYqX19W1nR1j1f0eParu EIFA7EW+uAPXSesCCVK9MAaA5+/9sY4JnLIPaFTOuP0q7L0vUOp8V7ZW/SalqnnYPFB3 5yPqHXbQGw5DlKEVR9ZGlOdn6WCQDdKgw4n20G8WObe77kUTJ0TOUAgrmvUbr2NmLG6t Yigilm2ewhcwM+/DfE8HQUl8Qal5yIA2fiVB8qKTlcOeXCP3d7TDx42teAgdopqtAfHS DRRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682514791; x=1685106791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5a8LR0uxpT9CI908IO5AGVgppN0gjMdZsaYRnh9qcDc=; b=Pt/LNkm1AsqhJRNPfHmH1I1LDcHA/yZFxe+Xbajgvz9TvshofhfH3w34+zK6QA1Flf pp02h+ouTwuSv+BD3Nt8jTdv8qRPNUJYQb8HwPo4aBfd4n+BWZVd5n1+A51CdsbI4RUG 5uMIyp/h/RWaNT/fGeNlDQbfiHcXCppOQ6JipTF0VkfB03F6uSTuRldpEb6VrYkJpmM0 IVN7Dzo6SlsyrQsgT49OYEcbWv0XwG1pWSUFCF97ImR5QlM39o8aeP2PkrB9PyXyitJB exAP+X3egNyEmIrA+wQbW1SEkgQEKQRZhuDnI/qzXU7gPicll2gsX+Pi61XogKRZhumS KrBA== X-Gm-Message-State: AAQBX9cmf0AHUZnPsVmapc3K+68t4zxo6mf6wQjvhIHoA29nFtuR/Crl tAFv7COykAXfurWLlG/Muujwy6B/JbQC6lgZQrAUnA== X-Google-Smtp-Source: AKy350a/OvOwyDnxYbkhSTDSz4tjqbFZP3KekBiHaPr8zYlm+L2eh7S7n69o40gsiYjZd2H2K0twjw== X-Received: by 2002:a5d:55cf:0:b0:2ff:613c:af5d with SMTP id i15-20020a5d55cf000000b002ff613caf5dmr13801454wrw.36.1682514790841; Wed, 26 Apr 2023 06:13:10 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b002f103ca90cdsm15780949wrp.101.2023.04.26.06.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 06:13:10 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 26 Apr 2023 14:10:45 +0100 Message-Id: <20230426131057.21550-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426131057.21550-1-naush@raspberrypi.com> References: <20230426131057.21550-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 01/13] meson: ipa: Add mapping for pipeline handler to mojom interface file 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Allow an arbitrary mapping between the pipeline handler and IPA mojom interface file in the build system. This removes the 1:1 mapping of pipeline handler name to mojom filename, and allows more flexibility to pipeline developers. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi --- Documentation/guides/ipa.rst | 19 ++++++++-------- include/libcamera/ipa/meson.build | 36 ++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/Documentation/guides/ipa.rst b/Documentation/guides/ipa.rst index fc0317451e24..89839408672a 100644 --- a/Documentation/guides/ipa.rst +++ b/Documentation/guides/ipa.rst @@ -269,35 +269,36 @@ The following is an example of an event interface definition: Compiling the IPA interface --------------------------- -After the IPA interface is defined in include/libcamera/ipa/{pipeline_name}.mojom, +After the IPA interface is defined in include/libcamera/ipa/{interface_name}.mojom, an entry for it must be added in meson so that it can be compiled. The filename -must be added to the ipa_mojom_files object in include/libcamera/ipa/meson.build. +must be added to the pipeline_ipa_mojom_mapping object in include/libcamera/ipa/meson.build. +This object maps the pipeline handler name with an ipa interface file. For example, adding the raspberrypi.mojom file to meson: .. code-block:: none - ipa_mojom_files = [ - 'raspberrypi.mojom', + pipeline_ipa_mojom_mapping = [ + 'raspberrypi': 'raspberrypi.mojom', ] This will cause the mojo data definition file to be compiled. Specifically, it generates five files: - a header describing the custom data structures, and the complete IPA - interface (at {$build_dir}/include/libcamera/ipa/{pipeline}_ipa_interface.h) + interface (at {$build_dir}/include/libcamera/ipa/{interface}_ipa_interface.h) - a serializer implementing de/serialization for the custom data structures (at - {$build_dir}/include/libcamera/ipa/{pipeline}_ipa_serializer.h) + {$build_dir}/include/libcamera/ipa/{interface}_ipa_serializer.h) - a proxy header describing a specialized IPA proxy (at - {$build_dir}/include/libcamera/ipa/{pipeline}_ipa_proxy.h) + {$build_dir}/include/libcamera/ipa/{interface}_ipa_proxy.h) - a proxy source implementing the IPA proxy (at - {$build_dir}/src/libcamera/proxy/{pipeline}_ipa_proxy.cpp) + {$build_dir}/src/libcamera/proxy/{interface}_ipa_proxy.cpp) - a proxy worker source implementing the other end of the IPA proxy (at - {$build_dir}/src/libcamera/proxy/worker/{pipeline}_ipa_proxy_worker.cpp) + {$build_dir}/src/libcamera/proxy/worker/{interface}_ipa_proxy_worker.cpp) The IPA proxy serves as the layer between the pipeline handler and the IPA, and handles threading vs isolation transparently. The pipeline handler and the IPA diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build index 442ca3dd7e1c..67c31cb04ccf 100644 --- a/include/libcamera/ipa/meson.build +++ b/include/libcamera/ipa/meson.build @@ -60,13 +60,15 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h', './' +'@INPUT@' ]) -ipa_mojom_files = [ - 'ipu3.mojom', - 'raspberrypi.mojom', - 'rkisp1.mojom', - 'vimc.mojom', -] - +# Mapping from pipeline handler name to mojom file +pipeline_ipa_mojom_mapping = { + 'ipu3': 'ipu3.mojom', + 'rkisp1': 'rkisp1.mojom', + 'raspberrypi': 'raspberrypi.mojom', + 'vimc': 'vimc.mojom', +} + +ipa_mojom_files = [] ipa_mojoms = [] # @@ -75,14 +77,22 @@ ipa_mojoms = [] # TODO Define per-pipeline ControlInfoMap with yaml? -foreach file : ipa_mojom_files +foreach pipeline, file : pipeline_ipa_mojom_mapping + name = file.split('.')[0] - if name not in pipelines + # Ensure we do not build duplicate mojom modules + if (file in ipa_mojom_files) + continue + endif + + ipa_mojom_files += file + + if pipeline not in pipelines continue endif - # {pipeline}.mojom-module + # {interface}.mojom-module mojom = custom_target(name + '_mojom_module', input : file, output : file + '-module', @@ -94,7 +104,7 @@ foreach file : ipa_mojom_files '--mojoms', '@INPUT@' ]) - # {pipeline}_ipa_interface.h + # {interface}_ipa_interface.h header = custom_target(name + '_ipa_interface_h', input : mojom, output : name + '_ipa_interface.h', @@ -110,7 +120,7 @@ foreach file : ipa_mojom_files './' +'@INPUT@' ]) - # {pipeline}_ipa_serializer.h + # {interface}_ipa_serializer.h serializer = custom_target(name + '_ipa_serializer_h', input : mojom, output : name + '_ipa_serializer.h', @@ -124,7 +134,7 @@ foreach file : ipa_mojom_files './' +'@INPUT@' ]) - # {pipeline}_ipa_proxy.h + # {interface}_ipa_proxy.h proxy_header = custom_target(name + '_proxy_h', input : mojom, output : name + '_ipa_proxy.h',