aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/backend.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2024-02-14 18:54:01 +0100
committerSimon Ser <contact@emersion.fr>2024-02-14 19:13:23 +0100
commit505175e56f42700649158bfd4ad622860ceaa80b (patch)
treee05675bd0404a8e72d04deb5d4b8d363f74fd334 /backend/drm/backend.c
parent836cb820d0b25135cc861782df2781bf2d177795 (diff)
backend/drm: atomically reset state after VT switch
Allows the KMS driver to parallelize the modesets, so should be faster than going through each CRTC one by one.
Diffstat (limited to 'backend/drm/backend.c')
-rw-r--r--backend/drm/backend.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 84ae3738..43bfd9da 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -131,14 +131,9 @@ static void handle_session_active(struct wl_listener *listener, void *data) {
// configurations. The connector/CRTC mapping may have changed, so
// first disable all CRTCs, then light up the ones we were using
// before the VT switch.
- // TODO: use the atomic API to improve restoration after a VT switch
- for (size_t i = 0; i < drm->num_crtcs; i++) {
- struct wlr_drm_crtc *crtc = &drm->crtcs[i];
-
- if (drmModeSetCrtc(drm->fd, crtc->id, 0, 0, 0, NULL, 0, NULL) != 0) {
- wlr_log_errno(WLR_ERROR, "Failed to disable CRTC %"PRIu32" after VT switch",
- crtc->id);
- }
+ // TODO: better use the atomic API to improve restoration after a VT switch
+ if (!drm->iface->reset(drm)) {
+ wlr_log(WLR_ERROR, "Failed to reset state after VT switch");
}
struct wlr_drm_connector *conn;