diff options
author | Simon Ser <contact@emersion.fr> | 2024-02-14 18:54:01 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-02-14 19:13:23 +0100 |
commit | 505175e56f42700649158bfd4ad622860ceaa80b (patch) | |
tree | e05675bd0404a8e72d04deb5d4b8d363f74fd334 /backend/drm/legacy.c | |
parent | 836cb820d0b25135cc861782df2781bf2d177795 (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/legacy.c')
-rw-r--r-- | backend/drm/legacy.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c index 1c9ff46d..1e62f61f 100644 --- a/backend/drm/legacy.c +++ b/backend/drm/legacy.c @@ -227,6 +227,20 @@ bool drm_legacy_crtc_set_gamma(struct wlr_drm_backend *drm, return true; } +static bool legacy_reset(struct wlr_drm_backend *drm) { + bool ok = true; + 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, + crtc->id); + ok = false; + } + } + return ok; +} + const struct wlr_drm_interface legacy_iface = { .crtc_commit = legacy_crtc_commit, + .reset = legacy_reset, }; |