Skip to content

drm/apple: t8132: Mac mini HDMI from dispext0 (as macOS), firmware clocks, realtime bandwidth - #2497

Open
DjDeveloperr wants to merge 7 commits into
djdev/base-1192-db7d34d1from
djdev/j773g-hdmi-dcpext0
Open

DjDeveloperr wants to merge 7 commits into
djdev/base-1192-db7d34d1from
djdev/j773g-hdmi-dcpext0

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1192 (techmore's J773g HDMI). The base branch djdev/base-1192-db7d34d1 is #1192's head db7d34d, unchanged, so this diff is only the 5 commits below. Retarget to integration/aurora once #1192 lands.

Why

On the Mac mini (J773g, M4) Linux drives HDMI from the main DCP. macOS 27.2 drives it from dispext0: 4K60, and 4K120 with DSC, on that pipe alone, with the main DCP booted and idle (native 27.2 logs). Measured on the main DCP, today's default:

  • Every KWin frame is copied by the CPU. The main DCP's SID0 host-window arena is taken by the boot handoff's preserved slices: cursor not shown: no window for its framebuffer (-28), and iomfb_m4_ext_present_direct() returns -ENOSPC. The copy costs about 25 ms per 1080p frame. At 4K30 the desktop ran at 18 fps, median 37.6 ms, p95 95.9 ms between frames.
  • The firmware's clock query gets the wrong answer. The firmware asks for its clock with D408 the firmware clock-frequency request and gets a hardcoded 48 MHz, then logs "EDT ERROR: the firmware clock-frequency request(0) (48000000) < videoClock …! Giving up on frequencies" on every modeset. macOS answers the ADT rate of the display's clock-id.
  • No realtime bandwidth. The pipe never requests it: "Realtime Bandwidth setup failed", "IOMFB Int RTBandwidth: DISABLED". macOS logs Int RTBandwidth: 0x382820000.

Commits

  1. drm/apple: m4: answer the firmware clock-frequency request with the DCP's clock from the DT. Each M4 DCP answers D408 with its own DT clock: index 0 is the rate, index 1 is 0. Without one, a DCP keeps J713's 48/24 MHz.

  2. arm64: dts: apple: t8132-j773g: give the HDMI DCP its realtime bandwidth slot (0x382820000 in disp-4, next to the dcpext slots from 437d89d).

  3. arm64: dts: apple: t8132-j773g: the display pipes' firmware clocks. Fixed clocks for disp0 (clock-id 364: 300 MHz) and dispext0 (369: 533,333,328 Hz, the rate macOS 27.2's dcpext0 logs). The values are the same in the 26.6.2 and 27.2 ADTs.

  4. drm/apple: t8132: drive the fixed HDMI port from a handed-over dcpext. A dcpext whose node says HDMI-A gets what the main DCP gets today:

    • it prepares the PHY and the PS190 rails;
    • it connects its DPTX port, whose ACTIVATE sets the PHY's source select to its dcp-index (1);
    • it registers no Type-C routes;
    • it gets an HDMI-A connector;
    • the DRM device has no component DCP.
  5. iommu: apple-dart: the main display DARTs serve the display device when HDMI is on dispext0. Without this, display-subsystem has no IOMMU, waits about 15 s, and PRIME imports fail.

  6. drm/apple: t8132: the HDMI port goes to dispext0 when it was handed over, else to the main DCP. The decision is made from the device tree the boot loader wrote:

    • A dcpext with HDMI-A and the firmware-ready marker drives the port. The main DCP's probe then returns -ENODEV before touching anything ("main DCP left booted and idle", as macOS leaves it), and it is not a DRM component.
    • Without the handoff, the main DCP drives the port as today.
  7. arm64: dts: apple: t8132-j773g: describe the HDMI port on dispext0 as well. dcpext0 gets the HDMI properties next to the main DCP's, which stay. Its mailbox and DARTs are enabled without power domains: iBoot leaves DISPEXT0 running, as for the main DCP.

With 6 and 7, the J773g uses dispext0 exactly when the boot loader hands it over. aura's J773g tree already does that with the boot.bin config line chosen.asahi,j713-dcpext=1. An old boot.bin without the line keeps today's main-DCP path with the same kernel and DT, display and GPU included.

Commit 5 is not needed for this DT: the main DCP's node stays available, so apple-dart already probes its display DARTs in main-external mode. It covers a DT that disables dcp. That is the setup measured below, where it was needed.

Measured on the Mac mini

Setup: J773g, 26.6.2 firmware, kernel m4drv8 + these commits, trial boot.bin (aura-try), 8 boots on 11-19, KWin 6.8 (plasma-login greeter).

Main DCP (today) dispext0 (commit 4 + 5, test DT)
D408 300 MHz, no "Giving up" (commits 1+3) 533,333,328, as macOS
RT bandwidth Int RTBandwidth: … Using Dashboard 382820000 (commit 2) Ext RTBandwidth: … Using Dashboard 38282c000
Frame path copied, ~25 ms/frame at 1080p direct scanout: cache clean 0.16–0.44 ms, present call ~6–7 ms
4K30 frame intervals, pointer moving median 37.6 ms, p95 95.9 ms median 37.3 ms, p95 40.0 ms
GPU (G16) READY READY at 3.1 s

Notes on the dispext0 column:

  • The test DT is t8132-j773g.dts with dcp disabled (it keeps its HDMI-A type, which aura's J773g handoff reads) and dispext0 given the HDMI properties. Its mailbox and DARTs carry no power-domains, as the main DCP's on this board.
  • aura (techmore's J773g tree) handed dcpext0 over: firmware-ready 1.
  • The handoff itself: external DCP adopted on 286e00000, 4 × HBR3 to the PS190.

Not fixed here: modes above 297 MHz.

  • The firmware's own TimingElements list 4K60, 1440p120 and 1080p240, on the main DCP and on dispext0 alike, but mark every 8-bpc RGB colour of them unsafe. 4K120 gets no 8-bit RGB colour at all.
  • macOS trains HDMI FRL at 48 Gbit/s right after the EDID; Linux's firmware stays on TMDS-class rates. That points at the PS190's FRL/DSC enumeration, to be traced on macOS 27.2.
  • Linux's own link filter drops nothing (4 × 8100 Mbit/s).

Not tested yet:

  • The J713: commit 1 leaves DCPs without a DT clock on the old answers, and commits 4 and 6 only change DCPs whose connector type is HDMI-A.
  • Commits 6 and 7 on the mini: a candidate image (DCPEXT0 default, plus the fallback with an old boot.bin) is built, and its verification boot is being scheduled.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 3.

I checked the HDMI handoff decision (dcp.c, apple_drv.c, apple-dart.c), the D408 clock path (dcp-m4-callback.h, iomfb_m4.c) and the J773g DT. The clock lookup falls back cleanly when a DCP has no clocks (J713 unchanged). The dcpext mailbox and DARTs, which are now enabled without power domains, are still refused by the existing handed-over checks in apple-dart.c when the boot loader keeps dispext0.

  1. Every commit carries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. Commits should have the human Signed-off-by only. Drop the trailer and put the disclosure as the PR body's last line, Assisted-by: LLM (Claude:Opus 5.5). The body ends with a "Generated with Claude Code" line at the moment.
  2. Commits 6 and 7 make dispext0 the default HDMI path on the J773g, but the PR says they have not been booted. The measured dispext0 column used a different test DT, with dcp disabled. Please add the verification boot of this exact DT in both cases: the boot loader handing dispext0 over (main DCP probe returns -ENODEV at drivers/gpu/drm/apple/dcp.c:7740, display and GPU up, direct scanout), and an old boot.bin without the handoff (main DCP drives HDMI as before, dcpext0 refused, no DART probe on the dcpext DARTs).
  3. drivers/iommu/apple-dart.c:919-924 counts a dcpext as driving the HDMI port as soon as it is available with apple,connector-type = "HDMI-A". drivers/gpu/drm/apple/dcp.c:5977-5984 also requires apple,t8132-dcpext-firmware-ready == 1. With dcp disabled and no handoff, the main display DARTs would then probe in main-external mode while nothing drives the port. Use the same predicate in both places (check the firmware-ready marker here too).
  4. arch/arm64/boot/dts/apple/t8132-j773g.dts:80-83, and several commit messages, quote firmware log lines word for word. Describe the behaviour in your own words instead, e.g. "without it the firmware runs with realtime bandwidth disabled".

HW row: J773g on the default command line with this DT and kernel, once with the dispext0 handoff and once with an old boot.bin: HDMI 4K30/4K60 modeset, direct scanout, GPU ready, 0 DART faults, 0 SELinux denials, 0 failed units, 0 new kernel errors. Also one J713 boot showing the internal panel unchanged.

Assisted-by: LLM (Claude:Opus 5.5)

The 26.6.2 firmware asks the AP for its display clock frequencies via
D408 (index 0 and index 1). The M4 backend currently answers 48 and
24 MHz—the values the J713 panel handoff was qualified with—for every
DCP. On the Mac mini, macOS answers from the display's ADT clock-ids
looked up in /arm-io clock-frequencies (id - 0x100): 533333328 Hz for
dcpext0/dcpext1 (clock-ids 369 and 372), matching how aura's J616c 27.2
handoff and the J813 device tree publish theirs. Answering 48 MHz on the
J773g causes the firmware to reject the pixel clock on every modeset.

Take the index-0 rate from the DCP node's own clock in the device tree
(a fixed clock at its first clock-id's rate) and answer 0 for index 1,
whose ADT rate is 0 on the M4. A DCP without a clock keeps 48 and
24 MHz.

Signed-off-by: Diljit Singh <hey@djdev.me>
…dth slot

Without apple,bw-scratch the J773g's main DCP firmware runs with
realtime bandwidth disabled on every modeset, so the pipe never asks
the bandwidth controller for memory bandwidth. macOS gives the same DCP
its bandwidth request slot at 0x382820000 (0x20000 into disp-4).

Describe the scratch register node and wire apple,bw-scratch on &dcp.

Signed-off-by: Diljit Singh <hey@djdev.me>
The firmware asks for its display clock rate via the D408
clock-frequency request (index 0); describe the fixed-clock nodes from
the ADT's /arm-io clock-frequencies for disp0 (clock-id 364, 300 MHz)
and dispext0 (clock-id 369, 533333328 Hz), and wire disp0's clock on
&dcp.

Signed-off-by: Diljit Singh <hey@djdev.me>
The Mac mini's HDMI port is reached through a T8122-style DPTX PHY and a
DP-to-HDMI converter, from whichever DCP the PHY's source select names.
Linux drives it from the main DCP. macOS 27.2 drives it from dcpext0:
4K60 and 4K120 (with DSC) on that pipe alone, the main DCP booted and
idle. The main DCP's pipe tops out where dcpext0's does not (300 vs
533.33 MHz firmware clock).

Let a T8132 dcpext the boot loader handed over serve the fixed HDMI port
when its node says so (apple,connector-type = "HDMI-A"), as the main DCP
does: the PHY and converter rails are prepared, the DPTX port connects
after the adoption, and no Type-C routes are registered. The PHY's
source select is the DCP's index (apple,dcp-index = <1> on dcpext0),
which the DPTX activation already passes. The DRM device then has no
component DCP, as with the main DCP's HDMI port, and the connector is
HDMI-A.

Signed-off-by: Diljit Singh <hey@djdev.me>
…en HDMI is on dispext0

On the Mac mini the main DCP's display DARTs (disp0 at 0x30a300000 and its
firmware DART at 0x30a340000) are probed in the "main external" mode only
while the main DCP itself drives the fixed HDMI port: their tables are the
ones the boot loader handed over for that port, and the display device
imports framebuffers through disp0's SID0. Otherwise they need an explicit
guarded probe, which nothing performs on this Mac.

When the port is driven from dispext0 instead (as macOS 27.2 does; see
"drm/apple: t8132: drive the fixed HDMI port from a handed-over dcpext"),
the main DCP stays booted and idle, its tables are those of the same
handoff, and the display device still needs disp0's DART for its imports.
Without it, the display device waits for the deferred probe timeout (~15 s,
and the GPU, which waits for the display, with it), then has no IOMMU, and
KWin's buffers cannot be imported ("drmPrimeFDToHandle failed: Invalid
argument"). Probe them in the same mode when an available T8132 dcpext
says it drives the HDMI port.

Measured on the Mac mini (J773g, 26.6.2 firmware): the DARTs probe
("Inherited SID0/SID16 frontend admitted"), the display device registers
at 0.70 s, the GPU is ready at 3.1 s and KWin drives the HDMI port from
dispext0. The J713 apple_dart.j713_display/j713_dcp parameters do not do
it: they take the internal-panel ADT instance, which refuses this handoff
("cannot validate existing ADT table handoff").

Require apple,t8132-dcpext-firmware-ready == 1 as well, matching
dcp_t8132_hdmi_dcpext_ready() in drivers/gpu/drm/apple/dcp.c.

Signed-off-by: Diljit Singh <hey@djdev.me>
…ver, else to the main DCP

A board can describe its fixed HDMI port on both the main DCP and a dcpext
(the Mac mini: macOS drives it from dispext0; Linux has driven it from the
main DCP). Decide from what the boot loader handed over, which the device
tree already says when the drivers probe:

- a dcpext with apple,connector-type = "HDMI-A" and the firmware-ready
  marker drives the port (dcp_t8132_fixed_hdmi()), and the main DCP is
  left as the boot loader left it, booted and idle, as macOS leaves it:
  its probe returns -ENODEV before it touches anything, and it is no
  component of the DRM device;
- otherwise the main DCP drives the port as before, and the dcpext, not
  handed over, is refused by the existing gate.

So a boot loader that does not hand dispext0 over (no
chosen.asahi,j713-dcpext=1) keeps today's behaviour with the same device
tree. The main DCP's display DARTs are probed as they are today (the DART
driver keys on the main DCP's node, which keeps its HDMI connector type),
so the display device keeps its IOMMU for imports either way.

Signed-off-by: Diljit Singh <hey@djdev.me>
… well

macOS drives the Mac mini's HDMI port from dispext0: 4K60, and 4K120 with
DSC, on that pipe alone, with the main DCP booted and idle. Describe the
port on dcpext0 too (connector type, the DPTX PHY, whose source select is
the pipe's dcp-index 1, the converter rails and its firmware clock), with
its mailbox and DARTs enabled. iBoot leaves DISPEXT0 running, so its power
domains are not given to Linux, as for the main DCP.

Linux drives the port from dcpext0 only when the boot loader hands it over
(aura: chosen.asahi,j713-dcpext=1), and from the main DCP otherwise, so the
main DCP's description stays.

Measured on the Mac mini with dispext0 handed over: direct scanout instead
of a copied frame (4K30 frame intervals p95 40 ms instead of 96 ms), the
firmware clock and realtime bandwidth as macOS has them, the GPU up.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/j773g-hdmi-dcpext0 branch from 36a1160 to cf635d9 Compare November 21, 2026 22:23
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed all host-side blockers across all 7 commits (head cf635d93e):

  1. Dropped Co-Authored-By trailers from all 7 commits (single Signed-off-by: Diljit Singh <hey@djdev.me>) and replaced the PR body footer with Assisted-by: LLM (Gemini:4 Neon).
  2. Updated drivers/iommu/apple-dart.c (apple_dart_t8132_main_external()) to require apple,t8132-dcpext-firmware-ready == 1 in addition to of_device_is_available(dcp) and apple,connector-type = "HDMI-A", matching dcp_t8132_hdmi_dcpext_ready() in drivers/gpu/drm/apple/dcp.c.
  3. Removed verbatim firmware log strings and method names from arch/arm64/boot/dts/apple/t8132-j773g.dts, drivers/gpu/drm/apple/dcp-m4-callback.h, drivers/gpu/drm/apple/iomfb_m4.c, and commit messages, describing the behaviour in plain prose instead.

Verified on host: checkpatch.pl --strict across all 7 commits (0 errors, 0 warnings) and compiled drivers/iommu/apple-dart.o, drivers/gpu/drm/apple/dcp.o, drivers/gpu/drm/apple/iomfb_m4.o, and arch/arm64/boot/dts/apple/t8132-j773g.dtb.

Pending HW verification before merge (blocker #2): boot this exact DT and kernel on J773g both with the dispext0 handoff (main DCP returns -ENODEV, HDMI 4K30/4K60 direct scanout, GPU up) and with an old boot.bin without the handoff (main DCP drives HDMI, dcpext0 refused, no DART probe on dcpext DARTs), plus a J713 boot showing the internal panel unchanged.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review at cf635d9.

Fixed:

  • The commits carry only the Signed-off-by.
  • apple_dart_t8132_main_external() now also requires apple,t8132-dcpext-firmware-ready == 1 (drivers/iommu/apple-dart.c:919-928), the same predicate as dcp_t8132_hdmi_dcpext_ready() (drivers/gpu/drm/apple/dcp.c:5977-5985).
  • The firmware log quotes are gone from the DT and the commit messages.

Still open: the verification boots of this exact DT and kernel, as the PR body also says.

One thing to include in the old-boot.bin row: the main DCP now has clocks = <&dcp_fw_clk364> (arch/arm64/boot/dts/apple/t8132-j773g.dts:87). Without the dispext0 handoff, the main DCP therefore answers the clock-frequency request with 300 MHz instead of the 48 MHz the current HDMI path was measured with. Please show a 4K30/4K60 modeset on that path too, not only the dcpext0 one.

HW rows:

  • J773g on the default command line with this DT and kernel, once with the dispext0 handoff and once with an old boot.bin: HDMI 4K30/4K60 modeset, direct scanout, GPU ready, 0 DART faults, 0 new kernel errors.
  • One J713 boot showing the internal panel unchanged.

Assisted-by: LLM (Claude:Opus 5.5)

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