{"id":18102,"url":"https://patchwork.libcamera.org/api/1.1/patches/18102/?format=json","web_url":"https://patchwork.libcamera.org/patch/18102/","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":"<20230112110756.1944607-1-kieran.bingham@ideasonboard.com>","date":"2023-01-12T11:07:56","name":"[libcamera-devel] meson: Rework automatic pipeline selection","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"951edc94be74b4b471b9c5cc80f8186d3e69cb74","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18102/mbox/","series":[{"id":3705,"url":"https://patchwork.libcamera.org/api/1.1/series/3705/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3705","date":"2023-01-12T11:07:56","name":"[libcamera-devel] meson: Rework automatic pipeline selection","version":1,"mbox":"https://patchwork.libcamera.org/series/3705/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18102/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18102/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 B228FC3240\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Jan 2023 11:08:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 660D861F05;\n\tThu, 12 Jan 2023 12:08:02 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D86661F05\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Jan 2023 12:08:01 +0100 (CET)","from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 89DEC505;\n\tThu, 12 Jan 2023 12:08:00 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1673521682;\n\tbh=QHHDrlj03HxGsn8flJCBcJoPCeGz+CwBmZdsxekY2BM=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=R9c1BeG/ObTG4YduDgIU0GJjDpNnMIblOIGosAc92rOkYo4KWChrhVVf2JAzk8Cbh\n\tl2zs9WMzuBYNalqbq3rMw09F+JOwTjvnipfl/zdJ2DfxsuVTXeA4YbGDHySMmE9zzN\n\tUlbzxbBu6sDCEirkJOMwnXq/TkREzzm8lCJwWwTX/M4UFi9+2BJng+rXYyRb+fNiMR\n\tpCb2Llt+1E9Rm0WPKDQDxhLLBOJrxSij+4faU1rb1hZBYCV+A7mziHcoU0Dw+5kJBL\n\tdq/g7X5TWbcc/0NTmVL1/h8LW7P2eUHpk8IAjZ93tXPTXcKZnfea5j/OKUMyCpAR/+\n\txrv4lXx9ZiHQg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1673521680;\n\tbh=QHHDrlj03HxGsn8flJCBcJoPCeGz+CwBmZdsxekY2BM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=f+pc8VhBKTqOPohaYIxqSYLFOOBHk4dzHOXc59h/Zmgz0FDrk68LKTa2v6tmx77sJ\n\tFWhnFyCVGWRbPhJrtm6mH0M7ALFALdI0YIHi1pj4MFZlJ8X6WIXLQLHW/d+4joPiRV\n\tTlGAyeXOsLcOZi+qty2/WaIq9c9dybrxnTKo7qwY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"f+pc8VhB\"; dkim-atps=neutral","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Thu, 12 Jan 2023 11:07:56 +0000","Message-Id":"<20230112110756.1944607-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] meson: Rework automatic pipeline selection","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The supported pipelines are listed in three places: the\nmeson_options.txt file, the defined array when a user selects\n-Dpipelines=\"all\", and arrays defined when the default\n-Dpipelines=\"auto\" is selected.\n\nThis can be hard to maintain and error prone.\n\nRework the definition of pipeline selection to a single table within the\nmeson.build to reduce duplication within this file. The new table\nspecifies the architecture(s) that the pipeline handler supports and\nis iterated to handle the special cases for 'all', 'auto' and 'test'.\n\nThe current behaviour such that 'all' takes precedence over 'auto' is\nmaintained, and 'test' is now extended such that additional test\npipeline handlers can easily be introduced.\n\nThe existing implementation defines the i.MX8-ISI and RKISP1 pipeline\nhandlers as only supported by 'aarch64'. This conversion changes the\nbehaviour such that those pipeline handlers are now supported on both\n'arm' and 'aarch64' as each of those platforms could support a 32-bit\nARM build.\n\nSuggested-by: Javier Martinez Canillas <javierm@redhat.com>\nReviewed-by: Javier Martinez Canillas <javierm@redhat.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n meson.build | 54 +++++++++++++++++++++++++++++------------------------\n 1 file changed, 30 insertions(+), 24 deletions(-)","diff":"diff --git a/meson.build b/meson.build\nindex e86673dd5c0c..c35376e1e97b 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -164,38 +164,44 @@ liblttng = dependency('lttng-ust', required : get_option('tracing'))\n # are enabled.\n pipelines = get_option('pipelines')\n \n+arch_arm = ['arm', 'aarch64']\n+arch_x86 = ['x86', 'x86_64']\n+pipes_support = {\n+  'imx8-isi':     arch_arm,\n+  'ipu3':         arch_x86,\n+  'raspberrypi':  arch_arm,\n+  'rkisp1':       arch_arm,\n+  'simple':       arch_arm,\n+  'uvcvideo':     ['any'],\n+  'vimc':         ['test'],\n+}\n+\n if pipelines.contains('all')\n-    pipelines = [\n-        'imx8-isi',\n-        'ipu3',\n-        'raspberrypi',\n-        'rkisp1',\n-        'simple',\n-        'uvcvideo',\n-        'vimc',\n-    ]\n+    pipelines = []\n+    foreach pipe, archs : pipes_support\n+        pipelines += pipe\n+    endforeach\n endif\n \n if pipelines.contains('auto')\n     host_cpu = host_machine.cpu_family()\n     pipelines = []\n-    if host_cpu == 'x86' or host_cpu == 'x86_64'\n-        pipelines += ['ipu3']\n-    elif host_cpu == 'aarch64'\n-        pipelines += ['imx8-isi', 'rkisp1']\n-    endif\n-\n-    if host_cpu == 'arm' or host_cpu == 'aarch64'\n-        pipelines += ['raspberrypi', 'simple']\n-    endif\n-\n-    # Always include the uvcvideo pipeline handler.\n-    pipelines += ['uvcvideo']\n+    foreach pipe, archs : pipes_support\n+        if host_cpu in archs or 'any' in archs\n+            message('Auto-enabling ' + pipe + ' pipeline handler')\n+            pipelines += pipe\n+        endif\n+    endforeach\n endif\n \n-if get_option('test') and 'vimc' not in pipelines\n-    message('Enabling vimc pipeline handler to support tests')\n-    pipelines += ['vimc']\n+if get_option('test')\n+    foreach pipe, archs : pipes_support\n+        if 'test' in archs and pipe not in pipelines\n+            message('Enabling ' + pipe + ' pipeline handler for tests')\n+            pipelines += pipe\n+        endif\n+    endforeach\n endif\n \n # Utilities are parsed first to provide support for other components.\n-- \n2.34.1\n","prefixes":["libcamera-devel"]}