Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

Advanced users • [CM5 + vc4-kms-v3d] Color rendering & format mismatch issues with Weston/COG on Buildroot

$
0
0
Hello,

I'm having issues running a Compute Module 5 (CM5) with a Weston + Cog (WPEWebKit) graphics setup on a custom Buildroot-based firmware. On Raspbian OS, everything works great — the browser renders web pages (even YouTube), HDMI audio works, and there's no sign of any rendering issues.

However, when I boot into my custom Buildroot firmware, things fall apart — even though there are no obvious DRM errors or driver loading problems.

What works:

- DRM stack initializes correctly — /dev/dri/card0 is created, HDMI outputs detected.
- COG partially works: it renders the page background, but only a flat color is visible on screen.
- Weston works only with software rendering (--use-pixman) — otherwise, it’s a black screen.
-kmscube runs, but it's missing red color output entirely (no red/yellow tones).

What I’ve tried:

- Tested multiple kernel versions: 6.12, 6.14, and 6.6.51 (same as Raspbian).
- Tried both dtoverlay=vc4-kms-v3d and dtoverlay=vc4-fkms-v3d.
- Forced resolution and depth via config.txt and cmdline.txt: video=HDMI-A-1:1280x800@60D cma=320M framebuffer_width=1280 framebuffer_height=800 framebuffer_depth=32
- Used Raspbian’s kernel8.img, DTB, and kernel modules
- Updated bootloader to latest version — no change.
- Weston + Pixman does render correctly, so userspace apps are fine under software.
- Tried Cog with LIBGL_ALWAYS_SOFTWARE=1, WPE_BACKEND_FORCE_DISABLE_DMABUF_RENDERING=1, and WEBKIT_USE_SINGLE_WEB_PROCESS=1 — same rendering issue.

Dumped and compared modetest output between Raspbian and Buildroot.
Observed Differences (modetest): Raspbian modetest output:
File size: ~79KB
Includes many more pixel formats
Examples: formats: XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 ...

Buildroot modetest output:
File size: ~13KB
Much fewer formats
Examples: formats: XR24 AR24 XB24 AB24 RX24 BX24 RG16 RG24 BG24 YU16 ...

Format Quirk in Tiling/Modifiers:

Raspbian (working):
XR24: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
AR24: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
AB24: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
XB24: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
RG16: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
BG16: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
AR15: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)
XR15: BROADCOM_VC4_T_TILED(0x700000000000001) LINEAR(0x0)

Buildroot (broken):
XR24: LINEAR(0x0) BROADCOM_VC4_T_TILED(0x700000000000001)
AR24: LINEAR(0x0) BROADCOM_VC4_T_TILED(0x700000000000001)
XB24: LINEAR(0x0)
AB24: LINEAR(0x0)
RX24: LINEAR(0x0)
BX24: LINEAR(0x0)
RG16: LINEAR(0x0) BROADCOM_VC4_T_TILED(0x700000000000001)

It seems like only LINEAR formats are being exposed or accepted in Buildroot — which may explain the broken rendering and missing color channels (especially red). My suspicion is that the vc4 driver is falling back to a limited or unsupported pixel format, or DRM buffers are being allocated with the wrong modifier.

Possibly Related:

simple-framebuffer is always reported as r5g6b5 1280x720, despite forcing 1280x800 @ 32bpp in config.txt.
Cog renders background only, then crashes when loading complex pages — possibly due to DMA buffer or color conversion issues.
vc4_hvs_update_dlist() crashes in kernel when rendering via DRM in some cases, suggesting a buffer mismatch or bad tiling.

Looking for Help:

- Has anyone encountered a similar format mismatch or color loss issue with VC4 on CM5 or Pi 5?
- Are there known kernel config options, mesa patches, or dtb quirks needed for CM5 + vc4-kms-v3d to properly expose tiling formats?
- How can I ensure that DRM modifiers (like tiled XR24) are properly negotiated on Buildroot?
- Could this be a Mesa/libdrm compile issue, or is something deeper in the vc4 DRM pipeline broken for newer hardware?

Any tips, insights, or references would be super appreciated.
Thanks in advance!

Buildroot dmsg: https://pastebin.com/LDF7aWx7
RaspbianOS dksg: https://pastebin.com/86VZnKEd
Buildroot modetest: https://pastebin.com/MGdru1Kv
RaspbianOS modetest: https://pastebin.com/LaTW81ng

Statistics: Posted by raspburried — Tue Apr 15, 2025 12:44 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles