diff options
author | Simon Ser <contact@emersion.fr> | 2020-05-27 17:11:22 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-06-01 11:45:11 -0600 |
commit | 80467f6ae84e83ca44ed51e6c82b7cb289d1d3ce (patch) | |
tree | 4fa710200706a40f32d0917b7f17d254ba391425 /backend | |
parent | 70f3a0bb27805c6c5cd629ee66612cc1961364e2 (diff) |
backend/drm: commit/rollback FBs in drm_crtc_commit
We need to perform the FB bookkeeping on all commits, not just on
page-flips.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/drm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 1d60bbfb..3f7938bd 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -338,8 +338,16 @@ static bool drm_crtc_commit(struct wlr_drm_connector *conn, uint32_t flags) { bool ok = drm->iface->crtc_commit(drm, conn, flags); if (ok && !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) { memcpy(&crtc->current, &crtc->pending, sizeof(struct wlr_drm_crtc_state)); + drm_fb_move(&crtc->primary->queued_fb, &crtc->primary->pending_fb); + if (crtc->cursor != NULL) { + drm_fb_move(&crtc->cursor->queued_fb, &crtc->cursor->pending_fb); + } } else { memcpy(&crtc->pending, &crtc->current, sizeof(struct wlr_drm_crtc_state)); + drm_fb_clear(&crtc->primary->pending_fb); + if (crtc->cursor != NULL) { + drm_fb_clear(&crtc->cursor->pending_fb); + } } crtc->pending_modeset = false; return ok; @@ -361,10 +369,6 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn) { } conn->pageflip_pending = true; - drm_fb_move(&crtc->primary->queued_fb, &crtc->primary->pending_fb); - if (crtc->cursor != NULL) { - drm_fb_move(&crtc->cursor->queued_fb, &crtc->cursor->pending_fb); - } wlr_output_update_enabled(&conn->output, true); return true; } @@ -495,7 +499,6 @@ static bool drm_connector_commit_buffer(struct wlr_output *output) { } if (!drm_crtc_page_flip(conn)) { - drm_fb_clear(&plane->pending_fb); return false; } |