aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-06-05 17:38:32 +0200
committerDrew DeVault <sir@cmpwn.com>2020-06-08 10:13:00 -0600
commite77c046cf98f53a9307deeb8940d67938c078986 (patch)
tree88eb1b1b8db5012dfdaf48e7643e1169bd449f42
parent9b85a8b43dae9c6323348c3f7b033c0ef3a68906 (diff)
backend/drm: fix stack overflow in dealloc_crtc
Call drm_crtc_commit directly instead of calling drm_connector_set_mode. This restores the previous behaviour where conn_enable was called [1]. [1]: https://github.com/swaywm/wlroots/blob/0c7c562482575cacaecadcd7913ef25aeb21711f/backend/drm/drm.c#L1093 Closes: https://github.com/swaywm/wlroots/issues/2253
-rw-r--r--backend/drm/drm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 822ef0e2..43453072 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -1052,7 +1052,12 @@ static void dealloc_crtc(struct wlr_drm_connector *conn) {
wlr_log(WLR_DEBUG, "De-allocating CRTC %zu for output '%s'",
conn->crtc - drm->crtcs, conn->output.name);
- drm_connector_set_mode(conn, NULL);
+ conn->crtc->pending_modeset = true;
+ conn->crtc->pending.active = false;
+ if (!drm_crtc_commit(conn, 0)) {
+ return;
+ }
+
drm_plane_finish_surface(conn->crtc->primary);
drm_plane_finish_surface(conn->crtc->cursor);
if (conn->crtc->cursor != NULL) {