Skip to content

drm/apple: v14.7: scan out 10-bit framebuffers on the internal panel - #485

Open
ilyasakin wants to merge 1 commit into
omacom:integration/aurorafrom
ilyasakin:v14-10bit
Open

ilyasakin wants to merge 1 commit into
omacom:integration/aurorafrom
ilyasakin:v14-10bit

Conversation

@ilyasakin

Copy link
Copy Markdown

What this changes and why

On the 14.7 firmware path (iomfb_v14_7.c), the primary plane offers only XRGB8888 and ARGB8888. A compositor asked for 10 bits per channel (Hyprland bitdepth = 10) falls back to 8 bits.

The firmware already has a 10-bit format: its pixel format table lists l10r (10-bit linear, laid out as ARGB2101010) in the same class as w30r, next to BGRA. This PR:

  • offers XRGB2101010 and ARGB2101010 on the 14.7 primary plane;
  • sends them to the firmware as l10r, through a small DRM → firmware format mapping that atomic_check and the present path share;
  • sends XRGB2101010 opaque, as XRGB8888 already is.

External displays keep 8 bits. atomic_check refuses the 10-bit formats there, because I could only test the internal panel.

What was tested

  • Mac model and chip: J514S, MacBook Pro 14" M3 Pro (T6030), 11-core.
  • Firmware: DCP firmware UUID DDF38191-… (macOS 14.7.5–14.7.8).
  • Was a kernel built from THIS commit booted? Yes. It was built with the omarchy-pkgs linux-aurora recipe, pointed at the commit with tools/aurora-ci/prepare-recipe.py, then installed and booted.
Before After
Hyprland bitdepth = 10, currentFormat XRGB8888 XRGB2101010
Scanout buffer (drmModeGetFB2) XR24 XR30
  • Colours: the colours on the panel look the same as at 8 bits. No shift or banding, checked by eye on the desktop.
  • Switching: I switched between bitdepth = 8 and 10 at runtime with hyprctl five times. Each switch reported the right format, and nothing was logged by the DCP or DRM.
  • Build: make W=1 of iomfb_v14_7.o and plane.o (clang) is clean, with CONFIG_DRM_APPLE_KUNIT_TEST on. checkpatch is clean apart from the trailers.

What was NOT tested

  • Other boards: J613, J615, J516S and J514C/J516C (the change applies to every 14.7 internal panel).
  • External displays: they keep 8 bits by design.
  • KUnit: the suites were compiled, not run.
  • Other compositors: GNOME and KDE.

Risk

  • Compositors that pick 10-bit when it is offered now scan out l10r on the internal panel. That is the only behaviour change.
  • External displays and the 8-bit formats: unchanged.

AI assistance

  • I used an AI tool or agent to write or draft part of this change: Claude (claude-opus-5-5), via Claude Code. It found the format in the firmware, wrote the patch and this text, with me running the machine and reviewing.
  • A human has read the whole diff and takes responsibility for it.

🤖 Generated with Claude Code

The 14.7 firmware takes 'l10r', a 10-bit linear format laid out as
ARGB2101010, and lists it beside 'BGRA' in its pixel format table. Offer
XRGB2101010 and ARGB2101010 on the primary plane and send them as l10r,
so compositors can drive the panel at 10 bits per channel (Hyprland
bitdepth 10, which otherwise falls back to 8 bits).

XRGB2101010 is sent opaque, as XRGB8888 already is. External displays
keep 8 bits: 10 bits were only tested on the internal panel.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ilyas Akin <[email protected]>
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