From f0781cd79207893c82cc1627df05b71aab4bfa54 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 27 Dec 2019 12:43:49 +0100 Subject: [PATCH] backend/drm: modeset before enabling an output This saves one modeset in case the previous mode is different. --- backend/drm/drm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 60c9e44c..dea79d7a 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -422,12 +422,6 @@ static bool drm_connector_commit(struct wlr_output *output) { return false; } - if (output->pending.committed & WLR_OUTPUT_STATE_ENABLED) { - if (!enable_drm_connector(output, output->pending.enabled)) { - return false; - } - } - if (output->pending.committed & WLR_OUTPUT_STATE_MODE) { switch (output->pending.mode_type) { case WLR_OUTPUT_STATE_MODE_FIXED: @@ -446,6 +440,12 @@ static bool drm_connector_commit(struct wlr_output *output) { } } + if (output->pending.committed & WLR_OUTPUT_STATE_ENABLED) { + if (!enable_drm_connector(output, output->pending.enabled)) { + return false; + } + } + if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) { if (!drm_connector_commit_buffer(output)) { return false;