From patchwork Fri Nov 15 10:13:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 21913 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 A6961C330C for ; Fri, 15 Nov 2024 10:14:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B36C765884; Fri, 15 Nov 2024 11:14:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="u5f7HGHm"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F02265875 for ; Fri, 15 Nov 2024 11:13:52 +0100 (CET) Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8EFA8157E; Fri, 15 Nov 2024 11:13:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1731665617; bh=6V0GJ1y1Ty69KjFXvve9kGzrRfWqUvoCB5D1UZb8kbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5f7HGHmLrm/1wMBeBuCp31HiwhS8SmYbUswjNvF6MoNuK/BX6NwrOjg5R8GB+4OF HCLDIB5fNddYurD0Tj35iHh6mjRrtKmjuafsLE1I1x1S3oHba/4BZnWQIAdCo8iaQh MfzVd3UNSYVWt6NoqS2Bgi5RUsV/jibiq1G+U9p4= From: Daniel Scally To: libcamera-devel@lists.libcamera.org Cc: Anthony.McGivern@arm.com, Daniel Scally , Jacopo Mondi , Kieran Bingham Subject: [PATCH v6 12/14] libcamera: mali-c55: Enable links between resizer and video node Date: Fri, 15 Nov 2024 10:13:32 +0000 Message-Id: <20241115101334.453104-13-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241115101334.453104-1-dan.scally@ideasonboard.com> References: <20241115101334.453104-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 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" The mali-c55 driver now expects links to video devices to be enabled in order for those devices to be streamed from / to. Enable the media link between the resizers and their associated video device to fulfil the requirement. Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Signed-off-by: Daniel Scally --- Changes in v6: - Used MediaDevice::link() to find and cache the links in MaliC55Pipe, which simplies their enablement in ::configure() Changes in v5: - None src/libcamera/pipeline/mali-c55/mali-c55.cpp | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index e973abc2..c0206ea2 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -509,6 +509,7 @@ private: struct MaliC55Pipe { std::unique_ptr resizer; std::unique_ptr cap; + MediaLink *link; Stream *stream; }; @@ -835,6 +836,17 @@ int PipelineHandlerMaliC55::configure(Camera *camera, Stream *stream = streamConfig.stream(); MaliC55Pipe *pipe = pipeFromStream(data, stream); + /* + * Enable the media link between the pipe's resizer and the + * capture video device + */ + + ret = pipe->link->setEnabled(true); + if (ret) { + LOG(MaliC55, Error) << "Couldn't enable resizer's link"; + return ret; + } + if (isFormatRaw(streamConfig.pixelFormat)) ret = configureRawStream(data, streamConfig, subdevFormat); else @@ -1028,6 +1040,12 @@ bool PipelineHandlerMaliC55::match(DeviceEnumerator *enumerator) if (frPipe->cap->open() < 0) return false; + frPipe->link = media_->link("mali-c55 resizer fr", 1, "mali-c55 fr", 0); + if (!frPipe->link) { + LOG(MaliC55, Error) << "No link between fr resizer and video node"; + return false; + } + frPipe->cap->bufferReady.connect(this, &PipelineHandlerMaliC55::imageBufferReady); dsFitted_ = !!media_->getEntityByName("mali-c55 ds"); @@ -1044,6 +1062,13 @@ bool PipelineHandlerMaliC55::match(DeviceEnumerator *enumerator) if (dsPipe->cap->open() < 0) return false; + dsPipe->link = media_->link("mali-c55 resizer ds", 1, + "mali-c55 ds", 0); + if (!dsPipe->link) { + LOG(MaliC55, Error) << "No link between ds resizer and video node"; + return false; + } + dsPipe->cap->bufferReady.connect(this, &PipelineHandlerMaliC55::imageBufferReady); }