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
This commit is contained in:
Kenny Levinsen 2021-04-30 00:55:26 +02:00 committed by Simon Ser
parent c85789a3a9
commit 2603a5dee7
1 changed files with 6 additions and 3 deletions

View File

@ -729,9 +729,12 @@ static bool drm_connector_set_mode(struct wlr_drm_connector *conn,
struct wlr_output_mode *wlr_mode = NULL; struct wlr_output_mode *wlr_mode = NULL;
if (drm_connector_state_active(conn, state)) { if (drm_connector_state_active(conn, state)) {
assert(state->committed & WLR_OUTPUT_STATE_MODE); if (state->committed & WLR_OUTPUT_STATE_MODE) {
assert(state->mode_type == WLR_OUTPUT_STATE_MODE_FIXED); assert(state->mode_type == WLR_OUTPUT_STATE_MODE_FIXED);
wlr_mode = state->mode; wlr_mode = state->mode;
} else {
wlr_mode = conn->output.current_mode;
}
} }
conn->desired_enabled = wlr_mode != NULL; conn->desired_enabled = wlr_mode != NULL;