From 2603a5dee71ceb3cbf566e1f874ca2defecbb1c9 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 30 Apr 2021 00:55:26 +0200 Subject: [PATCH] backend/drm: Do not require mode commit on enable If a mode is not provided, use the current mode intead. Closes: https://github.com/swaywm/wlroots/issues/2904 --- backend/drm/drm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index d97f753f..2c9560f1 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -729,9 +729,12 @@ static bool drm_connector_set_mode(struct wlr_drm_connector *conn, struct wlr_output_mode *wlr_mode = NULL; if (drm_connector_state_active(conn, state)) { - assert(state->committed & WLR_OUTPUT_STATE_MODE); - assert(state->mode_type == WLR_OUTPUT_STATE_MODE_FIXED); - wlr_mode = state->mode; + if (state->committed & WLR_OUTPUT_STATE_MODE) { + assert(state->mode_type == WLR_OUTPUT_STATE_MODE_FIXED); + wlr_mode = state->mode; + } else { + wlr_mode = conn->output.current_mode; + } } conn->desired_enabled = wlr_mode != NULL;