[{"id":38363,"web_url":"https://patchwork.libcamera.org/comment/38363/","msgid":"<6de6ad4e-95ec-4aeb-ab35-dddd5f790617@ideasonboard.com>","date":"2026-03-18T15:54:55","subject":"Re: [PATCH v5 3/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n\n2026. 03. 13. 17:14 keltezéssel, Jacopo Mondi írta:\n> In order to prepare to support memory input cameras, split the handling of\n> the TPG and Inline camera cases.\n> \n> The Mali C55 pipeline handler uses the entity and subdevice stored in the\n> CameraData to support both the handling of the TPG and of the Inline (CSI-2\n> + sensor) use cases. Adding support for memory cameras by using the CRU unit\n> would add yet-another special case making the code harder to follow and\n> more prone to errors.\n> \n> Split the handling of the TPG and Inline cameras by introducing an\n> std::variant<> variable and to deflect the functions called on the\n> camera data to the correct type by using overloaded std::visit<>().\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>   src/libcamera/pipeline/mali-c55/mali-c55.cpp | 298 ++++++++++++++++-----------\n>   1 file changed, 181 insertions(+), 117 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> index c209b0b070b1..45e23ffd3841 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> [...]\n> @@ -1573,10 +1633,11 @@ bool PipelineHandlerMaliC55::registerTPGCamera(MediaLink *link)\n>   \t}\n>   \n>   \tstd::unique_ptr<MaliC55CameraData> data =\n> -\t\tstd::make_unique<MaliC55CameraData>(this, link->source()->entity());\n> +\t\tstd::make_unique<MaliC55CameraData>(this);\n>   \n> -\tif (data->init())\n> -\t\treturn false;\n> +\tint ret = data->initTpg(link->source()->entity());\n> +\tif (ret)\n> +\t\treturn ret;\n\nI believe this should be `return false`.\n\n\n>   \n>   \treturn registerMaliCamera(std::move(data), name);\n>   }\n> @@ -1600,21 +1661,24 @@ bool PipelineHandlerMaliC55::registerSensorCamera(MediaLink *ispLink)\n>   \t\t\tcontinue;\n>   \n>   \t\tstd::unique_ptr<MaliC55CameraData> data =\n> -\t\t\tstd::make_unique<MaliC55CameraData>(this, sensor);\n> -\t\tif (data->init())\n> -\t\t\treturn false;\n> +\t\t\tstd::make_unique<MaliC55CameraData>(this);\n> +\n> +\t\tint ret = data->initInline(sensor);\n> +\t\tif (ret)\n> +\t\t\treturn ret;\n\nSame here.\n\n\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 5008DBE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Mar 2026 15:55:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E7F3F6272D;\n\tWed, 18 Mar 2026 16:55:01 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7558962010\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Mar 2026 16:55:00 +0100 (CET)","from [192.168.33.40] (185.182.214.153.nat.pool.zt.hu\n\t[185.182.214.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 960F5460;\n\tWed, 18 Mar 2026 16:53:47 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qjHV7aXV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1773849227;\n\tbh=T1IkS9oay3x/D/lbRV0cOTbzxFLAMkhZb90yogTjvHM=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=qjHV7aXVrndUtxDueeOp/cWWpJxiw2o0c14N/s7q/2FRqTcMXgQWF2mh7FuvmBQSu\n\tsKK+MZnwl/VlJq0AiufkgEWQYsxoJBmMVT61bnLLv+duKTHMFhLKbeOqGs0zPyCIra\n\tey4wpsbc2NN2eDGfdBjta6TafpGivR8RvOp8hW50=","Message-ID":"<6de6ad4e-95ec-4aeb-ab35-dddd5f790617@ideasonboard.com>","Date":"Wed, 18 Mar 2026 16:54:55 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v5 3/7] libcamera: mali-c55: Split TPG and Inline camera\n\thandling","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260313-mali-cru-v5-0-48f93e431294@ideasonboard.com>\n\t<20260313-mali-cru-v5-3-48f93e431294@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260313-mali-cru-v5-3-48f93e431294@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}}]