From b03eebf7d4e76d9f00ea595767c6916c7fd79169 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 27 May 2020 17:59:16 +0200 Subject: [PATCH] backend/drm: always perform a CRTC commit in drm_connector_commit When the mode, status or buffer hasn't changed, drm_connector_commit was a no-op. Because of this individual changes to the gamma LUT or adaptive sync status were ignored (if committed without a buffer). Instead, perform a commit to apply the changes. --- backend/drm/drm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 7d066b2d..f034bf9f 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -564,14 +564,19 @@ static bool drm_connector_commit(struct wlr_output *output) { if (!drm_connector_set_mode(conn, wlr_mode)) { return false; } - } - - // TODO: support modesetting with a buffer - if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER && - !(output->pending.committed & WLR_OUTPUT_STATE_MODE)) { + } else if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) { + // TODO: support modesetting with a buffer if (!drm_connector_commit_buffer(output)) { return false; } + } else if (output->pending.committed & + (WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED | + WLR_OUTPUT_STATE_GAMMA_LUT)) { + assert(conn->crtc != NULL); + // TODO: maybe request a page-flip event here? + if (!drm_crtc_commit(conn, 0)) { + return false; + } } return true;