From 72c76b128e562c482868b42b1945ed49cbd44353 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Thu, 14 Feb 2019 00:27:43 -0500 Subject: [PATCH] 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. --- backend/drm/drm.c | 4 ++++ 1 file changed, 4 insertions(+) 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);