[{"id":39183,"web_url":"https://patchwork.libcamera.org/comment/39183/","msgid":"<20260618193058.GD2890159@ragnatech.se>","date":"2026-06-18T19:30:58","subject":"Re: [PATCH 03/14] ipa: Allow pipelines to have differently named IPA","submitter":{"id":230,"url":"https://patchwork.libcamera.org/api/people/230/","name":"Niklas Söderlund","email":"niklas.soderlund+renesas@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2026-06-18 12:18:42 +0200, Jacopo Mondi wrote:\n> Right now the build system assumes a 1-to-1 matching between a pipeline\n> handler name and an IPA module.\n> \n> This, as also acknowledged by a \\todo comment, is quite a rigid\n> requirement and only allows a 1-to-1 matching between pipeline and IPA\n> names. The more platforms libcamera supports, the more it is likely that\n> a pipeline handler could re-use an IPA module. This is particularly\n> relevant for the softISP IPA module which could theoretically be plugged\n> to any pipeline. Likewise, the forthcoming R-Car Gen4 support uses the\n> RkISP1 IPA and at the moment would require building the 'rkisp1'\n\nWith the rppx1 IPA this is no longer true, right?\n\n> pipeline in to have the IPA module available.\n> \n> When building IPAs, the build system iterates the list of enabled\n> pipeline handlers and for each of them tries to verify if the 'ipas'\n> list contains a corresponding entry for it. The 'ipas' meson options is\n> an array option and, as no default value is specified for it, it\n> contains by default all its possible choices.\n> \n> In this way if no value is specified for the 'ipas' option, compiling\n> the pipeline handlers ['X','Y', 'Z'] will compile the ['X', 'Y', 'Z']\n> IPAs. If instead the user specifies '-Dipas=X' during the configuration\n> then only IPA module ['X'] will be built, regardless of which pipeline is\n> enabled. Building an IPA module will anyway require to build a\n> corresponding pipeline with the same name.\n> \n> Relax the 1-to-1 'pipeline'-'IPA' naming requirement by introducing a\n> dictionary that associates pipelines with IPA modules.\n> \n> For each enabled pipeline:\n> 1) Make sure an IPA module exists for it\n> 2) Make sure the IPA module is enabled by the 'ipas' option\n> 3) Make sure the IPA is compiled once only\n> \n> This will require every new pipeline to add an entry to the dictionary\n> and specify which IPA module they would like to use.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/ipa/meson.build | 40 ++++++++++++++++++++++++++++++----------\n>  1 file changed, 30 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/ipa/meson.build b/src/ipa/meson.build\n> index eb7846e47888..c583c7efdd35 100644\n> --- a/src/ipa/meson.build\n> +++ b/src/ipa/meson.build\n> @@ -24,6 +24,16 @@ subdir('libipa')\n>  \n>  ipa_sign = files('ipa-sign.sh')\n>  \n> +supported_ipas = {\n> +    'ipu3':       'ipu3',\n> +    'mali-c55':   'mali-c55',\n> +    'rkisp1':     'rkisp1',\n> +    'rpi/pisp':   'rpi/pisp',\n> +    'rpi/vc4':    'rpi/vc4',\n> +    'simple':     'simple',\n> +    'vimc':       'vimc'\n> +}\n> +\n>  ipa_modules = get_option('ipas')\n>  \n>  # Tests require the vimc IPA, similar to vimc pipline-handler for their\n> @@ -39,24 +49,34 @@ ipa_names = []\n>  \n>  subdirs = []\n>  foreach pipeline : pipelines\n> -    # The current implementation expects the IPA module name to match the\n> -    # pipeline name.\n> -    # \\todo Make the IPA naming scheme more flexible.\n> -    if not ipa_modules.contains(pipeline)\n> +    # Make sure an IPA exists for the pipeline\n> +    if not supported_ipas.has_key(pipeline)\n> +        continue\n> +    endif\n> +\n> +    ipa = supported_ipas.get(pipeline)\n> +\n> +    # Only build IPAs specified with '-Dipas'\n> +    if not ipa_modules.contains(ipa)\n> +        continue\n> +    endif\n> +\n> +    # If enabled already do not add it twice\n> +    if enabled_ipa_names.contains(ipa)\n>          continue\n>      endif\n> -    enabled_ipa_names += pipeline\n> +    enabled_ipa_names += ipa\n>  \n>      # Allow multi-level directory structuring for the IPAs if needed.\n> -    pipeline = pipeline.split('/')[0]\n> -    if pipeline in subdirs\n> +    ipa = ipa.split('/')[0]\n> +    if ipa in subdirs\n>          continue\n>      endif\n>  \n> -    subdirs += pipeline\n> -    subdir(pipeline)\n> +    subdirs += ipa\n> +    subdir(ipa)\n>  \n> -    # Don't reuse the pipeline variable below, the subdirectory may have\n> +    # Don't reuse the ipa variable below, the subdirectory may have\n>      # overwritten it.\n>  endforeach\n>  \n> \n> -- \n> 2.54.0\n>","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 C573FC3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Jun 2026 19:31:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BEDAC656BD;\n\tThu, 18 Jun 2026 21:31:02 +0200 (CEST)","from fout-b5-smtp.messagingengine.com\n\t(fout-b5-smtp.messagingengine.com [202.12.124.148])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F68761754\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Jun 2026 21:31:01 +0200 (CEST)","from phl-compute-07.internal (phl-compute-07.internal\n\t[10.202.2.47])\n\tby mailfout.stl.internal (Postfix) with ESMTP id F00221D0006C;\n\tThu, 18 Jun 2026 15:30:59 -0400 (EDT)","from phl-frontend-03 ([10.202.2.162])\n\tby phl-compute-07.internal (MEProxy); Thu, 18 Jun 2026 15:31:00 -0400","by mail.messagingengine.com (Postfix) with ESMTPA; Thu,\n\t18 Jun 2026 15:30:59 -0400 (EDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ragnatech.se header.i=@ragnatech.se\n\theader.b=\"PC1xzBus\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"Clg/idnz\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h=\n\tcc:cc:content-transfer-encoding:content-type:content-type:date\n\t:date:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to; s=fm3; t=1781811059;\n\tx=1781897459; bh=gMWdOzYgUhklsSMFKHu6JLLerfPJMUPNAtHk0IlVJ0I=; b=\n\tPC1xzBus1BrfgQTauD6Ibs6M5pZ25t2I+jTtW3bjZ5rFMaxqd1pW6T9cVMDwfe+H\n\tURBVoxQzefJDHE/6Zq1HDlJosUyzBV4KV3/Nqmcxbj0Wxc5gFEN6jdZO9mKXPy93\n\twDpDh8+NFF9PfSckTxxCoYy8VosPpvjSz258k+bLhyjZKo4FNuN3UhpFTC1XUX8N\n\tRBF+8Ia28OEcKEIPKd6Q9AjSUspn4jjlZE4mkF5AQjFId3XaGDkSs3y5cP3JVxU+\n\tcGqijLq7QAsZ8UXv6rfGvAPPyaedgLcqsjvsQEr/3bXXRKcFjhiEUkdlJiYvUAs7\n\tQ9kT7UckUUQROGugM5QYMw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:cc:content-transfer-encoding\n\t:content-type:content-type:date:date:feedback-id:feedback-id\n\t:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to:x-me-proxy\n\t:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1781811059; x=\n\t1781897459; bh=gMWdOzYgUhklsSMFKHu6JLLerfPJMUPNAtHk0IlVJ0I=; b=C\n\tlg/idnzUI6fgOCIoREv7TkrgWt4x2ALEk2z+Qy0viux18XvfDiF/W31lZQXaEk0C\n\tWV3hybw6Gc/S2+kCl2uR9fGIr1f8U2iX3SGZHY1bNuRVod2Gq/kSzemQqcoqgmFj\n\t4l/o/3qzd7MDpOjA9CU7vsHuhlhzNVg6gRSHpygw7bQdMznGLSyrM88rXfcAqnzE\n\t2mda+sW8Jwf/RSenB1tLzxGw+Q+RuBihtsquvfa/zIgzCKa4I19FR0bkNG9oiwI/\n\tptdUaGZZECP77VuZTGfOE5m/XS6gApl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7o6NtRmeUEFqorxOCRENnpoVvYtrepMQp44yAghmktq09yNqkjdYwPgw","X-ME-Proxy":"<xmx:c0c0ajqZYJFXlPt0BASNxDw86H6fteb1Wcbp0GwIcnFin1Xj0g59aQ>\n\t<xmx:c0c0amnXCSdaGfQbOt0cd99Lqf0QgQ1JAUfziAapaHTlSwoBy2TgEg>\n\t<xmx:c0c0aiL5HLfN3ekxrmceiqFuaEJgUPciOuZo-eSIFwY6W4m7gARpoQ>\n\t<xmx:c0c0ajxSFwK2Ws2rMHq7LkZfsLyY6SoGN6wn6K649jJ3PTlCcFZI8w>\n\t<xmx:c0c0anGOFk8iaaE3y2Izkjk4svDk6sH5yisnJM2XM4hjZta5wxc_8oQd>","Feedback-ID":"i80c9496c:Fastmail","Date":"Thu, 18 Jun 2026 21:30:58 +0200","From":"Niklas =?utf-8?q?S=C3=B6derlund?=\n\t<niklas.soderlund+renesas@ragnatech.se>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 03/14] ipa: Allow pipelines to have differently named IPA","Message-ID":"<20260618193058.GD2890159@ragnatech.se>","References":"<20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com>\n\t<20260618-rppx1-ipa-v1-3-32337264cfcd@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260618-rppx1-ipa-v1-3-32337264cfcd@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]