Skip to content

drm/apple: dcp: keep DP-alt ports without a display off the Type-C pipelines - #2835

Draft
Ante042 wants to merge 1 commit into
aurora-silicon:mainfrom
Ante042:j314s-typec-dp-alt-hpd
Draft

Ante042 wants to merge 1 commit into
aurora-silicon:mainfrom
Ante042:j314s-typec-dp-alt-hpd

Conversation

@Ante042

@Ante042 Ante042 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What: On T600x a port in DP alt mode takes a display pipeline as soon as it enters DP mode, even with nothing asserting HPD behind it, so a USB-C dock without a display takes a pipeline and one of two USB-C displays stays dark. This keeps a port that owns no pipeline unrouted until its sink asserts HPD; a port that already owns one keeps it across an HPD drop, so a display in standby keeps its pipeline.
Tested: J314s M1 Pro at edb4a5d (candidate 2596602bfaf6 on main 972a566, plus a test-only commit for the HDMI rows): boots, the same failed units as plain main, USB-C display back after each of three port disconnects with 0 Type-C errors and 0 kernel warnings.
Risk: two-way door · T600x Macs (M1 Pro, Max, Ultra); other SoCs already behave this way and are not touched.
Not yet: the USB-C display after s2idle. On the candidate the display on this port stays dark after the wake (failed to validate DPTX target 0:1: -110, five tries), and replugging the port does not bring it back. I saw the same on this port after s2idle in October on older 7.2 kernels, and keeping all four ATC PHY power domains on through the sleep did not change it, so I don't think this commit causes it; plain main has not been through the same sequence with #3639's fix yet. After a deep sleep it came back (one run). A dock and two USB-C displays on this base.

Details

The same thing happens at boot, when the PD controllers report a DP state for ports with nothing behind them, which is how the LUKS prompt ends up on the internal panel of a closed laptop (omarchy-pkgs#1037). As far as I can read the tree, a port without HPD is already kept unrouted on the desktop 26.x, T6041 and T8142 processors, and in compositor pairing order on T6030 and T6050, but not on T600x.

An earlier version also let a port with HPD take over the pipeline of a port without it. As the review pointed out, that would also take the pipeline of a display in standby, so it is gone. The tipd -ENOSPC patch from the old pull request is already fixed here by 219a271 and 27285e5.

Moved from omacom/linux-aurora#186.

Evidence
  • Port disconnects: the port's PD controller told to drop the connection for 4 s (verify/pd-disc.sh 0x3f 4), three times, 16 s apart. Each time DP-2 came back at 2560x1440@200 10 bit, tps6598x/typec error lines 0, kernel WARNING splats 0.
  • Earlier rows on older bases (7.2.10, 7.2.11, a 22/11 integration tip): two displays and a dock on three ports, both displays up at boot and after replugs, the dock never got a pipeline and its USB worked; a display in standby kept its pipeline.
  • After the sleeps: dcp_dptx_connect: failed to validate DPTX target 0:1: -110 x6, Type-C DPTX reconnect failed after 6 retries, and on the next disconnect tps6598x 0-003f: cable revalidation failed after 3 attempts. The HDMI display came back.

Happy to run anything else on the J314s.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Review at b01c5de (non-author, draft). One question on the takeover; otherwise no blocker beyond the booted row.

  • Routing only once the sink asserts HPD (second patch) is the right default and matches what the other processors already do; a port that already owns a pipeline keeps it across an HPD drop, as before. applied_valid = true with no route makes the next HPD status a fresh update, so the port is routed then.
  • IS_ERR() from the takeover is propagated, and the "every pipeline busy" path now always goes to dcp_typec_port_busy(), which is only reached with HPD set.
  • Both commits merge cleanly on the current integration/aurora tip; the transaction selftest stub keeps it building.

Question (takeover, first patch): the comment says it takes a pipeline "from a direct DP-alt port whose sink never did" assert HPD, but the check is the port's current state (held->port->hpd || held->port->dp_hpd, both set from the latest status in dcp_typec_route_apply()). Many monitors drop HPD in standby, and the second patch deliberately lets such a port keep its pipeline. With every pipeline in use and one monitor asleep, plugging another display takes the sleeping monitor's pipeline, and that monitor finds none when it wakes. If the intent is "never asserted since it connected", a latched per-connection flag (cleared on disconnect/SAFE) would match the comment and leave sleeping monitors alone. A replug row with one monitor in standby would show which behaviour you get.

Small points, not blocking:

  • The -110 DPTX state you saw once after a hand-over is a reason to keep the takeover as narrow as possible; with the second patch in place, is the first one still needed for anything but ports routed before this change (boot-time state from the PD controllers)? If not, it could be limited to that case.
  • Both commits carry Assisted-by: LLM and no Signed-off-by: yet; they need the sign-off before landing.

Assisted-by: LLM (Claude:Opus 5.5)

@ericjuta

Copy link
Copy Markdown
Contributor

To address @RyanTheTide's review point about a sleeping monitor losing its pipeline on a second plug: I ported the idle-port reclaim patch onto 7.3 main with a latched per-plug dp_hpd_seen flag (set when HPD is asserted, cleared on Type-C disconnect) so dcp_typec_reclaim_idle() only reclaims a pipeline from a port whose sink never asserted HPD during the current plug.

If useful, feel free to cherry-pick or fold in commit 1a7c5aaff from ericjuta@1a7c5aaff (branch t8122/idle-port-pipeline-7.3, includes Signed-off-by, quiesce.py struct update, checkpatch clean, apple-dcp-* KUnit 163/163 pass).

@Ante042

Ante042 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

The check is the port's current state, so with every pipeline in use a monitor in standby would lose its pipeline to a newly plugged display. That is not what the comment says and not what I meant.

With the second patch a port only gets a pipeline once its sink has asserted HPD, so as far as I can read it the only ports left for the takeover on this machine are the ones that had HPD and dropped it, which is exactly the case it should leave alone. That makes the choice either to drop the first patch or to keep it with a latched flag, the way @ericjuta did in 1a7c5aa (thanks for porting that with the latch!). Before I update the branch I'll check on the J314s whether anything is still routed without HPD at boot with the second patch alone, and run a replug row with one monitor in standby. That needs the laptop back at the desk with both monitors.

The sign-off will be on the commits before this leaves draft.

@Ante042
Ante042 force-pushed the j314s-typec-dp-alt-hpd branch from b01c5de to 9da4ccf Compare November 26, 2026 14:33
@ericjuta

Copy link
Copy Markdown
Contributor

Thanks. Either outcome works for me: if the second patch alone leaves nothing routed without HPD at boot on the J314s, dropping the first one is the simpler result, and 1a7c5aaff is there if you keep the takeover.

One limit on my side: 1a7c5aaff is build- and KUnit-tested only (apple-dcp-* 163/163). I have not booted it, and I have one external monitor on a J615, so I can't produce the standby row with every pipeline in use. I can run a single-monitor replug and lid row on a J615 at your updated head if that is useful.

@Ante042
Ante042 force-pushed the j314s-typec-dp-alt-hpd branch from 9da4ccf to fa8034a Compare November 26, 2026 19:54
@Ante042

Ante042 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

I dropped the first patch, so the branch is now the second one alone, with the sentence about the hand-over taken out of its message.

Tested on the J314s with a test kernel built from the integration tip of the 22nd with this patch and without the takeover, two monitors over USB-C, one of them behind a USB-C KVM dock:

  • A monitor put in standby for 60 s drops HPD. Its port kept its pipeline, and the picture came back on the same DCP when it woke.
  • With the monitor's DP cable pulled from the dock, the dock stays in DP mode with nothing behind it and gets no pipeline. Plugging the monitor back in routed it to the free pipeline right away.
  • At boot with both monitors on, both are routed as before.

A port with HPD that finds every pipeline driving another display now waits, as it did before this PR. I could not set up that case here, it needs three displays.

@ericjuta, thanks for the latched version. With the takeover gone it isn't needed for this PR, but it would be the way to do it if the takeover comes back.

The sign-off will be back on the new commit shortly.

@Ante042
Ante042 force-pushed the j314s-typec-dp-alt-hpd branch 2 times, most recently from 1a37019 to 2912162 Compare November 29, 2026 00:38
Outside compositor pairing order, a direct DP-alt port takes the lowest
free pipeline as soon as it enters DP mode, whether or not a display is
behind it.  A USB-C dock without a display does exactly that, and on an
M1 Pro with two pipelines it leaves one display dark when it is plugged
in before them.

Leave a port that owns no pipeline and has no HPD unrouted, and route it
when the port controller reports HPD as a new status.  A port that
already owns a pipeline keeps it across an HPD drop, as before, so a
display in standby keeps its pipeline.  The compositor-ordered path is
unchanged.

Link: omacom/omarchy-pkgs#1037
Signed-off-by: Andreas Fernandez <[email protected]>
@sschuez

sschuez commented Nov 30, 2026

Copy link
Copy Markdown

Baseline from a J415 (MacBook Air 15" M2, T8112) for the case this PR targets. This is without the PR: packaged linux-aurora 7.3.0.aurora1-1 with aura 1.0.0b17 from the Omarchy rc channel.

Setup: an Anker USB-C hub with DP alt mode and no display attached, plugged in first. An Apple Studio Display (Thunderbolt) plugged into the other port 16 s later.

Result: the hub works (USB 2 and USB 3 trees, Ethernet, HID). The idle hub takes the external pipeline, and the Studio Display stays dark.

[ 1120.034238] apple-display-crossbar 50304c000.mux: Switched dpphy to dispext1,0
[ 1120.034433] apple-dcp 271c00000.dcp: allocated Type-C DPTX PHY 1
[ 1120.036190] xhci-hcd xhci-hcd.8.auto: new USB bus registered, assigned bus number 1
[ 1135.811253] thunderbolt 0-1: Apple Inc. Studio Display
[ 1136.152016] thunderbolt-apple-acio 381ac0000.cio: dpin0: no display pipeline free; waiting for one

The other order works on the same boot: display first, then the hub, gives a 5120x2880@60 picture and working hub USB, with no -28 or revalidation lines.

Not tested: whether the display lights up when the hub is unplugged afterwards, and this PR's head. I can re-test on this Mac when a build with it reaches the Omarchy rc channel.

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.

4 participants