From patchwork Thu Jun 18 10:18:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 26918 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 63AAEC3301 for ; Thu, 18 Jun 2026 10:19:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D125A6298D; Thu, 18 Jun 2026 12:18:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oyzMiO5F"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B79256297C for ; Thu, 18 Jun 2026 12:18:54 +0200 (CEST) Received: from [192.168.125.177] (mob-109-113-4-199.net.vodafone.it [109.113.4.199]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 601442393; Thu, 18 Jun 2026 12:18:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1781777899; bh=a8B6o1ut5YgA0KtHJ3CBSBbrsVgQBvs05lZoZ2YoL3M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=oyzMiO5FgL5WoOtOLfpk4BIVaJsrhgb/NPSUsT9ySSPdXsB21gsBXqXKu0Sb+Kbh5 Kv+HEgxIuRtOxjerkgNg5EDfS0qSHO1BPseZ/bWC+CW9dDLWFzddIIv+k22A9RkRfy 5ikZRFCCAJbtv4Y//Qq7AVr2jDvHv4H4QJ6d/NJ8= From: Jacopo Mondi Date: Thu, 18 Jun 2026 12:18:42 +0200 Subject: [PATCH 03/14] ipa: Allow pipelines to have differently named IPA MIME-Version: 1.0 Message-Id: <20260618-rppx1-ipa-v1-3-32337264cfcd@ideasonboard.com> References: <20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com> In-Reply-To: <20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com> To: =?utf-8?q?Niklas_S=C3=B6derlund?= , libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3861; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=a8B6o1ut5YgA0KtHJ3CBSBbrsVgQBvs05lZoZ2YoL3M=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqM8YJeGAi1Et4e6nFC7gwlvUp3LaxnzEyLKI6p mwvl7A1f3OJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCajPGCQAKCRByNAaPFqFW PGVXEACsAtBPn+oLU3bjYCAYOsXh8d0sVHSGtyeuELqIykzSJX5te3Axrild3iul/ARcHiu/be7 7lxaBY/teseVxZ7hnp+mCW05+444mlUyf8hBTHD/dWd55q4bPC73FKZLi8dYfhPKghv9X0oC8Qi PiWgyTAogIGrSNPd32LE6gjM429bqrMSHS0B3ToVM049Fw7lTLUxC5AYmXRGUAekSL6XvoDOg46 iitej5IbFmTZ1mSwUrVOzW6VmAChTvdVUDsUB8eG8inatCcSFvPDohYfFyu1GGxr+zzLfKqDPMR IpkW3/eCpwxCPdbm/ntRbnqWMd1JoryuKzxIaGIP8nXHBd8hZEos+zcBFAMHXfKxlfZgw3a5o5p BpKhxvgdicbXhDLKIpfHEOxCmuY88sbl6huQf32OKnviKnFUKklc/+YNyO+wA0+R/uHgOXCH8JQ MEtZEzK8xdR9PluIRnrFKntn44WSXfiLTkdHffDx0WWvLVrXywvG3hLMZm0RSnYREyKZ7Sf4pLq yrK7vT/pBvVbqtkH9ZnkefcnppSXs1xelC2snEuXUQGJBm6O2YAfBrP8YyMxaBsY1/fND4B2s/M 2yBTynve88DUt6lfhq46G3d5ofRHuXZct6D32dyUc62eK9RoEudVBZucADz+UXfM8STN88vL7Va c4ECSfzrZaXT6JA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Right now the build system assumes a 1-to-1 matching between a pipeline handler name and an IPA module. This, as also acknowledged by a \todo comment, is quite a rigid requirement and only allows a 1-to-1 matching between pipeline and IPA names. The more platforms libcamera supports, the more it is likely that a pipeline handler could re-use an IPA module. This is particularly relevant for the softISP IPA module which could theoretically be plugged to any pipeline. Likewise, the forthcoming R-Car Gen4 support uses the RkISP1 IPA and at the moment would require building the 'rkisp1' pipeline in to have the IPA module available. When building IPAs, the build system iterates the list of enabled pipeline handlers and for each of them tries to verify if the 'ipas' list contains a corresponding entry for it. The 'ipas' meson options is an array option and, as no default value is specified for it, it contains by default all its possible choices. In this way if no value is specified for the 'ipas' option, compiling the pipeline handlers ['X','Y', 'Z'] will compile the ['X', 'Y', 'Z'] IPAs. If instead the user specifies '-Dipas=X' during the configuration then only IPA module ['X'] will be built, regardless of which pipeline is enabled. Building an IPA module will anyway require to build a corresponding pipeline with the same name. Relax the 1-to-1 'pipeline'-'IPA' naming requirement by introducing a dictionary that associates pipelines with IPA modules. For each enabled pipeline: 1) Make sure an IPA module exists for it 2) Make sure the IPA module is enabled by the 'ipas' option 3) Make sure the IPA is compiled once only This will require every new pipeline to add an entry to the dictionary and specify which IPA module they would like to use. Signed-off-by: Jacopo Mondi --- src/ipa/meson.build | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/ipa/meson.build b/src/ipa/meson.build index eb7846e47888..c583c7efdd35 100644 --- a/src/ipa/meson.build +++ b/src/ipa/meson.build @@ -24,6 +24,16 @@ subdir('libipa') ipa_sign = files('ipa-sign.sh') +supported_ipas = { + 'ipu3': 'ipu3', + 'mali-c55': 'mali-c55', + 'rkisp1': 'rkisp1', + 'rpi/pisp': 'rpi/pisp', + 'rpi/vc4': 'rpi/vc4', + 'simple': 'simple', + 'vimc': 'vimc' +} + ipa_modules = get_option('ipas') # Tests require the vimc IPA, similar to vimc pipline-handler for their @@ -39,24 +49,34 @@ ipa_names = [] subdirs = [] foreach pipeline : pipelines - # The current implementation expects the IPA module name to match the - # pipeline name. - # \todo Make the IPA naming scheme more flexible. - if not ipa_modules.contains(pipeline) + # Make sure an IPA exists for the pipeline + if not supported_ipas.has_key(pipeline) + continue + endif + + ipa = supported_ipas.get(pipeline) + + # Only build IPAs specified with '-Dipas' + if not ipa_modules.contains(ipa) + continue + endif + + # If enabled already do not add it twice + if enabled_ipa_names.contains(ipa) continue endif - enabled_ipa_names += pipeline + enabled_ipa_names += ipa # Allow multi-level directory structuring for the IPAs if needed. - pipeline = pipeline.split('/')[0] - if pipeline in subdirs + ipa = ipa.split('/')[0] + if ipa in subdirs continue endif - subdirs += pipeline - subdir(pipeline) + subdirs += ipa + subdir(ipa) - # Don't reuse the pipeline variable below, the subdirectory may have + # Don't reuse the ipa variable below, the subdirectory may have # overwritten it. endforeach