Repository navigation
iommu: apple-dart: adopt the M4 (T8132) external display DARTs - #952
Merged
RyanTheTide merged 3 commits intoNov 5, 2026
Merged
Conversation
The J713's two external display coprocessors (DCPs) run the same firmware as the internal one. The boot loader starts them and leaves them quiesced, with their firmware DARTs (SID23) set up the same way. Admit those DARTs as the internal one is: read the ADT nodes of the matching coprocessor and its four-segment firmware layout instead of the internal DCP's seven, and validate the owner against apple,t8132-dcpext. Touch one only once the boot loader has marked its DCP handed over (apple,t8132-dcpext-firmware-ready), which it does only with the block powered. Its fault interrupt is shared with the external display DART, so request none. Signed-off-by: Erik Bourget <[email protected]>
An external DCP drives its display through a display DART of its own: SID0 for scanout, SID16 for the buffers its firmware maps for PIODMA. The boot loader leaves both streams set up and locked, as on the internal display. Adopt them by the internal frontend's rules: the boot loader's roots and tables are imported and kept, nothing is written at admission, and later only free root slots are claimed. The DCP side gets: - apple_dart_dcp_shared_alloc_link(): a firmware buffer on the DCP's own DART (SID23) alone, never mapped in SID16 afterwards; - apple_dart_dcp_dispext_map(): an existing backing in SID0 or SID16 at a DVA of its own, filling a claimed slice before claiming the next; - apple_dart_dcp_dispext_scanout_alloc(): a host-written SID0 surface; - apple_dart_dcp_dispext_stream_ok() and apple_dart_dcp_dispext_qualify(): whether a stream may be used, and, for a caller that knows the DART is powered, a check of both streams' registers and of pending faults; - apple_dart_dcp_dispext_state(): after the firmware powered the DART up again, whether it kept its state (the TTBR/TCR lock, and the streams' TCR and TTBR). A lost state is not rebuilt. The display DART's power belongs to its firmware, which switches it off with the display. Its registers are only touched inside a use of a per-DART PM gate: system sleep marks the DART unconfirmed and waits for every use in flight, and from then on every operation returns -EAGAIN, retiring nothing, until the firmware has powered the DART up again and the state check has passed. The TLB commands also wait for a second busy flag (0x604 bit 0) on these DARTs, and the SID16 flush checks for a pending fault first, since no fault interrupt is attached. A hardware failure (a fault pending, registers not as adopted, a failed mapping or flush) retires the whole DART, both streams, and every mapping and publication on it refuses once either stream is retired. Every place that retires a borrowed DCP stream, on the internal display too, now says why, once per stream. Signed-off-by: Erik Bourget <[email protected]>
…ay DARTs Direct scanout of client framebuffers needs SID0 mappings the host can take down again. A window is one whole free 32 MiB slice of the SID0 arena, claimed by the host until reboot; nothing else maps into it. - apple_dart_dcp_dispext_window_claim() claims one, or returns -ENOSPC; - apple_dart_dcp_dispext_window_map() maps caller-owned 16 KiB pages at the start of an empty window, flushes SID0 and reads every PTE back; - apple_dart_dcp_dispext_window_unmap() checks every PTE against what was written, clears them all, flushes, and reads them back as invalid. An external display DART's arena now takes up to ten free slices at admission; it still needs only the four its retained surfaces use. Any failure retires the whole DART, and the caller then keeps the pages until reboot. Signed-off-by: Erik Bourget <[email protected]>
RyanTheTide
approved these changes
Nov 5, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
Reviewed and tested here with the whole series on top of integration/aurora, thanks Erik.
- Fedora-base universal config build is clean, W=1 adds no warnings, dtbs_check adds none and only the t8132 DTBs change
- KUnit passes (atc 49/49, apple-dpin 94 + 1 skip, drm/apple 112 + 1 skip, the arm64 gate set 74 + 1 skip)
- one-shot boots on the M4 Pro (J616s, dock and external display attached) and the M2, both with zero err lines, no new warnings, 0 AVCs with SELinux enforcing, a freezer pm_test pass and the external display still up on the J616s
- the host selftests needed fixture updates for the renamed and new helpers, those come in with the #957 merge, all groups pass with them
Merging.
erikwb
pushed a commit
to erikwb/linux
that referenced
this pull request
Nov 5, 2026
The J713 external display series (aurora-silicon#952, aurora-silicon#953 and aurora-silicon#957) renamed or added production helpers that the host fixtures extract or call, so host test groups stopped compiling: - apple-dart-fw: the borrowed-DART unmap path calls apple_dart_dcp_invalidate_tlb_gated() now; stub that name. - t6030-clock: apple_atc_tunnel_is_t6030() became apple_atc_tunnel_t8122_clock(), and the PCLK gates moved to apple_dp_tunnel_pclks() in dp-tunnel.h. Extract them, the T8132 rate check and dcp_fabric_clock_refused(), and stub the T8132 dcpext leaves as never taken on T6030. - tiled-split: extract dcp_typec_route_no_dp_alt() and add two T8132 dcpext cases (DP IN 1 alone, and with a tile hint) plus a mutation that makes a dcpext tileable. - tunnel-route: extract dcp_route_tunnel_clock_blocked() and check that a dcpext is a tunnel clock source only as crossbar source 2 or 4. - apple-dcp quiesce (six groups): the modelled DCP gains tb_clock_refused, and dcp_typec_route_no_dp_alt() is false, since no route there is a T8132 dcpext. - apple-dcp publication-hpd, fast-replug-bounce, readiness and the service-rebind control: stub dcp_is_t8132_ext() as false, the T8132-only leaves (t8132_ext_drm_hotplug(), afk_compact_orphans_pending(), dcp_t8132_wait_teardown_answers()) as never reached, t8132_ext_drm_init() as 0 (what it returns on anything but J713), and give the modelled DCP the dptxep, t8132_release_late and afk_alloc members the series reads. Fixtures only: no production code changes, and no existing case is weakened. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM (cherry picked from commit 4f0a21107e9a71eacd4faf36f1ff0ae9a2071aae)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the M4 MacBook Air the two external display coprocessors (dcpext0/1) were never touched by Linux: their DARTs were left alone, so nothing could drive an external display through them.
The boot loader can now hand both external DCPs over, already running, with their DARTs set up and locked as the internal display's. This adopts those DARTs the way the internal display's are adopted: the boot loader's tables are imported and kept, nothing is written at admission, and later only free root slots are claimed.
apple,t8132-dcpext-firmware-ready). Without the handover nothing changes.-EAGAINand nothing is retired, until the firmware has powered it up again and the state check passed.This is the first of six PRs for external displays on the J713; see #957 for the whole picture. It doesn't depend on the other five. At runtime it needs the boot-loader handover (aurora-silicon/aura#74 and aurora-silicon/u-boot#31); without it the external DARTs stay untouched as before.
Tested on a J713 (M4 MacBook Air) with a CalDigit TS5 dock and two 4K monitors, with the six PRs together:
Known gaps (follow-ups):
apple_dart_resume()'s handling of the other borrowed DARTs is unchanged by this PR.This was developed and tested by Claude (Anthropic), working with me on the J713.