From patchwork Wed Mar 25 14:44:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 26334 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 3FD6ABD87C for ; Wed, 25 Mar 2026 14:44:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3CD156283F; Wed, 25 Mar 2026 15:44:21 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JC1r6iQX"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D21CF6274D for ; Wed, 25 Mar 2026 15:44:18 +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 B226D121A; Wed, 25 Mar 2026 15:43:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774449780; bh=g71A6CnRcOvVK8YQr257TMTee8ftNJO+2dMpieUqdf4=; h=From:Subject:Date:To:Cc:From; b=JC1r6iQXv/FZ9tiZZxpGd0v9e86i/Wux2scFyBddPxS0INJXa/ByBYeBdr5yl+3v5 cy7/AJ9e4/+MFgJeU6IVWDD9++wWOwmF5ktDK0GSuT4sJEHY/s08DQkch4aOxb3V0r kQjhIo/WeHGSRmCYp5OIB9n1oACbZIMz2kWbhOJA= From: Jacopo Mondi Subject: [PATCH v6 0/7] libcamera: mali-c55: Add support for memory-to-memory Date: Wed, 25 Mar 2026 15:44:07 +0100 Message-Id: <20260325-mali-cru-v6-0-b16b0c49819a@ideasonboard.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALf0w2kC/3XOTU4DMQwF4KtUWROU2MmQsOIeFYv82DQSnaCEj kDV3J20EtIsOstn+3vyVXRqhbp4PVxFo6X0UucRpqeDSKcwf5AseWQBCqwGZeU5fBaZ2kUSaGA XIiKQGOdfjbj83KuO7yOfSv+u7ffevOjb9EHJoqWS2ekYLTO9YHgrmUKvc6yh5edUz+LWtcDGa 7XxMDzBZEBnGuu443Hr/cbj8MyeWaFRLvodb/79pFDjxpvhk8o+Jpey473/7Z63wxvHHsmgBm8 e+HVd/wAdPFhwpwEAAA== X-Change-ID: 20251205-mali-cru-e212f8ab332e 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=2748; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=g71A6CnRcOvVK8YQr257TMTee8ftNJO+2dMpieUqdf4=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpw/TBs7nRrj+EQ0AXlnjjFQxWLpAUz8M1hfIhJ jcTnVHku9eJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCacP0wQAKCRByNAaPFqFW PCqKEADAvN1FotiGXkFVoyaeoNHdUPt2w+NOvtIffZF05k5A53GgHqJD/z7YwzJL6qwt+FizGHB PQBJA50f9Cl3Il8NmTX+lKqgUI6ppSDL4vsJpll1e6TZLcb/9rxbXBFq0zNMk7ygEJAxpGJFVj5 CEDYdkv1QI/FavJKPQnC5mNtDJuSGK1wp4l9cJDw8UaK3I6QRk1X3snGIhQB0k+NOJjSFrJUhJV FauKzKXOVI0NTYp7HI0MnNDAHiI6gENj5i3iY3SBXhzLW/vI4QCbOyOvanFttquI5654mhjREvG cL9fNZD9bTyd8Dj19xV5JN6SOGxg3L30O5TbV1q+CFI/se40fwHi0pMXAqbxHm7YbyJb2gowhgJ 2hme55QQ8qGSGKAFMHvPam3/n16xOVy6lDY3+F4uzqYia1/ArFeoUJIffVz5its7oBnPu3Vw47N 8Zz+iUu7/OeSc+5swoxcpzFIm0TTqYkF9b6o6k+OU+ZozGu5Pwz8y5WCpRyv0V1+UgNwh/Rrhsj 74qcrix9jORqM2TCalX1m4pbENjy9Y9NNLDMu5NdVrO1zur9xa7A5a/SJNBvGF0US0tva9oZhTa z0qiY18ZveZJKLr04yvIaRQlk7ZgcPbBcJYmP7qQSjRrCXHFjyC0F71OHIa4xCNqnWJ5xk4B8Jd Z9dcAyUQnZdNiOg== 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 m2m camera operations in the mali-c55 pipeline handler. The series targets SoCs like the Renesas RZ/V2H(P) one where the Mali-C55 ISP is integrated in m2m mode. The CSI-2 receiver (CRU) saves images to memory and the ISP is fed through a dedicated DMA engine that provides memory interfacing capabilities. The series starts by adding support for the RZG2LCRU class (named after the media device name) and then plumbs memory-to-memory operations in the pipeline handler. Tested on RZ/V2H(P) EVK with imx708 camera sensor. Dan, could you re-test with Inline mode please ? I should have collected your fix that restored proper operations with Inline. Signed-off-by: Jacopo Mondi --- Changes in v6: - Address use-after-free errors reported by Barnabas by splitting CRU buffer release from device streamoff - Address proper handling of Camera::stop() when in m2m using ASan. I suspect inline would probably need fixes as well when run with ASan - Minor improvements to code style Changes in v5: - Use overloaded std::visit when possible - Adjust indentation Changes in v4: - Move the overloaded visitor helper to utils.h Changes in v3: - Drop dynamic polymorphism and use overloaded visitor in MaliC55CameraData. The result is neater in my opinion. - Address Barnabas' comments I missed in v2 Changes in v2: - Almost a complete rework of the CameraData which is now a class hierarchy. I'm not sure the result is that much cleaner, but hey, I'm using templates and pattern with weird names, so it ought be better for sure --- Daniel Scally (2): libcamera: mali-c55: Add RZG2LCRU class libcamera: mali-c55: Implement capture for memory-to-memory Jacopo Mondi (5): libcamera: utils: Add overloaded visitor helpers libcamera: mali-c55: Split TPG and Inline camera handling libcamera: mali-c55: Register memory input camera libcamera: mali-c55: Configure camera in memory-to-memory libcamera: mali-c55: Fix sensor size computation include/libcamera/base/utils.h | 7 + src/libcamera/base/utils.cpp | 35 ++ src/libcamera/pipeline/mali-c55/mali-c55.cpp | 669 +++++++++++++++++++------- src/libcamera/pipeline/mali-c55/meson.build | 3 +- src/libcamera/pipeline/mali-c55/rzg2l-cru.cpp | 253 ++++++++++ src/libcamera/pipeline/mali-c55/rzg2l-cru.h | 72 +++ src/libcamera/pipeline/virtual/virtual.cpp | 10 +- 7 files changed, 871 insertions(+), 178 deletions(-) --- base-commit: 4937f5489b799e1ce5b0856cc34549abacb1f19a change-id: 20251205-mali-cru-e212f8ab332e Best regards,