Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

backend/drm: don't clear pending cursor FB on failed commit #3021

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions backend/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -933,7 +936,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
local_buf = wlr_buffer_lock(buffer);
}

bool ok = drm_fb_import(&plane->current_fb, drm, local_buf,
bool ok = drm_fb_import(&plane->pending_fb, drm, local_buf,
&plane->formats);
wlr_buffer_unlock(local_buf);
if (!ok) {
Expand Down