aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-02-14 00:27:43 -0500
committeremersion <contact@emersion.fr>2019-02-14 10:59:06 +0100
commit72c76b128e562c482868b42b1945ed49cbd44353 (patch)
treeb83bb7658eb04f3c896a488e5776cbc352e39ddf /backend/drm
parent5c8d2da0a1cd3839663d070532ba45bd61d374ca (diff)
drm: do not modeset to current mode
There is no point in modesetting an output to a mode that it is already set to. Modesetting will cause the output to briefly flicker which is undesirable for a noop. This returns early in `drm_connector_set_mode` when attempting to modeset to the current mode.
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 619664d6..0fca55d8 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -537,6 +537,10 @@ static bool drm_connector_set_mode(struct wlr_output *output,
conn->desired_mode = mode;
return false;
}
+ if (conn->output.current_mode == mode) {
+ // Nothing to do
+ return true;
+ }
wlr_log(WLR_INFO, "Modesetting '%s' with '%ux%u@%u mHz'",
conn->output.name, mode->width, mode->height, mode->refresh);