aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-10-18 17:15:01 +0200
committerAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-10-19 00:23:18 +0000
commitc6d8a11d2c438d514473b1cbe20e5550e7227472 (patch)
treeed6a2bab5c76edbcfdc58b808bdb1c6da97918ed
parent4f920a206cc8eaf2d47c0892dd976637b5ca8b7f (diff)
backend/drm: fetch current CRTC once on startup
Once we are DRM master, the CRTC cannot be changed behind our back except during a VT switch. After a VT switch, we try to restore whatever KMS state we had last programmed. Reloading the current CRTC from KMS breaks this and can result in a modeset without a FB. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
-rw-r--r--backend/drm/drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index aa34f1a4..32bb50c1 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1363,14 +1363,14 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
snprintf(wlr_conn->name, sizeof(wlr_conn->name),
"%s-%"PRIu32, conn_name, drm_conn->connector_type_id);
+ wlr_conn->crtc = connector_get_current_crtc(wlr_conn, drm_conn);
+
wl_list_insert(drm->outputs.prev, &wlr_conn->link);
wlr_log(WLR_INFO, "Found connector '%s'", wlr_conn->name);
} else {
seen[index] = true;
}
- wlr_conn->crtc = connector_get_current_crtc(wlr_conn, drm_conn);
-
// This can only happen *after* hotplug, since we haven't read the
// connector properties yet
if (wlr_conn->props.link_status != 0) {