aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-09-07 11:34:53 +0200
committerSimon Ser <contact@emersion.fr>2021-09-07 11:34:53 +0200
commit274c8189d47e569f669f87bd6d9f2b895065f097 (patch)
treef20c1dd68d8fa676d06a2dcc239eac8e5adec156 /backend
parent3c74bd0c915e7ddd1b5dcc05d14f5555de10e980 (diff)
backend/drm: fix crash on VT switch
Don't set the MODE flag when disabling a CRTC. This fixes a NULL pointer dereference in drm_connector_state_init.
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/backend.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index 820a7bc6..52230592 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -110,11 +110,13 @@ static void handle_session_active(struct wl_listener *listener, void *data) {
struct wlr_drm_connector *conn;
wl_list_for_each(conn, &drm->outputs, link) {
struct wlr_output_mode *mode = NULL;
+ uint32_t committed = WLR_OUTPUT_STATE_ENABLED;
if (conn->output.enabled && conn->output.current_mode != NULL) {
+ committed |= WLR_OUTPUT_STATE_MODE;
mode = conn->output.current_mode;
}
struct wlr_output_state state = {
- .committed = WLR_OUTPUT_STATE_MODE | WLR_OUTPUT_STATE_ENABLED,
+ .committed = committed,
.enabled = mode != NULL,
.mode_type = WLR_OUTPUT_STATE_MODE_FIXED,
.mode = mode,