From 8c70245d5fe044f09882653437e0a9dc7c336a0c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 18 Jun 2021 12:40:07 +0200 Subject: output: fail commits if adaptive sync cannot be enabled Previously, adaptive sync was just a hint and wouldn't make any atomic commit fail if the backend didn't support it. The main reason is wlr_output_test wasn't supported at the time. Now that we have a way for compositors to test whether a change can work, let's remove the exception for adaptive sync and convert it to a regular output state field. --- backend/drm/atomic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'backend/drm/atomic.c') diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index ab1b2160..05d01125 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -254,8 +254,10 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn, bool prev_vrr_enabled = output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED; bool vrr_enabled = prev_vrr_enabled; - if ((state->base->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) && - drm_connector_supports_vrr(conn)) { + if ((state->base->committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED)) { + if (!drm_connector_supports_vrr(conn)) { + return false; + } vrr_enabled = state->base->adaptive_sync_enabled; } -- cgit v1.2.3