Skip to content

drm: apple: blend XRGB2101010 as premultiplied like the other X formats - #411

Open
briantoll wants to merge 1 commit into
omacom:integration/aurorafrom
briantoll:dcp-xrgb2101010
Open

briantoll wants to merge 1 commit into
omacom:integration/aurorafrom
briantoll:dcp-xrgb2101010

Conversation

@briantoll

Copy link
Copy Markdown

drm: apple: blend XRGB2101010 as premultiplied like the other X formats

Target: omacom/linux-aurora, branch integration/aurora. One commit (branch dcp-xrgb2101010). Split out of #157 so it can go in on its own; it does not depend on the colour patches there.

Problem

plane.c advertises XRGB2101010 for the primary plane and scans it out as the DCP l10r format. l10r carries alpha, so the two padding bits of an XRGB2101010 framebuffer are read as alpha. The 8-bit X formats and XBGR2101010 already get the premultiplied-over-black workaround for exactly this; XRGB2101010 was left out.

On a Studio Display XDR with Hyprland bitdepth = 10 (XRGB2101010 scanout, confirmed in hyprctl monitors) the 10-bit picture was visibly wrong next to the same desktop at 8-bit.

Fix

Add DRM_FORMAT_XRGB2101010 to the list of formats blended as premultiplied alpha over a black background, and say in the comment why l10r needs it.

Tested

MacBook Pro 14" M1 Max (j314c), DCP firmware 13.5, Studio Display XDR at 5120x2880@60 over a Thunderbolt DP tunnel, Hyprland 0.56.2 for the side-by-side test, 0.57.1 in daily use since.

  • With the change, bitdepth = 10 on the XDR shows the same picture as 8-bit, both on plain cm = "srgb" and under a per-monitor ICC profile. In daily use since 2026-10-19 (local kernel releases 12 through 16).
  • Without it, 10-bit scanout on that display is visibly wrong, as described above.
  • Internal panel unchanged (it does not use this format).

drivers/gpu/drm/apple/ builds on integration/aurora 8eddf5a with the Omarchy config (W=1, clang); checkpatch --strict reports only the Co-Authored-By trailer spelling.

🤖 Generated with Claude Code

XRGB2101010 is advertised for the primary plane and scanned out as the
DCP "l10r" format, which carries alpha, so the two padding bits of an
XRGB2101010 framebuffer are read as alpha. The 8-bit X formats and
XBGR2101010 already get the premultiplied-over-black workaround; give
XRGB2101010 the same treatment. With Hyprland bitdepth = 10 on a Studio
Display XDR the 10-bit picture was visibly wrong next to 8-bit.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Brian Toll <[email protected]>
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 11, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 14, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 30, 2026
XRGB2101010 is handed to DCP as l10r, the format of ARGB2101010, but unlike the other X formats it was not
marked premultiplied: DCP then blends by the two undefined X bits, and a client whose buffer leaves them 0
shows black, one with noise there shows noise. Blend it premultiplied over black, as XRGB8888, XBGR8888 and
XBGR2101010 are.

Not seen on the panel here: Hyprland's own 10-bit buffers carry 3 there. Another fork has the same fix
(omacom#411).
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.

1 participant