Skip to content

drm/apple, tipd: keep DP-alt ports without a display off the Type-C pipelines - #186

Open
Ante042 wants to merge 3 commits into
omacom:integration/aurorafrom
Ante042:typec-dp-alt-hpd
Open

Ante042 wants to merge 3 commits into
omacom:integration/aurorafrom
Ante042:typec-dp-alt-hpd

Conversation

@Ante042

@Ante042 Ante042 commented Oct 23, 2026

Copy link
Copy Markdown

Hi! These three come from running two USB-C displays and a USB-C dock on an M1 Pro (J314s) with the Omarchy kernel. Outside compositor pairing order, a port in DP alt mode takes a pipeline as soon as it enters DP mode, even when nothing behind it asserts HPD. A dock without a display does exactly that, and with two pipelines one of the displays stays dark. It also 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).

The first patch lets a port with HPD take over a pipeline held by a port that never asserted it. The second keeps such a port unrouted until its sink asserts HPD, so the takeover is only left for corner cases. Once, a hand-over right after the dock had been routed left the DPTX service on that DCP answering -110 until reboot. The third is in tipd: the fabric now reports a port without a pipeline as -ENOSPC on every SoC, but cd321x_display_taken() only accepts that on H17. On t600x the dock's DP setup failed with -28 three times, the cable revalidation failed and nothing behind the dock came up.

I've been running the takeover and the tipd change on 7.2.10 since the 20th and the second patch since the 22nd. The setup is a ROG and a VG278 on two ports and the dock on the third. Both displays come up at boot and after replugs, the dock never gets a pipeline, and its USB works. The patches are rebased onto 42672ed and build against 7.2.11. Happy to test anything else on the J314s. This replaces aurora-silicon/linux#302.

…without it

The PD controllers on the M1 Pro/Max laptops report a DP alt mode state
at probe for ports that have no display behind them, for example an
empty port or a dock without a display.  Whichever port is routed first
gets a Type-C pipeline.  If that is the wrong one, the port with the
display finds every pipeline taken (-ENOSPC) and stays dark until the
other port is unplugged, which can also put the LUKS prompt on the
internal panel of a closed laptop.

When a port whose sink asserts HPD finds no free pipeline, release one
held by a direct DP-alt port whose sink never asserted HPD and take it.
Tunnels, ports with a pending safe state and pipelines whose fixed
output is in use are left alone.  The released port drops its applied
state so its next update is routed again once a pipeline is free.

Link: omacom/omarchy-pkgs#1037
Signed-off-by: Andreas Fernandez <[email protected]>
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.  The previous patch can take the pipeline back, but a
hand-over 6 ms after the dock's route was set left the firmware's DPTX
service on that DCP answering -110 until reboot.

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, and the
compositor-ordered path is unchanged.

Signed-off-by: Andreas Fernandez <[email protected]>
The DCP fabric now reports a port without a pipeline as -ENOSPC on every
SoC, but cd321x_display_taken() only accepts it on H17 and expects -EBUSY
elsewhere.  On an M1 Pro, a dock in DP alt mode with both pipelines
driving other displays gets "failed to configure Type-C connection: -28"
three times, the cable revalidation fails and the USB role is never set,
so everything behind the dock is gone.

Accept -ENOSPC as a taken display everywhere and keep -EBUSY as one
outside H17 for older fabrics.

Signed-off-by: Andreas Fernandez <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Keeps direct DP-alt ports without HPD from taking a display pipeline.

  • Ports without HPD leave display pipelines free for connected displays.
  • The Type-C controller treats -ENOSPC as a taken display on every SoC.

No actionable issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Direct DP-alt update] --> B{Port owns a pipeline?}
  B -->|No| C{HPD high?}
  C -->|No| D[Remember state without routing]
  C -->|Yes| E{Free pipeline?}
  E -->|Yes| F[Activate route]
  E -->|No| G{Eligible HPD-low owner?}
  G -->|Yes| H[Release old route]
  H --> F
  G -->|No| I[Return ENOSPC; USB setup continues]
  B -->|Yes| J[Update existing route]
Loading

Reviews (1) · Last reviewed commit: "usb: typec: tipd: treat -ENOSPC as a tak..." · Reviewed by Greptile

@invaliddayta

Copy link
Copy Markdown

The third commit here (2a37f6f206, tipd) fixes the same bug as #163, which I opened on 10-20 for a MacBook Air M2 (J413, T8112). There, a USB-C monitor in one port leaves a DP Alt Mode dock in the other without USB (failed to configure Type-C connection: -28, then cable revalidation failed after 3 attempts).

The two differ in one point:

From the code, both fix the T8112 case, because the fabric reports -ENOSPC there. I have only tested the #163 version: on 7.2.10, 10 of 10 -28 events got the dock's USB back within 3 s, against 0 of 3 plugs without the patch.

Only one of the two should be merged. If this one goes in, #163 can be closed.

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