From patchwork Fri Oct 13 07:48:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19137 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 28C71C32B6 for ; Fri, 13 Oct 2023 07:49:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C886C62989; Fri, 13 Oct 2023 09:49:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697183344; bh=M7cvfczoL4R5A+xDn9pwR2p2QJHc8GIJiZGE4EeFT/I=; 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=C7L8NIOShC7K0hhiZ3MB3j+5mvpsX+aeGVNZmk6AIOUG/vmWhkTCos/O2qwV/zefm Hy4mLYwnOX2s3WW5nYhHv4fKDvEzruChdICOGw8c2z5WkT5RALfOud+5xG40B8w2PX FKXbbiTQ53avOwvXz6MONDDnQBP2C9eaogsuvnQC6roPmMoQ/X5hXQktOdya2v4pYW RO3AB3jCYdPC4BBSomXhpBsS1DrahW4zUiHQ7w80r7PHHyeoO1r5pnoSmbuTGPTP3q 7qP+TgLQLm2SiUDtIjpr+KcBUQFm9Z0BxPHBts1UGbNIu4u1zJHvQWqNAsl+WXAR1D Byt8t53sAWDQw== Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A3926297E for ; Fri, 13 Oct 2023 09:48:56 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="mIdvPe+T"; dkim-atps=neutral Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40572aeb673so19437145e9.0 for ; Fri, 13 Oct 2023 00:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697183336; x=1697788136; darn=lists.libcamera.org; 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=D4exOpCTPvbDuxJSbapt0qMAr2YwjKudXo3nibFYFyU=; b=mIdvPe+T5DZxyhHgTRHYTg6r84EszWZ1zFVjZPIZ40nC0MGcoYZLPxIrptLQFTsWW2 s8fSQU8ccRw67pqlVCwpiqKMwJoV+eEVzZXEqmK4GFIW+c1hNzbGj/Y4/BPoZvVCY1T5 teEa2lkRIYswvM1jHTUVafUGbS638rxPazcD6tdxFMrsZVuumcpifAoKYZyeROLxi+V2 E8EO7bwOmN2EL/wSUWWg69OMqmd0cCAGTqcEpjqiE6WGYawlJv9/BduZX17RnPln50TZ vjMkdcKuk2QOj8vccGQLJd/BPh/cX6F3Zg83CihL2NzFoot4RL4QsV5IMrVA7DiU1juy XKbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183336; x=1697788136; 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=D4exOpCTPvbDuxJSbapt0qMAr2YwjKudXo3nibFYFyU=; b=ZVGN029XeM8U1pIhe9TO+377qqtana8pp53PFTkQOpGbZCAMtnW1Vm46Ks85Zjgq3T doBekFXBgNg9QlHKoLWWd0b5woTX0rlgSBbMVEnw+fQSZE1u0HJtWYCCswDsVDUoYWEt PNu2u8pk8zHCvvitY29DTnYQA2heky0JshP/ZnQy42UX0a4gy55kbI350Fc+g9y+CGCC jj8Hc+5EO3klzF3TNmKcRm+ZgSmuUjDG+nLWZXERjne1wEeqUW+sEaJ+wcMWp+IHM6oY MKPuzYxqTT6Y8zz70z/KP8PE025j10o8dyKtkPWS+Ug5EDHIID1+S5bRvC4bQxppbxrX iaiA== X-Gm-Message-State: AOJu0Yz5sX40FFK6ClxDv7iWNB+9OcOvHSDt4gxTq1GLhW1gLMKVoxP0 FqIJvAt8QO2DAfeuLep4f5dOzWdojo4xvHLWI4jy3g== X-Google-Smtp-Source: AGHT+IH6zsrEcNFZTxNFOChmQ9s/KKMyLFCkbqY/0l8CUQBkrVGr8avfgOkkwqKR5Qp4ZZfq6oluvQ== X-Received: by 2002:a05:600c:2197:b0:406:5227:86f0 with SMTP id e23-20020a05600c219700b00406522786f0mr21550523wme.5.1697183335808; Fri, 13 Oct 2023 00:48:55 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m16-20020a7bca50000000b003fee6e170f9sm1791890wml.45.2023.10.13.00.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:48:55 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 13 Oct 2023 08:48:34 +0100 Message-Id: <20231013074841.16972-14-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013074841.16972-1-naush@raspberrypi.com> References: <20231013074841.16972-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 13/20] build: ipa: Fix bug in building multiple IPA interfaces with the same mojom 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" In the existing meson scripts, an IPA mojom interface file may not be built if: - There are duplicate entries for the mojom file shared by different pipeline handlers in pipeline_ipa_mojom_mapping, and - The IPA is not listed first in pipeline_ipa_mojom_mapping, and - The first listed IPA for the given mojom file is not selected in the build. Fix this by using a separate list of already built mojom files (mojoms_built) instead of overloading use of the existing ipa_mojom_files list. Now, ipa_mojom_files gets filled in outside of the IPA list enumeration loop, this also guarantees the IPA documentation gets built even if the pipeline is not selected. Fixes: 312e9910ba2e ("meson: ipa: Add mapping for pipeline handler to mojom interface file") Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- include/libcamera/ipa/meson.build | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/include/libcamera/ipa/meson.build b/include/libcamera/ipa/meson.build index e72803b4e243..f3b4881c9c91 100644 --- a/include/libcamera/ipa/meson.build +++ b/include/libcamera/ipa/meson.build @@ -68,29 +68,28 @@ pipeline_ipa_mojom_mapping = { 'vimc': 'vimc.mojom', } -ipa_mojom_files = [] -ipa_mojoms = [] - # # Generate headers from templates. # # TODO Define per-pipeline ControlInfoMap with yaml? +ipa_mojoms = [] +mojoms_built = [] foreach pipeline, file : pipeline_ipa_mojom_mapping name = file.split('.')[0] - # Ensure we do not build duplicate mojom modules - if file in ipa_mojom_files + # Avoid building duplicate mojom interfaces with the same interface file + if name in mojoms_built continue endif - ipa_mojom_files += file - if pipeline not in pipelines continue endif + mojoms_built += name + # {interface}.mojom-module mojom = custom_target(name + '_mojom_module', input : file, @@ -155,6 +154,12 @@ foreach pipeline, file : pipeline_ipa_mojom_mapping libcamera_generated_ipa_headers += [header, serializer, proxy_header] endforeach +ipa_mojom_files = [] +foreach pipeline, file : pipeline_ipa_mojom_mapping + if file not in ipa_mojom_files + ipa_mojom_files += file + endif +endforeach ipa_mojom_files = files(ipa_mojom_files) # Pass this to the documentation generator in src/libcamera/ipa