[{"id":32096,"web_url":"https://patchwork.libcamera.org/comment/32096/","msgid":"<26onho25kdg3iyyg3zojcwweb2hu4kxmpewmewt3uopmdomlv2@onxw2wuczgko>","date":"2024-11-11T09:33:20","subject":"Re: [PATCH v5 11/13] libcamera: mali-c55: Enable links between\n\tresizer and video node","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Dan\n\nOn Thu, Nov 07, 2024 at 10:58:44AM +0000, Daniel Scally wrote:\n> The mali-c55 driver now expects links to video devices to be enabled\n> in order for those devices to be streamed from / to. Enable the media\n> link between the resizers and their associated video device to fulfil\n> the requirement.\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n> Changes in v5:\n>\n> \t- None\n>\n>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> index 97827abd..b00cbce5 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> @@ -834,6 +834,17 @@ int PipelineHandlerMaliC55::configure(Camera *camera,\n>  \t\tStream *stream = streamConfig.stream();\n>  \t\tMaliC55Pipe *pipe = pipeFromStream(data, stream);\n>\n> +\t\t/*\n> +\t\t * Enable the media link between the pipe's resizer and the\n> +\t\t * capture video device\n> +\t\t */\n> +\t\tconst MediaEntity *rszEntity = pipe->resizer->entity();\n> +\t\tret = rszEntity->getPadByIndex(1)->links()[0]->setEnabled(true);\n> +\t\tif (ret) {\n> +\t\t\tLOG(MaliC55, Error) << \"Couldn't enable resizer's link\";\n> +\t\t\treturn ret;\n> +\t\t}\n> +\n>  \t\tif (isFormatRaw(streamConfig.pixelFormat))\n>  \t\t\tret = configureRawStream(data, streamConfig, subdevFormat);\n>  \t\telse\n> --\n> 2.30.2\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 7BF3ABF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Nov 2024 09:33:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AB94A657CC;\n\tMon, 11 Nov 2024 10:33:26 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CEF33657C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Nov 2024 10:33:24 +0100 (CET)","from ideasonboard.com (mob-5-90-143-109.net.vodafone.it\n\t[5.90.143.109])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E88486AF;\n\tMon, 11 Nov 2024 10:33:12 +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=\"W9Bhvjnh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731317593;\n\tbh=DDjYUKuT1346KkyMrIzKtbSaMxQdi0oF2BlMvyF/8kc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=W9BhvjnhFVqaw5gWSia4+p5BrkVXqvJKnWDf7k0CQk1jFZ92LjSt6MJ8lXxZppL86\n\tL8TNhYoWXVdYkpXmCwhOr8cXTmVUc56KC0bMEyVKs8HxpyZpo8s4sS6tLP8NeSQQKk\n\t+mszWkSY6zfi2DxcqN7KWVl0HZZ+5M9kRgH4lg7k=","Date":"Mon, 11 Nov 2024 10:33:20 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v5 11/13] libcamera: mali-c55: Enable links between\n\tresizer and video node","Message-ID":"<26onho25kdg3iyyg3zojcwweb2hu4kxmpewmewt3uopmdomlv2@onxw2wuczgko>","References":"<20241107105846.52287-1-dan.scally@ideasonboard.com>\n\t<20241107105846.52287-12-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241107105846.52287-12-dan.scally@ideasonboard.com>","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>"}},{"id":32111,"web_url":"https://patchwork.libcamera.org/comment/32111/","msgid":"<20241112064025.GE21062@pendragon.ideasonboard.com>","date":"2024-11-12T06:40:25","subject":"Re: [PATCH v5 11/13] libcamera: mali-c55: Enable links between\n\tresizer and video node","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Dan,\n\nThank you for the patch.\n\nOn Thu, Nov 07, 2024 at 10:58:44AM +0000, Daniel Scally wrote:\n> The mali-c55 driver now expects links to video devices to be enabled\n> in order for those devices to be streamed from / to. Enable the media\n> link between the resizers and their associated video device to fulfil\n> the requirement.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n> Changes in v5:\n> \n> \t- None\n> \n>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> index 97827abd..b00cbce5 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> @@ -834,6 +834,17 @@ int PipelineHandlerMaliC55::configure(Camera *camera,\n>  \t\tStream *stream = streamConfig.stream();\n>  \t\tMaliC55Pipe *pipe = pipeFromStream(data, stream);\n>  \n> +\t\t/*\n> +\t\t * Enable the media link between the pipe's resizer and the\n> +\t\t * capture video device\n> +\t\t */\n> +\t\tconst MediaEntity *rszEntity = pipe->resizer->entity();\n> +\t\tret = rszEntity->getPadByIndex(1)->links()[0]->setEnabled(true);\n\nI Would use the MediaDevice::link() function here, and verify that the\nreturned link is not null before proceeding. Same in other places where\nthis is applicable in the C55 pipeline handler. You could also cache the\nlink pointer in MaliC55Pipe.\n\n> +\t\tif (ret) {\n> +\t\t\tLOG(MaliC55, Error) << \"Couldn't enable resizer's link\";\n> +\t\t\treturn ret;\n> +\t\t}\n> +\n>  \t\tif (isFormatRaw(streamConfig.pixelFormat))\n>  \t\t\tret = configureRawStream(data, streamConfig, subdevFormat);\n>  \t\telse","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 C9601C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Nov 2024 06:40:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BB72657E0;\n\tTue, 12 Nov 2024 07:40:35 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A5020618BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 07:40:33 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 247126AF;\n\tTue, 12 Nov 2024 07:40:21 +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=\"EJNbonem\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731393621;\n\tbh=OGSAOaIbcspLY42GB9YtdqhSdFguqNme94lAec2ackU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EJNbonemFr5dReivrh16ldkq2QBEbWBW3cHfD7qRUDCBDGsQbrCNIXYQkapfevnF2\n\tIY/PsT8j6XHbgEen51gfTwxiRkbkUNZ3zZ0DVkNDiraTlyifbB6aGO4qMGV/vqF2EM\n\thA63uLBO1Skn8o+nF4TIcCqBSZzKQ5IMNNAkGXWw=","Date":"Tue, 12 Nov 2024 08:40:25 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v5 11/13] libcamera: mali-c55: Enable links between\n\tresizer and video node","Message-ID":"<20241112064025.GE21062@pendragon.ideasonboard.com>","References":"<20241107105846.52287-1-dan.scally@ideasonboard.com>\n\t<20241107105846.52287-12-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241107105846.52287-12-dan.scally@ideasonboard.com>","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>"}}]