From patchwork Wed Aug 12 18:50:50 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: 27767 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 78693C3264 for ; Wed, 12 Aug 2026 18:51:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F7A7682D9; Wed, 12 Aug 2026 20:51:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="bKcDIes8"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XIxebIHZ"; 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 4C979682CC for ; Wed, 12 Aug 2026 20:51:09 +0200 (CEST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67CI8gEn3792111 for ; Wed, 12 Aug 2026 18:51:07 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=bKcDIes8wCaEelZHflH0FHXFTfy 2owoqOUBXMyY/GBOS3bXgG62WVtsD5K2ZoJFpSfAjvHHxpOa7cLWVGDmdgxgGI7T 0rPIBlXHB/BS6ocPoM2jgbkLYaROVdWqVs6z3OMS4WTi6//1IFci2XQ8uiG5RUqw CtH67INeON9ryXTK83oeYyxWonpSd8BEcPgWg83/by6MZwTBcLQABoiyYLSLeiA2 qasRjsKzMjFGCGyUAyjy80JR3mRvXNQ91eCidaeWLrOfMjhqdQOkqKKJY1bY2enj RZAJVRHV/gmn/oWpLuOo1h6P80YsqDa8SKPnD8rIG2NtqsY/1B1eCZLNQOw== 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 4g0mndawhg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 12 Aug 2026 18:51:07 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c20762d21so19755151cf.0 for ; Wed, 12 Aug 2026 11:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786560666; x=1787165466; 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=XIxebIHZAcitbJRqASO9Q1K4OooZLAcWJtU0tHFkflgsyiGtdkvLVSClEjBI2VFJ5y StXArgy0HboGjUErezMQbciicq0b+8lL1ieOTLjoiOByoLZD+UnSVsCwX4vxSp+jV5pz 2LUWmz2GUCnk9sNZZiRt20alWJ6g3WUk87Zb+OHvLIotf0lVG7atS1uYAf4sZdv1S15h o+9utzCuMJCKmDK6Dz1hn8GFN9Ml474qAzjjNVTd5u8isMRcv4dCuooxYBAqvU219ZCZ SwVmP2EhRbhsHQGhjX/+l5ZOf1BcLk+X7Qk8VEP2QTJNmOWWPvMgw3ee7ZnnNJoouZr3 lNOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786560666; x=1787165466; 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=V1K53STKYlZKobZ2hQzzkRzcX2mN3QkH5nO6IcpO1ENZuhtb5nCbDduYtA+UmnFW8e UqZLRPctSZIIlR1p2s1tGWC06rJJ0ZzOUybqzROcjkCmRTa9eZBXyy1M9CINj9E12TIq a2nw80yy7ZoS3VjVPsmDCVpMGdVA7fxhtPA4x6LpgKSriVYr1BlV+a6KwLQPOwLhPCMv fKU1MhRcWbb5aRVwQUCBhQ41hxxS0lB4f5clNxQy6NVYzA97hCsw9vCl6NLZvwKWBkHQ 6Cr1YUKlT4WmuoBQKixVWEGT6MgsWIWSvHxlmAqFNnqSy5C7yRqP4JLIs+zlO9HNUjC/ 5obw== X-Gm-Message-State: AOJu0YylKvjX7N3VlbSH98+AqHE/5UmsQd8Rz+Xv4V7bSlWjFL+tICxf 7+WsKiQ2T2J6nVZRWm529Ax2kTrSgMw8Re3f5aiP0cBXO9oBo+4zMz/3DsEKDATnf3Xg71REUFG cZ516c0/op4ObcmEZpfJycr51MI9tJGvNgWFrDZQ4X4ZNmTWK0rBf2Lb0dE29PW6h/frqIpdKJF IW2s0VZmTS X-Gm-Gg: AR+sD12s4N/k7ylkvQcQXpuU637o2+rKVVMVdlq0Bl5QImEgGdLbaxDl3ZmFmvnO/1Z 4dAM343vkpgROOOhUXfFkK5PxRkdx8E1QS2NUi4Z9HzQCksgtROAN2/C8F2g+qXbbPyiyKydEmP s3lv1hsei8xSorKDphP0yRbyVpcpvLnXKqqaiEqo3t/8viUQPQ8aVfHRRXZBF1JVY9DqwAgNNoz mfV8JOEIsQUrmZzMmcYCSwY6a4Yt2f7ZIVeyZ8ymejsZmourALnWKHdwM/91JMqhnfxpqBaGV9f U+LlEZl83m4C3o0GYec5ygSrvLBE2JEXLCMs0lzYLFulVyFwsANyLB3zk0W+NRe+byMhONcFPCO DQnyyZDFHWXKNb1sxc1X4L+7VuKSdABkh3uKYPRAm+rS6U1NGdpoyc2Z9B1lisagqfBzFt0CB1J QeH/OwPYmrfSV8gZc= X-Received: by 2002:ac8:58d4:0:b0:51c:207f:6524 with SMTP id d75a77b69052e-52d73df08c6mr2621431cf.37.1786560666361; Wed, 12 Aug 2026 11:51:06 -0700 (PDT) X-Received: by 2002:ac8:58d4:0:b0:51c:207f:6524 with SMTP id d75a77b69052e-52d73df08c6mr2620941cf.37.1786560665858; Wed, 12 Aug 2026 11:51:05 -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-6a37f8cd810sm47977a12.26.2026.08.12.11.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 11:51:05 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Loic Poulain , Hans de Goede , Jacopo Mondi Subject: [PATCH v7 3/8] ipa: Allow pipelines to have differently named IPA Date: Wed, 12 Aug 2026 20:50:50 +0200 Message-ID: <20260812185055.289021-4-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260812185055.289021-1-johannes.goede@oss.qualcomm.com> References: <20260812185055.289021-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Info: AW1haW4tMjYwODEyMDE1MSBTYWx0ZWRfX9ILAARujVdid JFVMNfsYzVfESe1oKG80K7G/J8cd+66endbwP6LsV8PnT7sEtyWzm0schK0f8uJzEPCbFZfn9+U OY5FlHOUtMQ8NZGY6anFU4AGvQBZ8pc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEyMDE1MSBTYWx0ZWRfXybCXTsF8i6fl hg5JgEh6eOiFoLuD8FLqWBE1qnysYu241HGNm2Ybs4zkXj0ezXrYT/VE1SjfsQrVvFRlbPuMbny v6Szx2pwKYxo5bQS6rE8Yr+SPyNKdlM5SN1Y0RaXRAKxQb/Bnm/9aZghDafBBkDM5KkJ5AviANC +efHXHYX0EIiulYeinBHyXx5SS6O9722IfxDSEkebE+JLd5wT2gLS9kE/OC3VO5/dhPGHkGWZJC uu6jfahIFNGohoTeT7DUCL50yvsjAYn207urFvyhUL47Kkt9O2dzbfmWJ2qurIRAtiJ6UXIi1bi PadDfaBQ2Y8GoZnrNvjuVjXOSj5RKjga3Saaz/P4EXzys+rXPn2lDeefd6wC/dguKmmn98B5zCw C6Rh5wgUOjuYAZyhTxyEbPfImOb3wT7jiSyVmverd5NTCdACRboxCg+BIAJoxDCcdkI64t7cuxp e7pUT/XuAm1zMCk60Cw== X-Proofpoint-GUID: iUR4Vm26piw0qaWjcDq2PAMi3uxRSiaf X-Authority-Analysis: v=2.4 cv=C87ZDwP+ c=1 sm=1 tr=0 ts=6a7cc09b 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=DJpcGTmdVt4CTyJn9g5Z:22 a=P1BnusSwAAAA:8 a=EUspDBNiAAAA:8 a=c6ydndUcIca2Pb-fbGsA:9 a=uxP6HrT_eTzRwkO_Te1X:22 a=D0XLA9XvdZm18NrgonBM:22 X-Proofpoint-ORIG-GUID: iUR4Vm26piw0qaWjcDq2PAMi3uxRSiaf 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-12_05,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608120151 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 --- 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