Skip to content

RK3588: RgaBlit fails (Invalid argument / I/O error) on NV12 DMABUF with padded stride (2304×1080 / 2816×1944) + dmesg: “RGA_MMU unsupported memory larger than 4G” #146

@chrisbeeze

Description

@chrisbeeze

Environment

  • SoC/Board: RK3588 (NanoPi-R6C)
  • OS/Distro: Debian 11
  • Kernel: 6.1
  • librga: 1.10.5
  • rga driver: 1.3.4

What I’m doing
I’m running "H.265 RTSP transcoding" using Rockchip MPP decode+encode (GStreamer-based). In “zero-copy” mode (DMABUF), the pipeline triggers "RGA blit" internally (likely for stride/align conversion). Under these resolutions, RgaBlit fails and video drops.

Case 1 (1920×1080):

  • Buffer size: 3732480 bytes

  • Source looks like padded NV12: stride_w=2304, h=1080 (because 2304×1080×3/2 = 3732480)

  • Encoder log shows it wants aligned height: stride [1920:1088]

  • librga print:

    • RgaBlit(...) RGA_BLIT fail: Invalid argument
    • rect[0, 0, 1920, 1080, 2304, 1080, ...]
    • rect[0, 0, 1920, 1080, 1920, 1088, ...]
Image
  • kernel dmesg around failure:

    • rga_mm: RGA_MMU unsupported memory larger than 4G!
    • ... job buffer map failed ... submit failed
Image

Case 2 (2592×1944):

  • Buffer size: 8211456 bytes
  • Padded NV12: stride_w=2816, h=1944 (2816×1944×3/2 = 8211456)
  • Similar RgaBlit failures and dmesg.
Image Image

Note: system RAM usage is ~1GB during test, but dmesg still prints “memory larger than 4G”. I suspect this refers to DMA/IOMMU addressability rather than actual RAM usage.

What I tested

  • If I fall back to CPU copy/repack (strip padding into tightly packed NV12), encoding works.
  • Only the DMABUF “zero-copy” path triggers RGA and fails.

Questions:

  1. On RK3588 (multi-core RGA), how should users handle buffers where width stride is padded but height is not 16-aligned (1080 vs 1088, 1944 vs 1952)?

  2. Is this expected to be rejected by RGA core selection?

  3. Your FAQ says “RGA_MMU unsupported memory larger than 4G” happens when memory does not satisfy the selected core requirements; what is the recommended way to:

    • force RGA3 when possible, or
    • allocate <4G-addressable memory (DMA32), or
    • avoid selecting RGA2-only paths? ([GitHub][2])
  4. Is importbuffer_xx required/recommended when using external dmabuf FDs on RK3588 to avoid this under load? (FAQ mentions wrapbuffer vs importbuffer behavior.) ([GitHub][2])

#73

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions