aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-07-05 11:04:02 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-07-05 10:55:41 -0400
commit4dee7a2f6fb8c1a9e01c6d5cc8dd9fe0b5e20486 (patch)
tree29874c4bbf7fe43830944044d1ac38185944e994
parent5f26360bd89b3e4818474142332744268fec45d4 (diff)
backend/drm: don't clear pending cursor FB on failed commit
The previous fix tried to side-step cursor->pending_fb completely. However that messes up our buffer locking mechanism. Instead, stop clearing the pending cursor FB on a failed commit. The pending cursor FB will remain for the next commit. Fixes: 6c3d080e25e5 ("backend/drm: populate cursor plane's current_fb")
-rw-r--r--backend/drm/drm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 7700bd2d..b6b4baf6 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -355,9 +355,12 @@ static bool drm_crtc_commit(struct wlr_drm_connector *conn,
}
} else {
drm_fb_clear(&crtc->primary->pending_fb);
- if (crtc->cursor != NULL) {
- drm_fb_clear(&crtc->cursor->pending_fb);
- }
+ // The set_cursor() hook is a bit special: it's not really synchronized
+ // to commit() or test(). Once set_cursor() returns true, the new
+ // cursor is effectively committed. So don't roll it back here, or we
+ // risk ending up in a state where we don't have a cursor FB but
+ // wlr_drm_connector.cursor_enabled is true.
+ // TODO: fix our output interface to avoid this issue.
}
return ok;
}