From patchwork Thu Jan 12 11:07:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18102 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 B228FC3240 for ; Thu, 12 Jan 2023 11:08:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 660D861F05; Thu, 12 Jan 2023 12:08:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1673521682; bh=QHHDrlj03HxGsn8flJCBcJoPCeGz+CwBmZdsxekY2BM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=R9c1BeG/ObTG4YduDgIU0GJjDpNnMIblOIGosAc92rOkYo4KWChrhVVf2JAzk8Cbh l2zs9WMzuBYNalqbq3rMw09F+JOwTjvnipfl/zdJ2DfxsuVTXeA4YbGDHySMmE9zzN UlbzxbBu6sDCEirkJOMwnXq/TkREzzm8lCJwWwTX/M4UFi9+2BJng+rXYyRb+fNiMR pCb2Llt+1E9Rm0WPKDQDxhLLBOJrxSij+4faU1rb1hZBYCV+A7mziHcoU0Dw+5kJBL dq/g7X5TWbcc/0NTmVL1/h8LW7P2eUHpk8IAjZ93tXPTXcKZnfea5j/OKUMyCpAR/+ xrv4lXx9ZiHQg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D86661F05 for ; Thu, 12 Jan 2023 12:08:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="f+pc8VhB"; dkim-atps=neutral Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 89DEC505; Thu, 12 Jan 2023 12:08:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1673521680; bh=QHHDrlj03HxGsn8flJCBcJoPCeGz+CwBmZdsxekY2BM=; h=From:To:Cc:Subject:Date:From; b=f+pc8VhBKTqOPohaYIxqSYLFOOBHk4dzHOXc59h/Zmgz0FDrk68LKTa2v6tmx77sJ FWhnFyCVGWRbPhJrtm6mH0M7ALFALdI0YIHi1pj4MFZlJ8X6WIXLQLHW/d+4joPiRV TlGAyeXOsLcOZi+qty2/WaIq9c9dybrxnTKo7qwY= To: libcamera devel 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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The supported pipelines are listed in three places: the meson_options.txt file, the defined array when a user selects -Dpipelines="all", and arrays defined when the default -Dpipelines="auto" is selected. This can be hard to maintain and error prone. Rework the definition of pipeline selection to a single table within the meson.build to reduce duplication within this file. The new table specifies the architecture(s) that the pipeline handler supports and is iterated to handle the special cases for 'all', 'auto' and 'test'. The current behaviour such that 'all' takes precedence over 'auto' is maintained, and 'test' is now extended such that additional test pipeline handlers can easily be introduced. The existing implementation defines the i.MX8-ISI and RKISP1 pipeline handlers as only supported by 'aarch64'. This conversion changes the behaviour such that those pipeline handlers are now supported on both 'arm' and 'aarch64' as each of those platforms could support a 32-bit ARM build. Suggested-by: Javier Martinez Canillas Reviewed-by: Javier Martinez Canillas Signed-off-by: Kieran Bingham Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- meson.build | 54 +++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/meson.build b/meson.build index e86673dd5c0c..c35376e1e97b 100644 --- a/meson.build +++ b/meson.build @@ -164,38 +164,44 @@ liblttng = dependency('lttng-ust', required : get_option('tracing')) # are enabled. pipelines = get_option('pipelines') +arch_arm = ['arm', 'aarch64'] +arch_x86 = ['x86', 'x86_64'] +pipes_support = { + 'imx8-isi': arch_arm, + 'ipu3': arch_x86, + 'raspberrypi': arch_arm, + 'rkisp1': arch_arm, + 'simple': arch_arm, + 'uvcvideo': ['any'], + 'vimc': ['test'], +} + if pipelines.contains('all') - pipelines = [ - 'imx8-isi', - 'ipu3', - 'raspberrypi', - 'rkisp1', - 'simple', - 'uvcvideo', - 'vimc', - ] + pipelines = [] + foreach pipe, archs : pipes_support + pipelines += pipe + endforeach endif if pipelines.contains('auto') host_cpu = host_machine.cpu_family() pipelines = [] - if host_cpu == 'x86' or host_cpu == 'x86_64' - pipelines += ['ipu3'] - elif host_cpu == 'aarch64' - pipelines += ['imx8-isi', 'rkisp1'] - endif - - if host_cpu == 'arm' or host_cpu == 'aarch64' - pipelines += ['raspberrypi', 'simple'] - endif - - # Always include the uvcvideo pipeline handler. - pipelines += ['uvcvideo'] + foreach pipe, archs : pipes_support + if host_cpu in archs or 'any' in archs + message('Auto-enabling ' + pipe + ' pipeline handler') + pipelines += pipe + endif + endforeach endif -if get_option('test') and 'vimc' not in pipelines - message('Enabling vimc pipeline handler to support tests') - pipelines += ['vimc'] +if get_option('test') + foreach pipe, archs : pipes_support + if 'test' in archs and pipe not in pipelines + message('Enabling ' + pipe + ' pipeline handler for tests') + pipelines += pipe + endif + endforeach endif # Utilities are parsed first to provide support for other components. -- 2.34.1