From patchwork Fri Dec 5 14:52:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 25374 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 756C2C326B for ; Fri, 5 Dec 2025 14:52:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1E311613F9; Fri, 5 Dec 2025 15:52:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CYvNHnkM"; 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 6B023613A5 for ; Fri, 5 Dec 2025 15:52:31 +0100 (CET) Received: from [192.168.1.4] (net-93-65-100-155.cust.vodafonedsl.it [93.65.100.155]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C5E711EF; Fri, 5 Dec 2025 15:50:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764946215; bh=YjJ9aXd41gmwwuZExWFJU4Q3KYuLVmrMwL87At7x/54=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CYvNHnkMxtJjXQT6ZP5AcQ7O12+6zj2ocMaw3RQq9jSqyZg1vNUnJBM6/+WikvLBK kR5j5TBQYx/QaFNWUnzQ6vMgTzhw8qyIwKdAbwvG9htw3jS+X6CekGnQu/sbm/m+5p poOetMU4J5hgg5ogyyfh0uw4BpRYaj9Ui4beFZU4= From: Jacopo Mondi Date: Fri, 05 Dec 2025 15:52:10 +0100 Subject: [PATCH 4/7] libcamera: mali-c55: Configure camera in memory-to-memory MIME-Version: 1.0 Message-Id: <20251205-mali-cru-v1-4-d81bb5ffe73a@ideasonboard.com> References: <20251205-mali-cru-v1-0-d81bb5ffe73a@ideasonboard.com> In-Reply-To: <20251205-mali-cru-v1-0-d81bb5ffe73a@ideasonboard.com> To: Daniel Scally , libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=YjJ9aXd41gmwwuZExWFJU4Q3KYuLVmrMwL87At7x/54=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpMvGtxWQUjspbepm4kjtnEcqCa+phRAaKWBMOf yvXeein2dSJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaTLxrQAKCRByNAaPFqFW PId9EACkUuQAlk0xkIEun1SMk9vvebbjb3GGS9JFkfJeufSPJsO52v/yN29FIcKZ6OopIRpLZVx eCXoz15bMq+G9Si2oDQ1qd+RhaoeRdaSrflyKVkYkbZwuyD8abHi/4jHXFR46fuQiTd4eh76Ff7 Jjdetu15G4bxkNx6gwR52Q50jNql+Rosbf+CUyy6Ja7o120iwLX9lXepRjcXuQGqwMqEZGHiCWB 47BqLfAZWwyN0jv/uSHywiGdsV8mMmnJQ0yTX6slGIJsHOCCTfR4f0xI+1bBW/4MGBMwNt/GJ59 C2NY0PLrTSg9178EAWEm7cBkB0NJ2B2qtzXk39uk2Wism2jwwhDIKI6bKF6nK1GWS0Nk2XA2Lki s9CzRqdcS7EFTu0uy72XuFi7V3LGAJwkEqIdGJw74+TVbPWLLjMG2MQXO8dNK5iy8BUmZ+5hu1i 0ec95EiXyAqkd6ezerQaIMcVFkxVYO1FLBInlU4blhOxrZQ9ZTeFR8Bg+ufO7p03N7og/NbjMgc AqB+AmPUpPffzWhaZAJliXOGVxdcrfocnAMGOF3S9rFlCLxvgH3BCgZZZNXgsqt5/hT4b7yRgxI V/sOR16Pb1uaFlqxYJLGoVJD+NGHe7ALXvWjCBMz8z3uddg2L0+r31L942wV9ikKaPWpgqdqk7c +Qu+b3/bY7Hsbkw== 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 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 6816bf7179ae09434ec10c35ea296725d3ac0700..6dce315c1c82db3554e8c0eae727cba9d632ca82 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -1021,9 +1021,12 @@ int PipelineHandlerMaliC55::configure(Camera *camera, ret = csi2Entity->getPadByIndex(1)->links()[0]->setEnabled(true); break; } - case MaliC55CameraData::Memory: + case MaliC55CameraData::Memory: { + const MediaEntity *ivcEntity = ivc_->entity(); + ret = ivcEntity->getPadByIndex(1)->links()[0]->setEnabled(true); break; } + } if (ret) return ret; @@ -1049,9 +1052,28 @@ int PipelineHandlerMaliC55::configure(Camera *camera, ret = data->inlineInput.csi2_->getFormat(1, &subdevFormat); break; - case MaliC55CameraData::Memory: + case MaliC55CameraData::Memory: { + V4L2DeviceFormat inputFormat; + ret = data->memoryInput.cru_->configure(&subdevFormat, &inputFormat); + if (ret) + return ret; + + /* Propagate the CRU format to the IVC input. */ + ret = ivc_->setFormat(0, &subdevFormat); + if (ret) + return ret; + + ret = ivc_->getFormat(1, &subdevFormat); + if (ret) + return ret; + + ret = input_->setFormat(&inputFormat); + if (ret) + return ret; + break; } + } if (ret) return ret;