Skip to content

drm/apple: select the pinned dual-stream policy by the processors' match data - #2417

Draft
RyanTheTide wants to merge 5 commits into
mainfrom
hack/drm-board-gates2-d
Draft

RyanTheTide wants to merge 5 commits into
mainfrom
hack/drm-board-gates2-d

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

dcp_typec_ordered_dual_stream() (drivers/gpu/drm/apple/dcp-fabric.c ~351) decides whether dual-stream Type-C routes go through the ordering pass that pairs streams with pipelines. It skipped that pass when the root compatible was apple,t6030 or apple,t6050. On those SoCs the external processors are interchangeable, so a route stays with the processor that owns it on any DP IN. This came from bb0ad1c ("drm/apple: support both T6030 Thunderbolt dock display streams") and b5b3e96 ("drm/apple: Enable T6050 USB4 DisplayPort tunnels and paired shutdown").

That is a property of the display fabric, and the processors' compatibles name it. This is stream ordering, not a sleep gate.

Change

  • New pinned_dual_stream flag in apple_dcp_hw_data, set for apple,t6030-dcp, apple,t6030-dcpext, apple,t6050-dcp and apple,t6050-dcpext.
  • A processor with the flag marks the fabric pinned in dcp_register_typec_routes() before any of its routes is counted as dual-stream. An smp_wmb() there pairs with an smp_rmb() in dcp_typec_ordered_dual_stream().
  • The policy therefore reads the same as before whenever a dual-stream route exists. With no dual-stream route it was "not ordered" either way.
  • dcp_fabric_ordered_dual_stream()'s argument is renamed from t6030 to pinned. The transaction selftest, which models an M1/M2 port, now models no pinned processor instead of mocking the machine check.

This is stacked on #2359 (hack/drm-board-gates-b): its two commits appear here too and go in with it; review only the last commit, which adds t6030_fabric to the same T6030 match data.

Why every SoC is safe: only the T6030 and T6050 machines carry these processors, and every external processor of those fabrics has the flag. Everything else keeps pinned = false, as the machine check gave it.

Testing

  • arm64 LLVM W=1 build of dcp.o, dcp-fabric.o, dcp-fabric-core.o and dcp-fabric-test.o: no new warnings.
  • The selftests in tools/testing/selftests/drivers/gpu/apple-dcp (transaction included) and the host tests tunnel-route and t6030-wiring pass.
  • The dcp-fabric KUnit case for dcp_fabric_ordered_dual_stream() is unchanged in meaning and was compiled, not run (arm64-only suite).

Still to run

No lab Mac is a T6030 or T6050. On an M3 Pro J514s/J516s with a Thunderbolt dock carrying two displays, both streams come up and each stays on its processor across a replug, the same as on the base kernel (2/2 displays on 5/5 replugs on both kernels). The J616s (T6040), M1 Pro and M2 are unaffected: pinned stays false.

Hardware rows (combined test kernel, 2026-11-20)

This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:

  • kernel errors, failed units and SELinux denials;
  • microphone capture byte counts;
  • camera frame counts;
  • USB speeds;
  • panel brightness steps;
  • every retry/refusal message these drafts touch;
  • 2 s2idle cycles on M1 Pro, M2 and J616s.

M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.

This PR: No lab Mac reaches these paths (T6030/T6050); boot-clean regression rows only.

… compatibles

The T6030 display paths were selected by the root compatible
(of_machine_is_compatible("apple,t6030")):

 - dcp-fabric.c: the tunnel pixel clock sources a route may use
   (dcp_route_tunnel_clock_blocked(), dcp_route_clock_rate(),
   dcp_tunnel_set_rate()) and the explicit crossbar link-up of a direct
   output (dcp_direct_crossbar_link());
 - atc.c: the T8122-generation tunnel clock (apple_atc_tunnel_t8122_clock())
   and the matching stop before a mode change (atcphy_configure()).

What these follow is hardware: the T6030 display crossbars, where a
selected output is only routed until its link is brought up and only
external sources 0 and 2 reach the ATC PHY's tunnel pixel clocks, and
the T6030 ATC PHY, which clocks both DP IN outputs from its own AUSPLL
tunnel clock. Every display processor behind those crossbars is an
apple,t6030-dcp or apple,t6030-dcpext, and every such PHY an
apple,t6030-atcphy.

Select them by those compatibles, through match data: a t6030_fabric
flag for the two T6030 processors, read by dcp_is_t6030_fabric(), and a
t8122_tunnel_clock flag for the PHY, set in a new apple,t6030-atcphy
entry (the T8122 PHY data plus the flag) and in the T8132 PHY data. The
PHY's mode change reads the same flag; a T8132 PHY never reaches that
path (atcphy_configure_t8132()), so it is the condition it had.

No functional change on any in-tree device tree: the T6030 machines
(J514s, J516s) carry exactly these compatibles, and no other SoC does
(T6031/T6034 use apple,t6031-*, T8122 apple,t8122-*). Whether the T8122
and T6031 PHYs, of the same generation, want the same tunnel clock
sequence is not known and is not changed here.

The host fixtures that replay these functions model the match data the
way they modelled the machine check, and the ATC USB3 host test now
resolves the new apple,t6030-atcphy entry.

Fixes: 6a6ee2a ("thunderbolt, phy, soc: apple: T6030 USB4/Thunderbolt, Type-C and DP tunnel support")
Fixes: 9e03c19 ("drm/apple: reserve the T6030 HDMI processor with source-aware tunnel clocks")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…s unused

The PHY host fixtures in phy.py define of_machine_is_compatible() for
the ATC functions they extract. Since the T6030 tunnel clock stop in
atcphy_configure() reads the PHY's match data instead of the machine,
no extracted function calls the mock any more, and the units fail to
build under -Werror=unused-function. Mark the two mocks unused, as the
fixtures do for other optional stubs.

Fixes: 6cb4c3e ("drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…tch data

dcp_typec_ordered_dual_stream() decides whether dual-stream Type-C
routes go through the ordering pass that pairs streams with pipelines.
It skipped that pass when the root compatible was apple,t6030 or
apple,t6050, whose external processors are interchangeable, so that a
route stays with the processor that owns it on any DP IN.

That is a property of the display fabric, which the processors'
compatibles name. Add a pinned_dual_stream flag to the match data of the
T6030 (apple,t6030-dcp, apple,t6030-dcpext) and T6050 (apple,t6050-dcp,
apple,t6050-dcpext) processors. A processor with the flag marks the
fabric pinned when it registers its Type-C routes, before any of them is
counted as a dual-stream route, so the policy reads the same as before
whenever a dual-stream route exists; with none it was "not ordered"
either way. The core helper's argument is renamed to match.

No functional change on any in-tree device tree: only the T6030 and
T6050 machines carry these processors.

The transaction selftest, which models an M1/M2 port, now models no
pinned processor instead of the machine check.

Fixes: bb0ad1c ("drm/apple: support both T6030 Thunderbolt dock display streams")
Fixes: b5b3e96 ("drm/apple: Enable T6050 USB4 DisplayPort tunnels and paired shutdown")
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. The branch no longer merges into integration/aurora: drivers/gpu/drm/apple/dcp-fabric.c and tools/asahi/dcpext26-crossbar-union-tests.py conflict. The conflict comes in with the two stacked drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles #2359 commits (merge base 0abc2f3; drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles #2359 is also CONFLICTING). Rebase onto drm/apple, phy: apple: atc: select the T6030 display fabric by its IP compatibles #2359 once that is rebased, and re-run host-tests on the new head.

What I checked in the last commit (75a623c), which is sound:

  • dcp.c:9663/9678/9717/9729: the flag is set in exactly the four match entries that the T6030 and T6050 DTs use (t6030-dcp.dtsi, t6050-peripherals.dtsi, t6050-dieX.dtsi). Every in-tree DT that carries them has root apple,t6030 or apple,t6050 (j514s/j516s and all eleven t6050-*.dts), and no other SoC reuses these compatibles. So the policy is the same as before on every in-tree DT.
  • dcp-fabric.c:4879-4883 against :4786 and :369-376: the flag is written and smp_wmb()'d before the route's atomic_inc. The reader does atomic_read, then smp_rmb, then READ_ONCE. A reader that sees wired == true therefore sees pinned. A reader that sees wired == false gets "not ordered" either way. A deferred or failed probe leaves the flag set, which is harmless because it is a fabric-wide constant.
  • The new flag selects by the block's own compatible and does not gate on the machine.

Nit (not blocking): dcp_typec_fixed_crtcs() (dcp-fabric.c:~413) and dcp_route_clock_rate() (:~483) still test of_machine_is_compatible("apple,t6050") for the same fabric property. A follow-up could move them onto per-processor match data in the same way.

HW row: on the rebased head, a T6050 (J714s) or T6030 (J514s/J516s) with a Thunderbolt dock driving two displays: 2/2 displays, each stream stays on its processor across 5/5 replugs, the same as the base kernel; plus 0 AVC, 0 failed units and no new kernel errors. Also boot-clean on M1 Pro, M2 and J616s, where pinned stays false.

Assisted-by: LLM (Claude:Opus 5.5)

Conflicts: dcp-fabric.c (dcp_direct_crossbar_link: keep dcp_is_t6030_fabric() plus integration's dcp_t6041_ext_v27()), dcpext26-crossbar-union-tests.py (extract both dcp_t6041_ext_v27 and dcp_is_t6030_fabric).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Conflicts: dcp.c (apple_dcp_hw_t6050_dcpext: keep both pinned_dual_stream and integration's dptx_endpoint = DPTX_ENDPOINT_V2); integration/aurora comes in through the updated hack/drm-board-gates-b (81af464).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged integration/aurora (f5f023b, through the updated #2359 head 81af464); conflict in drivers/gpu/drm/apple/dcp.c resolved (T6050 dcpext match data keeps pinned_dual_stream and dptx_endpoint), drivers/gpu/drm/apple/ (arm64 fleet config, LLVM) builds; apple-dcp selftests (92/92) pass.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The conflict is gone after the rebase through #2359's new head, so this now waits for #2359 to land first, then a quick re-review of the merge. Still needed: a J714s or J514s/J516s row with a Thunderbolt dock driving two displays (2/2 lit, each stream stays on its processor across 5 replugs) and clean boots on M1 Pro, M2 and J616s.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Status 12-05: parked. This branch carries #2359's commits, and #2359 was folded into #2457. A merge of main (f02bd68) conflicts in dcp-fabric.c, dcp.c, atc.c and three host tests, for the same reasons as #2457: main reworked dcp_direct_crossbar_link() (new on_link), the T6030 DCP match data and the tunnel clock path. Main's dcp_typec_ordered_dual_stream() still checks the root compatible. This should be redone on main after #2457 is rebased: a pinned_dual_stream flag in the four T6030/T6050 dcp/dcpext match entries, a few lines against main. After that: a J714s or J514s/J516s dock row with two displays.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Second-pass assessment 12-05 against main @ef8a1bf8. Stays PARKED; nothing pushed. This branch carries #2457's commits (6cb4c3e, 76da970) plus its own 75a623c. On main the policy lives in dcp_typec_ordered_dual_stream(void) (dcp-fabric.c ~382), which still decides by of_machine_is_compatible("apple,t6030") || of_machine_is_compatible("apple,t6050") and feeds dcp_fabric_ordered_dual_stream(wired, t6030) (dcp-fabric-core.c ~160, KUnit in dcp-fabric-test.c ~1922). Its only caller is apple_drv.c ~2274, which has no dcp in hand, so the "few lines" version is: a pinned_dual_stream bool in the T6030 and T6050 dcp/dcpext match entries, latched at DCP probe into the fabric state (or computed from the first bound DCP), and dcp_typec_ordered_dual_stream() reading that instead of the machine. Note main added T6050 to this gate since the PR was written, so the flag goes in four T6030 + T6050 entries, not only T6030. Do it after #2457's redo lands (same dcp-fabric.c sites). Row: J714s or J514s/J516s with a TB dock driving two displays (2/2 lit, each stream on its processor across 5 replugs) + clean boots on M1 Pro, M2 and J616s.

This branch has not been deployed

No deployments
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