{"id":18588,"url":"https://patchwork.libcamera.org/api/1.1/patches/18588/?format=json","web_url":"https://patchwork.libcamera.org/patch/18588/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230503122035.32026-4-naush@raspberrypi.com>","date":"2023-05-03T12:20:25","name":"[libcamera-devel,03/13] ipa: meson: Allow nested IPA directory structures","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"0e68bab27c5c811b9b0fd62b0f6a7074ac85659e","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18588/mbox/","series":[{"id":3863,"url":"https://patchwork.libcamera.org/api/1.1/series/3863/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3863","date":"2023-05-03T12:20:22","name":"Raspberry Pi: Code refactoring","version":1,"mbox":"https://patchwork.libcamera.org/series/3863/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18588/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18588/checks/","tags":{},"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 8E1B6C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 May 2023 12:20:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D6703633C1;\n\tWed,  3 May 2023 14:20:41 +0200 (CEST)","from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B0FD0627DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 May 2023 14:20:39 +0200 (CEST)","by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-3f315712406so21887755e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 03 May 2023 05:20:39 -0700 (PDT)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf23-20020a7bcd17000000b003ee443bf0c7sm1736785wmj.16.2023.05.03.05.20.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 03 May 2023 05:20:38 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1683116441;\n\tbh=OQkgtB49bpC6kjk1eXz96Ne0yWH0cZ1scVF85P9/Cr8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=QstfLeJ3ykl1tds9uO0B+enUzyhxnFxojd/GPNmOJLDS4sWMkJ2153va9CjhPF+q5\n\tapwrfJ9pxpsG1xGvAOAmpkko8531QgUAixulztM1cBnUoUVaO3FO5Bo4YF4REpEsT2\n\tRuXnUbIlzPXA8n3aoxS4hNHCCydA0b/JKWbJAQ/UcM6z3Nr0feCSvtNpJwVQwmnX+U\n\tlfzOOjuLkwwMBESMh5pmjqoYwi+2rRF3GfB1Nkt+QvtC1+9wb2vxaWwm1xUpIBAqhD\n\toiHFHpdJ5SjPpOAQ3GzB4NwHzJ9BdLrODK/jdpq2Km4P9PjhTONIDWlnjrmpPqz1vR\n\tlwISuDFvPjcdg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1683116439; x=1685708439;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=TOZtiZNotGvI/TxVa/2UVHk+I4BBJa641a7L6mP14W4=;\n\tb=Z6j5h2uuAiljXv2I8LMRQe5xn7ldYDpFSjeuEZkBa4KVTtx14PhXYKJgG7ql2euXmK\n\tulc/cQI20CcYKaSmFGwFoUEJfEPWiD2OJQoPa1gHz6jqHGkwAiTjtDluEivx+n0pQYoX\n\tsO7yoqlYdAcDP4wI1UgRradhvOShF1xORYgI4ksCcXHY3IG3pkH1gJTNyZYqCBTin5at\n\txj9TnTXhpUpe3lcuQrjgna9zQ57eeCBTDlr/W0PtcevN1sUtdtQin5JbS6TOD8GKN2fF\n\tz30hYW8GM0ZFeD82LaNGNA9dUE+MTLXqULAqTSqKPwbkI5tNi8BUshn5iuuDBh4kHxwi\n\tbYfQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Z6j5h2uu\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1683116439; x=1685708439;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=TOZtiZNotGvI/TxVa/2UVHk+I4BBJa641a7L6mP14W4=;\n\tb=jYBy+nQzHmKe9aDQ/w+ggy/PszCt2ay7K8hOgYRKgtZ7Im60gVUHNIjcJI1gbnwLz9\n\tFNfi94JgCc39AGBR2tddKShzZiIB/rctYyB00wpLOEpncJaaz3v6m8KsXU3cJXfodG8/\n\taqr+uSX3zljPi3zXaYIqa/e74RgH/r0rQA6fdvxJUHJEuAPiMjnlVIukK9B4dC9k0mGO\n\t0F9h+tkPr13DA4PvqzhL6f6fJNEF0rHgVe4IHY4U5fWH4m42btQFVUq4hH7sp9P5Z/sK\n\tg0cY/w5qNxJ+gK/ViP9cbSUW/JrxvONvyHccrM99kZarMVK8uxIbjIkV/BYsAYolSgCw\n\tAU5A==","X-Gm-Message-State":"AC+VfDzk+eMKc8AhB0vD3BsyCI7SWdULJVz6OUhROFk4nRKRmGAC589F\n\tqYzv9cGNUv+lfDQlbGAqImzhj2x0nR4PsOBjawhN4g==","X-Google-Smtp-Source":"ACHHUZ6Bu8JzsfClOfy67XL2ZFiAcyhBPS2IJrPIhpGYBq+ApbDwFTA7AzhXwK+H5jDyzDfuW54rSw==","X-Received":"by 2002:a05:600c:4585:b0:3f1:80d0:906b with SMTP id\n\tr5-20020a05600c458500b003f180d0906bmr1469339wmo.4.1683116439060; \n\tWed, 03 May 2023 05:20:39 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  3 May 2023 13:20:25 +0100","Message-Id":"<20230503122035.32026-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230503122035.32026-1-naush@raspberrypi.com>","References":"<20230503122035.32026-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 03/13] ipa: meson: Allow nested IPA\n\tdirectory structures","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The current IPA build files require a flat directory struture for the\nIPAs. Modify the build files to remove this restriction and allow a\ndirectory structure such as:\n\nsrc/ipa\n  |- raspberrypi\n      |- common\n      |- cam_helpers\n      |- controller\n      |- vc4\n  |- rkisp1\n  |- ipu3\n\nwhere each subdir (e.g. raspberrypi/common, raspberrypi/cam_helper) has\nits own meson.build file. Such a directory structure will be introduced\nfor the Raspberry Pi IPA in a future commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n meson.build                     |  2 +-\n src/ipa/ipu3/meson.build        |  2 ++\n src/ipa/meson.build             | 26 +++++++++++++++++++++-----\n src/ipa/raspberrypi/meson.build |  2 ++\n src/ipa/rkisp1/meson.build      |  2 ++\n 5 files changed, 28 insertions(+), 6 deletions(-)","diff":"diff --git a/meson.build b/meson.build\nindex d3289181b7b9..2d99029bf5b7 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -262,7 +262,7 @@ py_mod.find_installation('python3', modules: py_modules)\n ## Summarise Configurations\n summary({\n             'Enabled pipelines': pipelines,\n-            'Enabled IPA modules': enabled_ipa_modules,\n+            'Enabled IPA modules': enabled_ipa_names,\n             'Tracing support': tracing_enabled,\n             'Android support': android_enabled,\n             'GStreamer support': gst_enabled,\ndiff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\nindex 658e7c9bc366..66c398432d43 100644\n--- a/src/ipa/ipu3/meson.build\n+++ b/src/ipa/ipu3/meson.build\n@@ -29,3 +29,5 @@ if ipa_sign_module\n                   install : false,\n                   build_by_default : true)\n endif\n+\n+ipa_names += ipa_name\ndiff --git a/src/ipa/meson.build b/src/ipa/meson.build\nindex 76ad5b445601..fac92f32fdb9 100644\n--- a/src/ipa/meson.build\n+++ b/src/ipa/meson.build\n@@ -36,16 +36,32 @@ if get_option('test') and 'vimc' not in ipa_modules\n endif\n \n enabled_ipa_modules = []\n+enabled_ipa_names = []\n+ipa_names = []\n \n # The ipa-sign-install.sh script which uses the ipa_names variable will itself\n # prepend MESON_INSTALL_DESTDIR_PREFIX to each ipa module name, therefore we\n # must not include the prefix string here.\n+\n+subdirs = []\n foreach pipeline : pipelines\n-    if ipa_modules.contains(pipeline)\n-        subdir(pipeline)\n-        ipa_names += ipa_install_dir / ipa_name + '.so'\n-        enabled_ipa_modules += pipeline\n+    if not ipa_modules.contains(pipeline)\n+        continue\n+    endif\n+    enabled_ipa_names += pipeline\n+\n+    # Allow multi-level directory structuring for the IPAs if needed.\n+    pipeline = pipeline.split('/')[0]\n+    if pipeline in subdirs\n+        continue\n     endif\n+\n+    subdir(pipeline)\n+    subdirs += [pipeline]\n+endforeach\n+\n+foreach ipa_name : ipa_names\n+    enabled_ipa_modules += ipa_install_dir / ipa_name + '.so'\n endforeach\n \n if ipa_sign_module\n@@ -54,5 +70,5 @@ if ipa_sign_module\n     # install time, which invalidates the signatures.\n     meson.add_install_script('ipa-sign-install.sh',\n                              ipa_priv_key.full_path(),\n-                             ipa_names)\n+                             enabled_ipa_modules)\n endif\ndiff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\nindex de78cbd80f9c..95437cbcc962 100644\n--- a/src/ipa/raspberrypi/meson.build\n+++ b/src/ipa/raspberrypi/meson.build\n@@ -64,3 +64,5 @@ if ipa_sign_module\n endif\n \n subdir('data')\n+\n+ipa_names += ipa_name\ndiff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\nindex ccb84b27525b..e813da53ae9b 100644\n--- a/src/ipa/rkisp1/meson.build\n+++ b/src/ipa/rkisp1/meson.build\n@@ -29,3 +29,5 @@ if ipa_sign_module\n                   install : false,\n                   build_by_default : true)\n endif\n+\n+ipa_names += ipa_name\n","prefixes":["libcamera-devel","03/13"]}