From f47b6e3fceb3c26d94ca0efa7929a7f741bd4368 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 19 Nov 2023 15:14:22 +0100 Subject: [PATCH] backend/drm: fix pending page-flip check This chunk of code was moved by mistake. Fixes: 3b53d1cbf199 ("backend/drm: introduce page-flip tracking struct") --- backend/drm/drm.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 0af93802..25bfb319 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -763,6 +763,16 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn, if (!drm_connector_state_update_primary_fb(conn, &pending)) { goto out; } + + // wlr_drm_interface.crtc_commit will perform either a non-blocking + // page-flip, either a blocking modeset. When performing a blocking modeset + // we'll wait for all queued page-flips to complete, so we don't need this + // safeguard. + if (conn->pending_page_flip != NULL && !pending.modeset) { + wlr_drm_conn_log(conn, WLR_ERROR, "Failed to page-flip output: " + "a page-flip is already pending"); + goto out; + } } if (pending.base->committed & WLR_OUTPUT_STATE_LAYERS) { if (!drm_connector_set_pending_layer_fbs(conn, pending.base)) { @@ -783,15 +793,6 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn, uint32_t flags = 0; if (pending.active) { flags |= DRM_MODE_PAGE_FLIP_EVENT; - // wlr_drm_interface.crtc_commit will perform either a non-blocking - // page-flip, either a blocking modeset. When performing a blocking modeset - // we'll wait for all queued page-flips to complete, so we don't need this - // safeguard. - if (conn->pending_page_flip != NULL && !pending.modeset) { - wlr_drm_conn_log(conn, WLR_ERROR, "Failed to page-flip output: " - "a page-flip is already pending"); - goto out; - } } if (pending.base->tearing_page_flip) { flags |= DRM_MODE_PAGE_FLIP_ASYNC;