From 375e80ec3826b54618fdd5f2db708c0f2bb936ae Mon Sep 17 00:00:00 2001 From: Marcelo Alcantara Date: Wed, 16 Sep 2026 00:39:04 +1000 Subject: [PATCH] drm: re-read possible CRTCs when rescanning connectors A driver can change a connector's possible CRTCs at runtime. Apple's DCP driver narrows a Type-C port's encoder to the display pipeline the fabric routed it to and relies on the following hotplug for userspace to re-read it. possibleCrtcs was only read when the connector was first created, so a rerouted port kept a stale mask and was never assigned its now-free CRTC until the compositor restarted. --- src/backend/drm/DRM.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index 6618a26..b492dac 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -1287,6 +1287,13 @@ void Aquamarine::CDRMBackend::scanConnectors() { } else { backend->log(AQ_LOG_DEBUG, std::format("drm: Connector id {} already initialized", connectorID)); conn = *it; + + // drivers may narrow or widen these on hotplug, e.g. when a Type-C port is rerouted to another pipeline + const auto possibleCrtcs = drmModeConnectorGetPossibleCrtcs(gpu->fd, drmConn); + if (possibleCrtcs && possibleCrtcs != conn->possibleCrtcs) { + backend->log(AQ_LOG_DEBUG, std::format("drm: Connector {} possible CRTCs changed {:#x} -> {:#x}", conn->szName, conn->possibleCrtcs, possibleCrtcs)); + conn->possibleCrtcs = possibleCrtcs; + } } conn->status = drmConn->connection; -- 2.50.1 (Apple Git-155)