From patchwork Tue May 12 17:53:39 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: 26745 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 D527AC32F7 for ; Tue, 12 May 2026 17:53:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EA61F63022; Tue, 12 May 2026 19:53:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="iVo+o7o6"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="G7sdFWb4"; 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 7F3186302E for ; Tue, 12 May 2026 19:53:51 +0200 (CEST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64CHYAaO591816 for ; Tue, 12 May 2026 17:53:50 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=ZNIDbrZMOBp ukyyc/EOPT+Y55mvet/Oi0tiQabloDNY=; b=iVo+o7o6QI00SbQEms93szQ5/Tk wVYwHI1CS8JzG1tt4ZQGCBs6+1fM5QXiVp5rcOAOFBj2SaMYmx3GFtsdSiIpIX2C B+y8QF8GvlRTAYL5+oMUBqVbW//ZUf7humjdKbzvLSGJFEx4Rhg59u4hnIGQbiSA zPMZcSHFIvWe5580xTYNcLq6kP9SvG9gTF8ig59GmwxALtSBbNUKexGcR93f6GDi Uo1DtJq0wymwINbkMtbWqQ63npNYAEf9T14MXxoPU3BloqS6r084o9vyo/eOOHZT WldswaP7CAse0VFDVD+Funbg4N2Ky1wNER7mA1D0RMaQczqV94jTnnfoOeg== Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e4319sqy8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 12 May 2026 17:53:50 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-6312af70ad0so5405688137.1 for ; Tue, 12 May 2026 10:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778608429; x=1779213229; 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=ZNIDbrZMOBpukyyc/EOPT+Y55mvet/Oi0tiQabloDNY=; b=G7sdFWb4ZrzsaqvMyj6RhbaqYcxtMitksGhFKbfe/E9b/JYbkXWJE6ugBOTbUqHhPy UWaSzqIrlIhix7lW38Jw4RuF1cx05VRS2Vy6IBQhf7hV6pO/MUMbbfS5mzl3sMQM6vUC r4/H4aSvtSLOXXhGz3xOY8v7w893N5Ky39x2Vs8gmEcKqlmfo1mJDb4flY4bx61Q2uj6 OtIa0v9BUO5dOmXTpKDGBjxiTBwJelrCk2acG/7sZmF7OFoNVWHdTv+kPXl6JPhg3IET Q6lyDdcJfhky67T3S/hEsyPezxr9VoMVlfBE17LEPq2t4tdxZzDKWjWGTKOwCWmlGp1d kscQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778608429; x=1779213229; 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=ZNIDbrZMOBpukyyc/EOPT+Y55mvet/Oi0tiQabloDNY=; b=sr6/oLMvyH882ZaWEsdMNuBCJN5zod22G5rqi6L3z3LW8Il5FMJP2yoBNiALxKbypW YVQ+CA3H6UCh6qKmaNwGMjunPEQuhe5E/ZfWCFp743M443j2rj/o8i7UJ9NeiccJV/Ec eGlDFK9hEPk+j2XX17jiJ/spflll8TpkKTD0fQrZhAytnN5yPDn7baCTT+y4B0kKMF07 1ppZrerTIEyJtCURQkaANzW1I6n1/IztjtvX8fcLReSIEgCsjJm2VB/NO4x8AWtSki/5 HUIlihb5MJZjL2zgBXoO4NswUijN+hGq6OTWzLzJ9MbnePe4gc16mP9c2a9jwyLDOb+b hQ6w== X-Gm-Message-State: AOJu0Yye/8m81ryv+7OpKk3n37WJ2PbqIJxIQpZ03K3WLV0xJIHFu6qM 5nlRoyxUDcPNeBobveX1i8Sbt0oswzN8x0jLAtBm7V6zHSQWa5/ooYWXdgT6sYPoAKTW3fWkECn IN6UQaiofyXHm9ngVijBK8le0moqXPpI6IdglWUSRUW4muutcUCRMZdFK2JzB9J/wGCCPdWh1L5 BIhlQwPKGe X-Gm-Gg: Acq92OEtjweVwqWl63KPrVastn7i34ChhaU8r0H72+m+YbNaKWGfmrkK3JRPNvJ+ew1 CVHpC6sCQKKtSvZ7sG6UDpvkCi0PsYQoGXXRFQSBcH2YBMazkFHzbBtpUE5WocRbvUQvBFfxYfc tEKzyn7x2KEqVYrfbuL46oAdP3gVNoQ+Th01elIej6WWDIuiOOMqkt/82f9jBoeUf+mDbpHNh6B 78R0+q2HW/ycPglyKgqSnwV+aTy2bkqYj4WRHomT7gIGMgrWLCkbDe6TBdMpeDOY1TLORK4iIMX Obt+B2vjV0oUbl8Vj6K0mMTQV6x0luAXosPM2mGfw9UHsf6m7MCK/5L87ZRVbe7beojx86QnwNx Xj5kcAzqHnsdKpGmSb0rSIcOahlJoxHFw1TD9jPunM9KnjIaFYRWK5cSAwJuf6yoOKNCyoiOWvU blxUaPS8elz1zy7vwxbM9QUYDeT1ovDz6uxudK X-Received: by 2002:a05:6102:f9f:b0:631:ab8b:c348 with SMTP id ada2fe7eead31-63615516eb5mr2422057137.8.1778608429344; Tue, 12 May 2026 10:53:49 -0700 (PDT) X-Received: by 2002:a05:6102:f9f:b0:631:ab8b:c348 with SMTP id ada2fe7eead31-63615516eb5mr2422043137.8.1778608428842; Tue, 12 May 2026 10:53:48 -0700 (PDT) Received: from shalem (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bce128529fbsm463191566b.36.2026.05.12.10.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 10:53:47 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Hans de Goede , Jacopo Mondi Subject: [PATCH v5 3/4] ipa: Allow pipelines to have differently named IPA Date: Tue, 12 May 2026 19:53:39 +0200 Message-ID: <20260512175340.115153-4-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512175340.115153-1-johannes.goede@oss.qualcomm.com> References: <20260512175340.115153-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDE4NSBTYWx0ZWRfX7gfQmDxopSNZ qu/CDslubiJ8Vo2z8EmfzWZ/TBTt9Y/ltp2T2Dgu4PyznKzuSD/j8fA14C0anaoWVxf8cpNncM3 0KbAJ6nwB8oENKmgzF3fVLypvt8/Wmn9TCJAf5KUoD8qlxGR8a4+34nhNBa9dzTiv9bPsbSswJl 8jlU15GgruPSD32Id0K16E1sp9EU9wC7B0Zsl8iKRg+uEP6xt5zDQq3MUWQJdshl9C1Vr2TCttK Gp3hIWbLskRdSv8O90hHU1SLXUGPM+lIjQcWMv7Oc20MseXhWbCiffgd1YMKv4vEugcLxl+5t0a 92AcjfTYxf+SK1Ob9saTbIcubIlCZo5pSGyYlDWrMjE7hg8BDx9IVIOQamz1bG4kH0of6ROyFfl xneObmCE4dwb3jZNk+lBIcN/1uCpEzYro7tgZfWvR5D4WIqiJ+pOUfJxMGczZJJoJk0s54mknw2 yBJUEI9whagYCUvEopQ== X-Proofpoint-GUID: OSexeiUJso_nYIuJ8F8Hvb7l0aaskYXL X-Authority-Analysis: v=2.4 cv=bp98wkai c=1 sm=1 tr=0 ts=6a03692e cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=P1BnusSwAAAA:8 a=EUspDBNiAAAA:8 a=c6ydndUcIca2Pb-fbGsA:9 a=gYDTvv6II1OnSo0itH1n:22 a=D0XLA9XvdZm18NrgonBM:22 X-Proofpoint-ORIG-GUID: OSexeiUJso_nYIuJ8F8Hvb7l0aaskYXL 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-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120185 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