Skip to content

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

Draft
Ante042 wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
Ante042:j314s-typec-dp-alt-hpd
Draft

Ante042 wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
Ante042:j314s-typec-dp-alt-hpd

Conversation

@Ante042

@Ante042 Ante042 commented Nov 22, 2026

Copy link
Copy Markdown

Hi! This moves omacom/linux-aurora#186 over here now that kernel work has moved to this repository, rebased onto the current integration/aurora (3710668).

These two come from running two USB-C displays and a USB-C dock on an M1 Pro (J314s). On the T600x laptops 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). As far as I can read the current 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, so the two patches still change something there.

The first patch lets a port with HPD take over a pipeline held by a direct DP-alt port that never asserted it. The second keeps a port that owns no pipeline 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, which is why I'd rather not rely on the takeover alone.

The old pull request had a third patch, for tipd taking -ENOSPC as a taken display on every SoC. That is already fixed here by 219a271 and 27285e5, so I dropped it.

About testing, so nobody reads more into this than there is. I ran these two patches on 7.2.10 and 7.2.11 from the 20th of October with 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. joshuaswarren also tested the old head on the lab laptops in the old thread. On this base I have only built them: the kernel and modules build on 3710668 with the 7.3.0 edge config, W=1 on drivers/gpu/drm/apple gives no new warnings, and tools/asahi/run-host-tests.py gives the same result as on the base. The transaction selftest builds dcp_typec_route_apply() against its own stubs, so the first patch adds a stub for the new helper there. I have not booted a kernel from this branch yet, since my J314s runs a local suspend-to-RAM tree, so I'm opening it as a draft until I have.

Happy to test anything else on the J314s, and thanks for all the work on the fabric code!

…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
Assisted-by: LLM
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.

Assisted-by: LLM
@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)

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