Skip to content

DRM driver issue with DRM_FORMAT_YVU420 on Raspberry Pi 5 #7117

@KonstaT

Description

@KonstaT

Describe the bug

I'm having an issue during video playback with Android on Raspberry Pi 5. This issue is not present on Raspberry Pi 4 with the same graphics components (drm-hwcomposer, minigbm gralloc, mesa vc4 & v3d gallium & broadcom vulkan).

R and B are swapped during video playback i.e. it looks like this.

Image

vs. how it should.

Image

Currently the kernel (https://github.com/raspberry-vanilla/android_kernel_brcm_rpi) is at 6.12.52 but this issue has been present from the start on Pi 5 (i.e. with 6.1 and 6.6 as well).

Current workaround with drm-hwcomposer (https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer) has been to set client (GPU) composition for DRM_FORMAT_YVU420 instead of using device (DRM) composition as it should (https://github.com/raspberry-vanilla/android_external_drm_hwcomposer/blob/android-16.0/backend/BackendRpi5.cpp). This way the colors are displayed correctly during video playback.

drm-hwcomposer maintainers have suggested that this is an issue with the kernel DRM driver (https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/merge_requests/328#note_2790523).

Any idea why this is happening? What is different on Pi 5 compared to Pi 4 in this regard?

drm-hwcomposer maintainer also suggested (https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/125) to run test pattern with modetest. I tested all the formats and YV12, YV16, and YV24 show R and B are swapped compared to the others.

console:/ # stop vendor.hwcomposer-3
console:/ # modetest -M vc4 -s 33:1920x1080-60@YV12
opened device `Broadcom VC4 graphics` on driver `vc4` (version 0.0.0 at 0)
setting mode 1920x1080-60.00Hz on connectors 33, crtc 92

Any other relevant information I can provide?

Thanks.

Steps to reproduce the behaviour

AOSP on Raspberry Pi 5.

Device (s)

Raspberry Pi 5

System

AOSP on Raspberry Pi 5.
Linux kernel 6.12, 6.6, and 6.1.

Logs

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions