From patchwork Tue Aug 18 14:05:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 27840 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 4A981C3308 for ; Tue, 18 Aug 2026 14:06:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AF7D868304; Tue, 18 Aug 2026 16:06:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="MW3pJ3qU"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="R12paK8H"; dkim-atps=neutral Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8EB0E682FB for ; Tue, 18 Aug 2026 16:05:58 +0200 (CEST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67IE0iGl1018155 for ; Tue, 18 Aug 2026 14:05:57 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=EQ1XZRbZGRy B3as4gr3aCKmf2sK+9RMxmTWtjPgyi3Q=; b=MW3pJ3qUeU5kvjuWV1As8UGrX5R 2TFt5TSJcSdqF3ZyaCKl51Y79fDqkOiBS1VbVUu2jZRMEBhUW7jOEbiKhK1F2G1u 1mHp8IMoAZbdKG9jh9olMSBsaBiHFhf6aFAksZdt+g+H5ePANV9PF6rE942VZc4u lIKUHdT1hydTN0qyZH8/DG5lQYzJoK3uBeh+QK4KHFirlL36My/yTc8LdYBb7eqh d6GBKfMO5tIAVPXN9lneGj5hTm0sLjtDjINMr0hxJdnbxal1UfKg9JUT7FCTFB0R 7yBBs1jEdQPstiov9bmG5IUTzDsyzsMHLG1YYbKC+NGIBeAWBKmDI+kThAg== 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 4g4qxj0a49-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 18 Aug 2026 14:05:56 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c1b4d961dso10572171cf.1 for ; Tue, 18 Aug 2026 07:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787061956; x=1787666756; 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:content-type; bh=EQ1XZRbZGRyB3as4gr3aCKmf2sK+9RMxmTWtjPgyi3Q=; b=R12paK8HMDAfaRnsew0a01HYQmE0b0bhBxrGH8Wi6VoXWdvf6FqmruM3G9PNpy+7NX QY8PyWeqv8m85IYOPNdyRcMFte/QmMRqaCuaaHrZnN7Oa44wXj0RenUTZFds8VEJSkxi vMrh1JUXPLKlLUWvANhPcuwPAJtZ4Qps85aHSHzfZ8tsQZF26FxHusaVt0vMD+V68BWa h5MM4UkerQ4Y9VW4O85JRYKxiGHqrnbcWoUdPjodVb6PN79UOsxVSWwgvYGA+/dsMk7W 6zyEK/v/Lj4wjrgQAE5O35OXDi0zgRHOlG+WJQ2PkldDO+EHKvmxmANmKIePhmKsPR7M UuIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787061956; x=1787666756; 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:content-type; bh=EQ1XZRbZGRyB3as4gr3aCKmf2sK+9RMxmTWtjPgyi3Q=; b=aXz+64K7w6aS+1x1I7NKZ+h0XMpTr8gTFI6d7qPqY8QjI9T8Ftn/b/gvz2F7Z4LpuW 9romRFP5sRcKy4U/yHmOeeyISFPkEwXGuullhaUUCZ1pnaQ6dKud/iDEEiikdcxz6GY+ TMXI20noJtXDSMeCzdLLb4RbGarMKagG50Rlnl+VnStmNZz7SB4/qfBWgaI9Xkauj/Ar Rbpad5annKW1G0qmgbYew/NYigQ77pCaHVIBnciO+1vNfojBTozHI2AiHYcw2uW2BcAP umA0YZsfffPBT/bL2m/9btmztc1EdFJVpk8kg7B7mcpoPs93IszvcHkV+ApOhs793OQ6 WJ1g== X-Gm-Message-State: AOJu0YwBWHuIKYJ3PFALPu2K0Gyc7YgeG7nJllPichIVAo2/SEHa8fL+ D3x7rjIrz1sRkg1H/eai/QYdxpmYPsTNB5UnPSzYwWbAuPAfuUCNsAMRRrQ981oWYeIRPl/EKQi 0faG9XLC6K7Y+0gY4RKuiB8uPVj8OJbwalINJyA9fAZ+KsPo6ely6mV2EvCKwQT5qAT2EtPsCWT aLI9o28x3Z X-Gm-Gg: AR+sD11+ZeNebmtN/i+rH+AHDHly36ppRDGBeyvkrjiL0zcIE85VaoHsW0zCzVjEzTu YYD27Lnkeh6KPF/ikrSs8EZVtnRDrE02qwEQtGQCxzctFmsbTclMr3MzM6x+Lc+zXnXhx3bLfpZ fJEV64Er7KraNrOW0bHgMdmCD+t+VS6rMB+XuOhfK2Y2sNGKx0kjGClZrX4GVm2qmTGShDbSB0b TK3VRszB/mpTTOsXYISzfqhbs5GJYQ3DhdxCOtKri5uJl91crsLR8wvbKNUoaPFNvIzm9ao4esA fO3AlAXjTmQ1SyCijcPJNZZ4Lz2Xcq2xHwVxfSZlJ1K2L6Q1+C/8KbI4qhBP8/ugsyMr07iu9jr 6agXTDbbKX3P01ft2PR7AiBNLnCkcsCAf9qZzYk5SWJ5aek44Nq7JAqPUsrRmCBkMBRf24D92mn 2MWePYJmnQd9b0ME8= X-Received: by 2002:a05:622a:248e:b0:517:c65c:4987 with SMTP id d75a77b69052e-52dbee79e57mr76970421cf.22.1787061955572; Tue, 18 Aug 2026 07:05:55 -0700 (PDT) X-Received: by 2002:a05:622a:248e:b0:517:c65c:4987 with SMTP id d75a77b69052e-52dbee79e57mr76965171cf.22.1787061953793; Tue, 18 Aug 2026 07:05:53 -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 4fb4d7f45d1cf-6a3d85a30b7sm1874967a12.30.2026.08.18.07.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 07:05:52 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , =?utf-8?q?Niklas_S=C3=B6?= =?utf-8?q?derlund?= , Loic Poulain , Hans de Goede Subject: [PATCH v9 3/8] ipa: Allow pipelines to have differently named IPA Date: Tue, 18 Aug 2026 16:05:43 +0200 Message-ID: <20260818140548.179663-4-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260818140548.179663-1-johannes.goede@oss.qualcomm.com> References: <20260818140548.179663-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Info: AW1haW4tMjYwODE4MDEwMyBTYWx0ZWRfX1U4nYHisUA/I GCBbNL2D4WwZ9Ha1DHKXE5Uy2TlPodazs9VOMG7ocQg0VcYwf0/3hUFnwAdfn5EZoMi/u4k6+yn 2TLUJBRo2esvVKR2jqRZ2h33NsRw8bw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE4MDEwMyBTYWx0ZWRfX/K8mq7UlV8CD wee7o5SRClCNdiPORHKDKZxJq2n54JSxaNE01nfXoyP0Y9840/BQqWs5rMhJUbhP38A43llskSX JDMxtCMXaTB8/FA4sGHqIMGqwJPoyRjQsFOh29xH6fGUuOGeO7g58LHk5MeEpk7BDrmClsQK2Qp RzmuW6IUtmTMNX2kRxnq99lMLGQ2tbCSX2A16u/fTdeXwyO4xyA+oEsxqxtxIqT3TyVfBmUuz1Z bBO7g6dstO/dAFAy0H8jEzHnR28m2/TRbpSbMJEnsQ1eAF00Ey4K8VI1+Ts2Jf7pCB4Gj15MIVn ZE1OujFR0zNsdLf9KyKF0GeOuv7GxyNbOF/ka3XUEFr1PQosGpzhaKnW24xtwm6107RIPbVo7Nn h1xVage16G0phTuk1ymJX1mbE4Owd+YbRdXElxO6Y34XIw7pM+t6OdtpVyP2Gy6YULsboLri5PE UrQwpV5s3fB/oIsCqbQ== X-Proofpoint-ORIG-GUID: oR54lO9TIVKwkxF8_LS7riS-z-wPCtMv X-Proofpoint-GUID: oR54lO9TIVKwkxF8_LS7riS-z-wPCtMv X-Authority-Analysis: v=2.4 cv=bvB8wkai c=1 sm=1 tr=0 ts=6a8466c4 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=P1BnusSwAAAA:8 a=EUspDBNiAAAA:8 a=c6ydndUcIca2Pb-fbGsA:9 a=uxP6HrT_eTzRwkO_Te1X:22 a=D0XLA9XvdZm18NrgonBM:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.134, FMLib:17.12.100.49 definitions=2026-08-18_02,2026-08-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 spamscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608180103 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. 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. Reviewed-by: Hans de Goede Signed-off-by: Jacopo Mondi Signed-off-by: Hans de Goede Reviewed-by: Barnabás Pőcze --- Changes in v7: - Drop R-Car Gen4 mention from commit message Changes in v3: - New patch in v3 of this patch-series --- 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