Skip to content

J514S (M3 Pro 14"): built-in panel treats the X byte of XRGB8888 scanout as alpha, pure green/blue render black #308

Open

Description

@jdlinventures

J514S (MacBook Pro 14" M3 Pro): built-in panel treats the X byte of XRGB8888 scanout as alpha, so pure green/blue render black

Machine: MacBook Pro 14" M3 Pro (apple,j514s / t6030), Omarchy edge, DCP firmware 14.7.0 (asahi,os-fw-version 14.7, system-fw 26.6.2)
Packages when observed: linux-aurora 7.2.11.aurora9-1, aurora10-2 and aurora11-1 (all affected); m1n1-aurora 1.6.1.aurora22-1; mesa-aurora 26.3.0_devel.20261028 and 20261029 (both affected); hyprland 0.56.2-7 and 0.57.0-2 (both affected); aquamarine 0.15.1-1.3

Symptom

On the built-in panel only: pure green (0,255,0) and pure blue (0,0,255) display as black, saturated colours look dull/grey, white, red and greys look correct. Per pixel, the rule is "green and blue vanish wherever red is zero" (a solid green screen with thin white grid lines shows a white grid on black; a white square on green shows no green halo at all). The m1n1/iBoot boot logo and an external display via dcpext are correct.

What was ruled out

  • Compositor output: a wlr-screencopy capture of a full-screen RGB test image measures exactly (255,0,0), (0,255,0), (0,0,255), (255,255,255), (128,128,128).
  • DRM CTM: the CRTC holds an identity CTM blob; debugfs dcp-t6030 reports ctm valid 0 disabled 0 calls 0, and a 4000 K CTM from hyprsunset (read back as G 0.81 / B 0.65 in the blob) produces no visible change.
  • Package versions: downgrading mesa, hyprland (0.56.2) and the kernel (aurora9) one at a time changed nothing; a full power-off changed nothing.
  • Hardware: boot logo and external display correct; white is white (all subpixels work).

Root cause (measured)

  1. The Asahi Mesa driver writes the red value into the X byte of XRGB8888 render targets (GBM XRGB8888, LINEAR). Probe: allocate a 64x64 XRGB8888 GBM bo, import as EGLImage, render via GL ES, gbm_bo_map and read raw bytes:

    drawn colour B G R X
    green a=1.0 0 255 0 0
    blue a=1.0 255 0 0 0
    red a=1.0 0 0 255 255
    white a=1.0 255 255 255 255
    grey 0.5 128 128 128 128
    (36,129,204) 204 129 36 36

    Same result for glClear, shader draws (with and without blending), texture-view FBOs and glBlitFramebuffer, on both Mesa builds. An ARGB8888 bo gets a correct A=255. (X is undefined by contract, so this is not a Mesa bug on its own, but it is the input the panel sees.)

  2. iomfb_v14_7_swap.h encodes the surface as 'BGRA' with s[DCP_V14_SURF_OPAQUE] = (format == XRGB8888), relying on "an opaque surface blends as premultiplied alpha over black". On this panel/firmware the processor evidently blends the surface as straight alpha, i.e. out = colour × X/255: pure green and blue (X=0) go black, white/red (X=255) are unchanged, everything else is dimmed by its own red value. That reproduces every observation exactly. The dcpext path does not do this (external display correct), matching the comment in iomfb.c that DCPEXT rejects the panel-only alpha workaround.

Confirmation and working workaround

Rebuilding Hyprland 0.57.0 with its 8-bit output format list changed from {XRGB8888, XBGR8888} to {ARGB8888, XRGB8888, XBGR8888} (three lines in src/output/Monitor.cpp) makes the compositor scan out AR24; the GPU then writes a real alpha of 255 and the panel shows correct colours, with the native driver, GPU, 120 Hz, backlight and dcpext all intact. That confirms the mechanism: the panel's processor multiplies by the fourth byte of an XRGB8888 surface despite the driver's opaque flag.

(chosen.asahi,t6030-dcp=0 also restores colours, but leaves the GPU unprobed and dcpext disabled, so it is not usable day to day.)

What I run today (the workaround, step by step)

  1. Hyprland 0.57.0 rebuilt from the Arch recipe with this patch to src/output/Monitor.cpp (prefer ARGB8888 for 8-bit outputs, keep the X formats as fallbacks for planes that lack it):
@@ -802,7 +802,7 @@
-    const auto initialFormat = m_drmFormat != DRM_FORMAT_INVALID ? m_drmFormat : DRM_FORMAT_XRGB8888;
+    const auto initialFormat = m_drmFormat != DRM_FORMAT_INVALID ? m_drmFormat : DRM_FORMAT_ARGB8888;
@@ -922,7 +922,7 @@
-    static constexpr auto formats8bit  = std::to_array<uint32_t>({DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888});
+    static constexpr auto formats8bit  = std::to_array<uint32_t>({DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888});
@@ -2431,7 +2431,7 @@
-            monFmt = DRM_FORMAT_XRGB8888;
+            monFmt = DRM_FORMAT_ARGB8888;
  1. Installed as hyprland 0.57.0-2.1 and pinned with IgnorePkg = hyprland in /etc/pacman.conf so the repo build does not replace it.
  2. Result on the J514S: Swapchain: Reconfigured ... AR24, correct colours on the built-in panel, native DCP driver, G15 GPU, 120 Hz, backlight and external output all working. Stock Hyprland (XR24) reproduces the fault immediately on re-login.

A kernel-side fix would let the pin come off. An alternative userspace mitigation would be for the DRM driver to stop advertising XRGB8888 on the panel plane, but Hyprland/aquamarine reject outputs whose preferred format is missing rather than falling back, so the compositor change above is the smaller lever.

Suggested fix direction

Make the 14.7 panel path hand the firmware a surface it treats as opaque or premultiplied (the H17P/26.6 path already carries an enableGPAlphaDiv property workaround for the same class of problem), or scan out ARGB8888 with a guaranteed alpha. Happy to test a build on this J514S.

Evidence files available

display-diag-*.txt (debugfs atomic state, framebuffer list, dcp-t6030 counters, modetest), the GPU X-byte probe source (xbyte.c), kernel logs for the affected boots.

Activity

  1. knalekar commented on Nov 13, 2026

    @knalekar

    Kernel-side fix confirmed on a second unit (J516S, Fedora Aurora / GNOME-mutter)

    Machine: MacBook Pro 16" M3 Pro (apple,j516s / t6030), same DCP firmware generation (14.7)
    Stack: Fedora Aurora Remix, kernel 7.3.0-36.fc44.aurora.aarch64 (the distro kernel built from this tree @ 9219565939723cd5bc381941bc3978d52610d753), GNOME 50.6 / mutter on Wayland, mesa-asahi

    @jdlinventures — your analysis reproduces here in full: on the built-in panel only, pure green and blue render black, saturated colours are dimmed by their own red byte, the boot logo and dcpext output are correct, and compositor captures measure the right pixels. I went the kernel route you suggested ("stop advertising XRGB8888 on the panel plane") and can confirm it fixes the panel with no userspace changes on mutter.

    The fix

    dcp_primary_formats_14_7 in drivers/gpu/drm/apple/plane.c — drop XRGB8888 so the only 8-bit format offered on the 14.x panel primary plane is ARGB8888. The table is unchanged at current integration/aurora HEAD; the patch below applies cleanly with git apply:

    --- a/drivers/gpu/drm/apple/plane.c
    +++ b/drivers/gpu/drm/apple/plane.c
    @@ -798,9 +798,16 @@
     }
    
    -/* The formats the T6030 (14.x firmware) scanout was qualified with. */
    +/*
    + * The formats the T6030 (14.x firmware) scanout was qualified with.
    + *
    + * The 14.x firmware blends the X byte of XRGB8888 as straight alpha and
    + * ignores the opaque/premultiplied surface flag, so pure green and blue
    + * render black whenever a compositor leaves a zero in the X byte (see
    + * omacom/linux-aurora #308). Offer only the alpha format: compositors
    + * write a real alpha of 255, which the blend then leaves untouched.
    + */
     static const u32 dcp_primary_formats_14_7[] = {
    -	DRM_FORMAT_XRGB8888,
     	DRM_FORMAT_ARGB8888,
     };
    
     struct drm_plane *apple_plane_init_v14_7(struct drm_device *dev,

    I rebuilt only the module against the distro-pinned source with the distro's exact toolchain flags (LLVM=1, matching vermagic), installed it under /lib/modules/<kver>/updates/, ran depmod + dracut (the driver loads from initramfs here) and rebooted. The compiled table is 4 bytes = one entry (ARGB8888 only).

    Result on the J516S

    • All colours correct on the built-in panel: pure green/blue correct, no red-weighted dimming, whites and greys unchanged — the same cure as your AR24 Hyprland test, with the native driver, GPU, 120 Hz, backlight and dcpext all intact.
    • No userspace changes needed: mutter walks its default GBM format list (choose_gbm_format() in meta-onscreen-native.c) in order and skips formats the plane doesn't support, so with XRGB8888 off the list it lands on ARGB8888. (Mutter falls back; aquamarine rejects — see below.)

    Two notes

    1. Hyprland/aquamarine: since aquamarine rejects outputs instead of falling back, a patched kernel alone may or may not satisfy it — but with XRGB8888 gone, the plane only offers ARGB8888, which is exactly the format your patched Hyprland was forced to scan out, so it should be acceptable. Worth a test on your J514S; happy to share my module build steps.
    2. Upstream: apple_plane_init_v14_7 and the 14.x table exist only in this tree so far; upstream AsahiLinux/linux (asahi branch) has no 14.x format table yet. When 14.x support lands there, its dcp_primary_formats list — which includes XRGB8888 and whose comment claims X-vs-A "doesn't matter for the primary plane" — will hit exactly this firmware behaviour on 14.x panels, so the same "no XRGB8888 on 14.x" consideration applies.

    Mechanically this matches the swap descriptor: 14.x encodes the surface as 'BGRA' with s[DCP_V14_SURF_OPAQUE] = (format == XRGB8888), and this firmware blends straight alpha regardless of the opaque flag — so the opaque encoding is unusable on 14.x and ARGB-with-real-alpha is the only safe option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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