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

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
aurora-silicon#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.

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.
@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.

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.

2 participants