Repository navigation
drm/apple: t8132: Mac mini HDMI from dispext0 (as macOS), firmware clocks, realtime bandwidth - #2497
DjDeveloperr wants to merge 7 commits into
Conversation
|
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
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>
36a1160 to
cf635d9
Compare
|
Addressed all host-side blockers across all 7 commits (head
Verified on host: Pending HW verification before merge (blocker #2): boot this exact DT and kernel on J773g both with the Assisted-by: LLM (Gemini:4 Neon) |
|
Re-review at cf635d9. Fixed:
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 HW rows:
Assisted-by: LLM (Claude:Opus 5.5) |
Stacked on #1192 (techmore's J773g HDMI). The base branch
djdev/base-1192-db7d34d1is #1192's head db7d34d, unchanged, so this diff is only the 5 commits below. Retarget tointegration/auroraonce #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:
cursor not shown: no window for its framebuffer (-28), andiomfb_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 clock-frequency requestand 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.Int RTBandwidth: 0x382820000.Commits
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.
arm64: dts: apple: t8132-j773g: give the HDMI DCP its realtime bandwidth slot (0x382820000 in disp-4, next to the dcpext slots from 437d89d).
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.
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:
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.
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:
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).
Int RTBandwidth: … Using Dashboard 382820000(commit 2)Ext RTBandwidth: … Using Dashboard 38282c000Notes on the dispext0 column:
dcpdisabled (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.external DCP adoptedon 286e00000, 4 × HBR3 to the PS190.Not fixed here: modes above 297 MHz.
Not tested yet:
Assisted-by: LLM (Gemini:4 Neon)