From patchwork Wed Mar 25 14:44:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 26339 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 F25AEC32F7 for ; Wed, 25 Mar 2026 14:44:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C1C536283B; Wed, 25 Mar 2026 15:44:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Hce/ANx4"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 61B186274D for ; Wed, 25 Mar 2026 15:44:20 +0100 (CET) Received: from [192.168.1.104] (net-93-65-100-155.cust.vodafonedsl.it [93.65.100.155]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F5FC12BB; Wed, 25 Mar 2026 15:43:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774449782; bh=sP0IWdRDNIIoDrW3dfKUPHYNyxEAn42AOQ7h2wJnwIs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Hce/ANx41uhdH+xPBlQCiWl/7jq838ZpPJ/uWi76g1qPhgL5opoblSYI+odv/mYSD pQcOnmUw4EO3QXUaCbBsdRAGJCq4z3ih50PMZQWYyPh/zPSHwrryTbhPCs1V2ipsD3 bsIOEYbxqBj5szTxPIIwUUvNNoRggGQ0bf2F0Zx0= From: Jacopo Mondi Date: Wed, 25 Mar 2026 15:44:12 +0100 Subject: [PATCH v6 5/7] libcamera: mali-c55: Configure camera in memory-to-memory MIME-Version: 1.0 Message-Id: <20260325-mali-cru-v6-5-b16b0c49819a@ideasonboard.com> References: <20260325-mali-cru-v6-0-b16b0c49819a@ideasonboard.com> In-Reply-To: <20260325-mali-cru-v6-0-b16b0c49819a@ideasonboard.com> To: Daniel Scally , libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=sP0IWdRDNIIoDrW3dfKUPHYNyxEAn42AOQ7h2wJnwIs=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpw/TBFOcfItju3wI/6K0agWpPfOVINColHeEFx IauDWpntk+JAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCacP0wQAKCRByNAaPFqFW PJoyD/9k/UmLYEncMNbIEINmNyDPHYNEC/k7kijP+2r2IZKEgoVGt5oFFsiOCTkt2/4zGN+m1TN POYywo64l8WPCvWpZpIhNPUIUMnbEz987EkpVdNL0BK85C5eZkQQHNJdeDhX7I0Pv2x6pfmCY9v GygTtqtbcdqG3VstHy1ZV1iiOk1BOxgaroH8DhtBM4FehFkGqEyBboiAcFgNBdU/aQgu2KSmi74 KY5L/R95ki9dFbaInfzTuto2chglsL41dPNldpozCNhptq38in967KGfDisK3Ydve3dX/Fh+WHr lIGizyQoEHGBYA9/gYeaaF2HEYFBhbxwzKp3a6rA+1ec1GNQKN9lGKivurzdeebQHVEX1TjBnkl TysNJiRBQ5HaZsfXicPYNzaoAJZtobdaTV/QnAFxrmT3dJ/aapFuz+WUmL/J8kulqu8xPhEZHrI b3htcWfefKuKtqZv1Q7svuUX/UDxtPfggn6shG7ARQWdbBlBCvIGaCqBMZ2xYbLrJoYQAOEPy49 M5gt1+FVEpaZ7W3um3hKWbSjsJmSqeCEM+HNIkt8CKqF77I5uoezhxPTu17TsAmvlqrT5eWgMG3 vQ19LCKCC8WVQ8JoYz7aBoPU6oH6+8Jf0gyVjKYuctBFb50k2PD3L331Rqv1Yt061JqRM9C2gkG Orcpep4uh0aU2Kw== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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" Add support for memory-to-memory Camera to the PipelineHandlerMaliC55::configure() function. Start by enabling the IVC links, then configure the CRU and propagate the format to the IVC. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 26d368bb9132..be3e38da95ab 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -1013,8 +1013,9 @@ int PipelineHandlerMaliC55::configure(Camera *camera, const MediaEntity *csi2Entity = in.csi2_->entity(); return csi2Entity->getPadByIndex(1)->links()[0]->setEnabled(true); }, - [](MaliC55CameraData::Memory &) { - return 0; + [&](MaliC55CameraData::Memory &) { + const MediaEntity *ivcEntity = ivcSd_->entity(); + return ivcEntity->getPadByIndex(1)->links()[0]->setEnabled(true); }, }, data->input_); if (ret) @@ -1041,8 +1042,23 @@ int PipelineHandlerMaliC55::configure(Camera *camera, return in.csi2_->getFormat(1, &subdevFormat); }, - [](MaliC55CameraData::Memory &) { - return 0; + [&](MaliC55CameraData::Memory &mem) { + V4L2DeviceFormat inputFormat; + + int r = mem.cru_->configure(&subdevFormat, &inputFormat); + if (r) + return r; + + /* Propagate the CRU format to the IVC input. */ + r = ivcSd_->setFormat(0, &subdevFormat); + if (r) + return r; + + r = ivcSd_->getFormat(1, &subdevFormat); + if (r) + return r; + + return ivc_->setFormat(&inputFormat); }, }, data->input_); if (ret)