From 861ff5501c3969af794f4c0126b5f60bb8a4994e Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Thu, 3 Dec 2026 15:28:26 +0100 Subject: [PATCH] drm/apple: route a DP-alt port only once its display asserts HPD Outside compositor pairing order, a direct DP-alt port with no pipeline takes the lowest free one as soon as it enters DP mode, whether or not a display is behind it; only Desktop 26.x, T6041 and T8142 wait for HPD. A USB-C dock without a monitor that enters DP mode before the port of a USB-C display takes the pipeline that display needs, and the display then waits for as long as the dock stays plugged in. Which port enters DP mode first changes from boot to boot. At a wake the port controller applies each port's state again, and the dock's port then takes a pipeline an HDMI display left free. Leave a port that owns no pipeline and has no HPD unrouted on every machine, as those three already do. The port controller reports HPD as a new status when a display appears, and the port is routed then. A port that owns a pipeline behaves as before on an HPD drop, and the compositor-ordered path is unchanged. Signed-off-by: Andreas Fernandez --- drivers/gpu/drm/apple/dcp-fabric.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/apple/dcp-fabric.c b/drivers/gpu/drm/apple/dcp-fabric.c index 58105cc3ac6c9..a01466c8ddc88 100644 --- a/drivers/gpu/drm/apple/dcp-fabric.c +++ b/drivers/gpu/drm/apple/dcp-fabric.c @@ -2311,14 +2311,14 @@ static int dcp_typec_route_apply(struct typec_mux_dev *mux, } /* - * Desktop 26.x has one Type-C pipeline: only a port with a sink (HPD) - * takes it. A dock or cable in DP alt mode without a display behind it - * would otherwise hold it against the port that has one. + * Only a port with a sink (HPD) takes a pipeline. A dock or cable in DP + * alt mode without a display behind it would otherwise hold one against + * a port that has a display, for as long as it stays plugged in. The + * port controller reports HPD as a new status when a display appears, + * and the port is routed then. What a port that owns a pipeline does on + * an HPD drop is unchanged. */ - if (!port->owner && !hpd && - (route->dcp->fw_compat == DCP_FIRMWARE_V_26_6_DESKTOP || - dcp_t6041_ext_v27(route->dcp) || - dcp_t8142_ext(route->dcp))) { + if (!port->owner && !hpd) { port->applied_valid = true; return 0; } @@ -2333,7 +2333,7 @@ static int dcp_typec_route_apply(struct typec_mux_dev *mux, best = dcp_typec_free_route(port); /* Every pipeline is driving another port's display. */ if (!best) - return hpd ? dcp_typec_port_busy(port, route->dcp) : -ENOSPC; + return dcp_typec_port_busy(port, route->dcp); ret = dcp_typec_route_activate(best, best->xbar); if (ret)