Skip to content

drm/apple: 14.7 primary plane: offer only ARGB8888 - #1970

Open
knalekar wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
knalekar:drm-apple-14-7-argb8888
Open

knalekar wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
knalekar:drm-apple-14-7-argb8888

Conversation

@knalekar

@knalekar knalekar commented Nov 15, 2026 •

Copy link
Copy Markdown

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, and saturated colours get dimmed by their own red byte (omacom/linux-aurora #308).

Dropping XRGB8888 from dcp_primary_formats_14_7 leaves ARGB8888 as the only 8-bit format on the 14.x panel primary plane. Compositors write a real alpha of 255, which the blend leaves untouched — mutter walks its default GBM format list and lands on ARGB8888 with no userspace changes.

Tested on the built-in panels of a j516s and a j514s: pure green and blue correct, no red-weighted dimming, whites and greys unchanged, dcpext output and 120 Hz presentation unaffected.

Companion PR for the 120 Hz pacing fix (omacom/linux-aurora #31): #1969

Assisted-by: GLM 5.3 Flash

@joshuaswarren

Copy link
Copy Markdown
Contributor

[Joshua's agent] Friendly heads-up from a related fault we just measured: on the M5 internal panel, a primary plane without XRGB8888 makes Hyprland 0.57 show frames two updates late. Hyprland asks for XR24; when the plane does not offer it, the compositor allocates AR24 while its monitor format stays XR24, and ensureBufferPresent then swaps in the next swapchain buffer on every commit. Our proof by buffer read: the plane held the frame from two back 34 of 34 times; after offering XRGB with X opaque, current 2987 of 2987. Details: #1816 (comment). If the 14.7 firmware blends X as alpha (per omacom/linux-aurora #308), the safer fix may be an opaque-X property rather than dropping the format, so compositors that request XR24 keep working. Happy to test either shape on our machines if it helps.

@joshuaswarren

Copy link
Copy Markdown
Contributor

[Joshua's agent] Withdrawing my advice above. On reflection it was wrong for this hardware: if the 14.7 firmware blends X as alpha (per omacom/linux-aurora#308 in your description), keeping XRGB8888 on the plane keeps the broken format, not the working one. Dropping it, as this PR does, matches what the firmware actually scans out. For information only: on a stock Hyprland 0.57 stack, a plane without XR24 fails to start on that output ("GBM: Failed to allocate a GBM buffer: format XR24 isn't supported by primary backend", per hyprwm/aquamarine#496) rather than showing stale frames; the "two frames late" symptom I cited came from our own downstream AR24-fallback patch layered on a different driver gap. The design choice here is yours; sorry for the misdirected advice.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. The commit has no Signed-off-by. Add your own Signed-off-by:.
  2. drivers/gpu/drm/apple/apple_drv.c:1784 sets up the fbdev client with XRGB8888, and apple_drm_fbdev_probe() (apple_drv.c:194-203) only switches the console to a 32-bit-depth (alpha) surface for H17P and firmware 27. After this change the 14.x primary plane (plane.c:864) offers no XRGB8888 at all, so the fbdev console on a 14.x DCP asks for a format no plane offers. Either it fails to find a format, or it gets an XRGB console that has the same black-X problem this PR fixes. Do not add a third firmware case there: make the fbdev probe pick the alpha surface whenever the primary plane's format list has no XRGB8888, which also covers the existing two cases. Then show the console on a 14.x panel at boot (no desktop).

HW row: j514s or j516s on this branch, default cmdline: the boot console is visible and the colours are right before the desktop starts; mutter as in the body; one wlroots-based compositor (sway) that asks for XR24 starts or falls back cleanly; 0 AVC / 0 failed units / 0 new kernel errors. Give the kernel build in the row.

Nit: Assisted-by: GLM 5.3 Flash should be in the form Assisted-by: LLM (<Vendor>:GLM 5.3 Flash).

Assisted-by: LLM (Claude:Opus 5.5)

@knalekar
knalekar force-pushed the drm-apple-14-7-argb8888 branch from dc59ed9 to e18873d Compare November 21, 2026 20:17
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, and
saturated colours get dimmed by their own red byte (see
omacom/linux-aurora issue 308). Mechanically: the 14.x swap encodes the
surface as 'BGRA' with s[DCP_V14_SURF_OPAQUE] = (format == XRGB8888),
and this firmware blends straight alpha regardless of the opaque flag.

Drop XRGB8888 from dcp_primary_formats_14_7 so the only 8-bit format
offered on the 14.x panel primary plane is ARGB8888. Compositors write
a real alpha of 255, which the blend then leaves untouched. Mutter
walks its default GBM format list and lands on ARGB8888 with no
userspace changes.

The fbdev client still asks for XRGB8888, which no 14.x primary plane
offers any more, so its setup fails with -EINVAL. Select the 32-bit
alpha surface whenever the primary plane's format list has no
XRGB8888, instead of matching firmware versions. H17P keeps an
explicit case: its planes still advertise XRGB8888 for the opaque-X
property, which fbcon does not set.

Tested on the built-in panels of a j516s and a j514s: pure green and
blue correct, no red-weighted dimming, whites and greys unchanged,
dcpext output and 120 Hz presentation unaffected.

Signed-off-by: Krish Nalekar <53238848+knalekar@users.noreply.github.com>
Assisted-by: LLM (Zhipu:GLM 5.3 Flash)
Assisted-by: LLM (DeepSeek:DeepSeek V4.1 Flash)
@knalekar
knalekar force-pushed the drm-apple-14-7-argb8888 branch from e18873d to 945943b Compare November 21, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants