From patchwork Wed Apr 8 11:56:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 26505 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 B5A90BDCBD for ; Wed, 8 Apr 2026 11:56:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3110A62E0C; Wed, 8 Apr 2026 13:56:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="OQE1T4O+"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="b5PnMRzI"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24D9B62CE6 for ; Wed, 8 Apr 2026 13:56:17 +0200 (CEST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 638B1VIL071736 for ; Wed, 8 Apr 2026 11:56:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=MBq4Dj3cjpd I3SjIil7Z0HBw0N3mytKcqnaYZBc7uP4=; b=OQE1T4O+e68dl5E/R/hQVIqJUHD hAiaCUSAyE/TUvMBm0BL5b1L9+qRdft7f9FLqGe2Ipt3fhHMN8ynCPlGNFsAod+v QksSH8OlSa84NjyxEYCKk51fcEASMo46zpt9xDC8TwvO/GXeC+8sCAXFIRJPMSeW 8Nv+uDUZ+p7NrzmssYjUwZgvQf73Ut405eWVxAgDWGDSyb1dtW6O4ucIYrTahST3 ztKFjlV1se2g77dKuemusDNkQ4QJkrjvFBkc/2kd3iC+fRzJvdaf172BT3faj9rW KmTXaLpF7v28LCGq4+juY59tJzJxUb+A4dBAAl36utDY1bl1qOpgT2l8aKg== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dd7sxb4tk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Apr 2026 11:56:15 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50d8ed08aa4so101232241cf.3 for ; Wed, 08 Apr 2026 04:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775649375; x=1776254175; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBq4Dj3cjpdI3SjIil7Z0HBw0N3mytKcqnaYZBc7uP4=; b=b5PnMRzIOHJgqOhGgAzdiBfxZauxcU5O9PGpOgi8EHzkkllAfOIpW2zgxL8yjy1OZj ij13lrUbxxQijBo385zePbqrgfZpswJWWaF8jGQtCQHNhJWr7KuI+YBgdcWQPjropaui TC35O/xO/Z9oFqy34ahIAsZGQOf9vza5dNWyt1IzgK2rBRo9aF4SPSs7KjUPjRr0rzI9 kt8f2alaLYwXODqwsFCbyMY20T0MfxU3jwmggSZcWrUTiutbyKwW3SJvCTS6WxJeBjxb iPPMBJIEQO1M5IR6zxRpeS+wOV8AdVugPU1z4nsxVp9epk9nGFp3epI15VwX9qRl5Gb4 BcMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775649375; x=1776254175; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MBq4Dj3cjpdI3SjIil7Z0HBw0N3mytKcqnaYZBc7uP4=; b=TQSF+QhdOzfT4sCz0EW2CtJTqT3pIQYApbiIOlDwrgmkJzqn4JMv/BhdVy6FEZkPUr ZNza7yhveTuq3ldPQDcw0gM50Soei/BNFpMGaRDuzke6590Mof3vjW5IFtZfF56Vo5Y4 Y0duZEuU8j2yFH/nqTwndTW7ObTxpEAwoLDqolQrxErS363IS+sFf3n3kioC/gSpXl3Y 3V7p0RhOJ95MY9RUZMLNZMQ2xTYt9ENYELepNzEc83JRZUOCH2XNJSva0fhH7qxXcb4P gFPyXxowO5pJ2nIHoTo6EvMg+GOacY2aHb/YUbo8Xcje5Eul+QpDjsthfvfR8tbf+Cox dhqQ== X-Gm-Message-State: AOJu0Yw5/0h+p0RhgmyICfXa2fmO03a9Lg5HBX75Wr3H+4AI3F0tHMn9 uKFvtKAqPxAhnrFge57QJsIoXjkHnfMxH1A0vlSdDL/Tbvte5rOCfd54rAbwy30bmN/QTddDitn YpSAPqV3e9dcD6+bIbGEA0MZTFuMzq+FXCzphGmns1x8cQMfmR4Tcqq7Ko88UvH/KJASv3DGuqP hleOnXfJyo X-Gm-Gg: AeBDievlbd5/FljQimkO3kAlPCC1ly+vBXzq4eKK6EqJPCziWeerVlZR/JCJaJD2yCK rbHG5+qe8iv5aAj0pQqmFgvjfclV9x2TyU1oypSuZ+YPiC1HriJdUDhqVpwE5uJNRmIeaYq/++I g9VbORN3dLsfzoz3UiG0kGUzEzbv5K8AhiOK2MuqLpP+KuOKTiDz5eALrOLKJXtwZXq4D+bs9It zHtaBWQm2VoJEGX2n+/K3Wb1YwB6DQOZXmJDWW1CRKNu8FADrUcyJ0qr/ivF27Fg8n+SuMsj5y0 ZqlkqRNLDEvCSOjqtO8w9oYL7umzNhKZcQcRsrBL9DToYWFz+a0R5Cl4bVT1WOcbQXCgcDxu8SY jdwApTPu6xjAa8rXV/plL+gq/aSstmszhaWKKFjFMvErDinmQuVjPVysFMV5bRw3jDe63PhpRRd FMuIzzQ8DAmjMVrj212zx3VT/0mIniTG67 X-Received: by 2002:ac8:5f0f:0:b0:50d:a5e8:39f5 with SMTP id d75a77b69052e-50da5e84231mr82136911cf.27.1775649374787; Wed, 08 Apr 2026 04:56:14 -0700 (PDT) X-Received: by 2002:ac8:5f0f:0:b0:50d:a5e8:39f5 with SMTP id d75a77b69052e-50da5e84231mr82136481cf.27.1775649374266; Wed, 08 Apr 2026 04:56:14 -0700 (PDT) Received: from t14s (2001-1c00-0c32-7800-07d4-cca3-ec08-7ac7.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:7d4:cca3:ec08:7ac7]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9c3cec6c1csm639102066b.39.2026.04.08.04.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 04:56:12 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Loic Poulain , Hans de Goede , Jacopo Mondi Subject: [PATCH v4 3/4] ipa: Allow pipelines to have differently named IPA Date: Wed, 8 Apr 2026 13:56:05 +0200 Message-ID: <20260408115606.12417-4-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408115606.12417-1-johannes.goede@oss.qualcomm.com> References: <20260408115606.12417-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=etfvCIpX c=1 sm=1 tr=0 ts=69d6425f cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=P1BnusSwAAAA:8 a=EUspDBNiAAAA:8 a=c6ydndUcIca2Pb-fbGsA:9 a=uxP6HrT_eTzRwkO_Te1X:22 a=D0XLA9XvdZm18NrgonBM:22 X-Proofpoint-ORIG-GUID: Ldz5Dn8t24hHiPBmYCBClK9ozrHLJvl7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA4MDExMCBTYWx0ZWRfX+LeT54gjomql z+A7n8eBiuzf39TsAdHrhhiKn3HRHq2zpgveLXcGcWo1j0CQJvELC0yZEfLw9G2hLAveZKfrDrG cMvZwuvisblDmWdSvRSBYus3rDMYB4V1WmPYY9hDqQxtTUleXpSqLmfbaaSnP8ElbX8MH+GUrvu KD7tVzdXC3z7b8l3hUzdKruNE2hZxPPe8t/So/vxhCgJWjaJb6t9MqxVC8QN9lVmCUDGBfsjkG4 TuGIrm7wlIFqSRkkTgOAAIhZKRi4+QhoWsdyG5l8URgULzUJa60lUVhuMDtXpdz/zNty2oXymJO 5oi1IhLbAtF+Ncf0v+fSyonXJ7wHSjhZSjc+KehE+fU999Ln2Uog3iipphO875w9DDA8fdOtxZj AdB+GB1Lb79/stJzjqRvhFZtL0BYO9nMlHUAMyxgeYgtLH+EvrxjNa1ZAqXLgjnN0NHdzzV+pWu RbzXSzKglBiJtuSD87A== X-Proofpoint-GUID: Ldz5Dn8t24hHiPBmYCBClK9ozrHLJvl7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1143, Hydra:6.1.51, FMLib:17.12.100.49 definitions=2026-04-08_03,2026-04-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 clxscore=1015 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604080110 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" From: Jacopo Mondi 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 Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede --- 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 eb7846e47..c583c7efd 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 - enabled_ipa_names += pipeline + + 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 += 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