[v7,0/8] libcamera: mali-c55: Add support for memory-to-memory
mbox series

Message ID 20260331-mali-cru-v7-0-4caedc898a0e@ideasonboard.com
Headers show
Series
  • libcamera: mali-c55: Add support for memory-to-memory
Related show

Message

Jacopo Mondi March 31, 2026, 4:36 p.m. UTC
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 <jacopo.mondi@ideasonboard.com>
---
Changes in v7:
- Allocate the same number of buffers on Mali and CRU side:
  - Add a patch that defines the number of in-flight requests and use
    them to allocate buffers on the MaliC55 side
  - Make the number of CRU buffers to be allocated configurable
  - Now that the number of Requests in-flight matches the number of
    buffers available for stats, params and CRU, we can remove the
    pendingRequests_ queue and confidentially ASSERT() that we'll always
    have buffers available for capture
- handle components set-up in registerMemoryInputCamera

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 (1):
      libcamera: mali-c55: Add RZG2LCRU class

Jacopo Mondi (7):
      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: Do not rely on bufferCount
      libcamera: mali-c55: Implement capture for 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   |  70 +++
 src/libcamera/pipeline/virtual/virtual.cpp    |  10 +-
 7 files changed, 860 insertions(+), 187 deletions(-)
---
base-commit: 2a1c75504c789b686b5b37ed8729f632ec81d2f0
change-id: 20251205-mali-cru-e212f8ab332e

Best regards,