From patchwork Fri Apr 28 13:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18574 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 F0A36C0DA4 for ; Fri, 28 Apr 2023 13:12:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B715627DF; Fri, 28 Apr 2023 15:12:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682687544; bh=oS3rT18oaIed89ep3j+qHKgGq8VZsSepf2WT4kHTPWs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Aovp9aCVce+t/3F6eioYcCL9p1LS+p2EW3JRx9rKfhovluNPQ/yuD7Ax/EFxNNoiv W5KMsmhc+6Fqb5qlESNfzdF6riBGbcqY9Vq7DbFdH67VClPuUMJyEpLvvsWdcP8LXN OMuHPtJy+gXiDMquDHaYNmvYttnzKQj/mlMMvVsDcp5yJetOACDoK8DrqGfiww4puN 7/Po4nB2XK3aPQ2gx5d51rlF2oUJRRMyMmhm8NRnd4pAvpZDzrST8+P9mmN1GGqoUp yK7/XJKaz0nVDZ+aGzxR/h3oFKAPITN7wrDnCP/GoQu1UnmtKJ5EZuMk/wdMCe0xhE Ioic6wVBvQ8BQ== Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E418A627D3 for ; Fri, 28 Apr 2023 15:12:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IlcH4q7s"; dkim-atps=neutral Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f315712406so60611545e9.0 for ; Fri, 28 Apr 2023 06:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1682687542; x=1685279542; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=h1lFjPbiMqJTKRECSgMj+LS5hRQddX/zGUH2+BdDIbg=; b=IlcH4q7s3tCq6Jt0Spu+8B7DnbeGJ6pAzKDABfuo8lj1d4hl5J+Ez9sxZppfmx1NGK DhmHh3ZDQUQjQVMUTZgEXh/jQH5yqyskKVj0xMeUvdqdgylvGu2NNX55YzQlZarUelDO 93SoL/pjni6PArG8mTe/w+xJYmsoyfAqKN22JsMyMSreDFn0zy1GEWbdyHuX6eN1EYUR 8/+x4SuO/DDzauvfbDe/n3Q9R4Zk+/JB7cwsohg3I8EsbKGOgyozxahAQHcCs4v+EPW1 sPZVXOUaHPpoCsstPt7bUm82p20b/u5EVayy+hE/74vj512mJbCCSNpHWC78lR+Cb8qz uT6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682687542; x=1685279542; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=h1lFjPbiMqJTKRECSgMj+LS5hRQddX/zGUH2+BdDIbg=; b=FzNdfg3YljEvC0xGTbZ56qQ7fnVjSBJhKkpnVVo4kumxdeWa5FAFRO1FmBTZpQT0uq FbMVeZUeIQSZOvPFbYZ9zqL0sFgvtwFrCDb9sxffpG/pX6r64zDNxLe1z3ZsEy+MMmBi cssvFgRJ+xvXdfTXoQmR5tMd94kjPmi6uYMw1fBOkX6r0JtzfUC7x/po3xT2LgktwuH6 BX0imsDemznvOeHC4IzpPDbt91ZTTXvpKNNgsURHH//L5Iq6cgRp1zEqkd7+uFQUauSy GpaQ5INHewRiIwBRkbyzOzQU6nVE7tJZdlhFwqnZla2mrSa8xWPv1uf5CAyi9jE99exX qGDw== X-Gm-Message-State: AC+VfDwhOWMg6zLzBncL/6BpQ4iTwQZzGTlw6z2AcaS9sXcdfDsVx2yv 4R6WzOKX/0XTd1nZeGi7w2vMQufPT44DLuCmXdPMaw== X-Google-Smtp-Source: ACHHUZ6etNcjlM4K6x16WTIrZeWtHEO2JgBcO2o+fOBylOVRod/MIuBTGQLDzR6RfOgq6Le67gxV6w== X-Received: by 2002:adf:f012:0:b0:2fa:2f1e:c1a8 with SMTP id j18-20020adff012000000b002fa2f1ec1a8mr7513337wro.3.1682687542123; Fri, 28 Apr 2023 06:12:22 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id y4-20020adffa44000000b002f013fb708fsm21411463wrr.4.2023.04.28.06.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 06:12:21 -0700 (PDT) To: Laurent Pinchart via libcamera-devel Date: Fri, 28 Apr 2023 14:12:15 +0100 Message-Id: <20230428131215.16070-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] DNI: Allow nested IPA builds 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" ONLY FOR TESTING! --- Hi Laurent, Here is an attempt at allowing the IPAs to be built within nested directories. It seems to do the trick, but you might be better suited to do something cleaner if desired. Regards, Naush src/ipa/ipu3/meson.build | 2 ++ src/ipa/meson.build | 33 +++++++++++++++++++-------------- src/ipa/rkisp1/meson.build | 2 ++ src/ipa/rpi/meson.build | 14 ++++++++++++++ 4 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 src/ipa/rpi/meson.build diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build index 658e7c9bc366..66c398432d43 100644 --- a/src/ipa/ipu3/meson.build +++ b/src/ipa/ipu3/meson.build @@ -29,3 +29,5 @@ if ipa_sign_module install : false, build_by_default : true) endif + +ipa_names += ipa_name diff --git a/src/ipa/meson.build b/src/ipa/meson.build index 0c622c38a4a0..ca7fc90e21e0 100644 --- a/src/ipa/meson.build +++ b/src/ipa/meson.build @@ -36,34 +36,39 @@ if get_option('test') and 'vimc' not in ipa_modules endif enabled_ipa_modules = [] - -# If the Raspberry Pi VC4 IPA is enabled, ensure we include the cam_helper, -# common and controller subdirectories in the build. -# -# This is done here and not within rpi/vc4/meson.build as meson does not -# allow the subdir command to traverse up the directory tree. -if pipelines.contains('rpi/vc4') - subdir('rpi/cam_helper') - subdir('rpi/common') - subdir('rpi/controller') -endif +enabled_ipa_names = [] +ipa_names = [] # The ipa-sign-install.sh script which uses the ipa_names variable will itself # prepend MESON_INSTALL_DESTDIR_PREFIX to each ipa module name, therefore we # must not include the prefix string here. + +subdirs = [] foreach pipeline : pipelines if ipa_modules.contains(pipeline) - subdir(pipeline) - ipa_names += ipa_install_dir / ipa_name + '.so' enabled_ipa_modules += pipeline + + # Allow multi-level directory structuring for the IPAs if needed. + # An example would be the Raspberry Pi IPA (rpi). + pipeline = pipeline.split('/')[0] + if pipeline in subdirs + continue + endif + + subdir(pipeline) + subdirs += [pipeline] endif endforeach +foreach ipa_name : ipa_names + enabled_ipa_names += ipa_install_dir / ipa_name + '.so' +endforeach + if ipa_sign_module # Regenerate the signatures for all IPA modules. We can't simply install the # .sign files, as meson strips the DT_RPATH and DT_RUNPATH from binaries at # install time, which invalidates the signatures. meson.add_install_script('ipa-sign-install.sh', ipa_priv_key.full_path(), - ipa_names) + enabled_ipa_names) endif diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build index ccb84b27525b..e813da53ae9b 100644 --- a/src/ipa/rkisp1/meson.build +++ b/src/ipa/rkisp1/meson.build @@ -29,3 +29,5 @@ if ipa_sign_module install : false, build_by_default : true) endif + +ipa_names += ipa_name diff --git a/src/ipa/rpi/meson.build b/src/ipa/rpi/meson.build new file mode 100644 index 000000000000..4811c76f3f9e --- /dev/null +++ b/src/ipa/rpi/meson.build @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: CC0-1.0 + +subdir('cam_helper') +subdir('common') +subdir('controller') + +foreach pipeline : pipelines + pipeline = pipeline.split('/') + if pipeline.length() < 2 or pipeline[0] != 'rpi' + continue + endif + + subdir(pipeline[1]) +endforeach