aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-11-19 15:14:22 +0100
committerSimon Ser <contact@emersion.fr>2023-11-19 15:14:22 +0100
commitf47b6e3fceb3c26d94ca0efa7929a7f741bd4368 (patch)
tree4a363aa60de7e1fcea77e719db6314dab49ff4af /backend
parentc6b498528c48d44444e320536b3ba1faa37b1d83 (diff)
backend/drm: fix pending page-flip check
This chunk of code was moved by mistake. Fixes: 3b53d1cbf199 ("backend/drm: introduce page-flip tracking struct")
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c19
1 files 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;