Skip to content

Commit

Permalink
backend/drm: populate cursor plane's current_fb
Browse files Browse the repository at this point in the history
The set_cursor() hook is a little bit special: it's not really
synchronized to commit() or test(). Once set_cursor() returns true,
the new cursor is part of the current state.

This fixes a state where wlr_drm_connector.cursor_enabled is true
but there is no FB available. This is triggered by set_cursor()
followed by a failed commit(), which resets pending_fb.

We should definitely fix the output interface to make the cursor part
of the pending state, but that's a more involved change.
  • Loading branch information
emersion authored and kennylevinsen committed Jun 16, 2021
1 parent 6259fd2 commit 6c3d080
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
local_buf = wlr_buffer_lock(buffer);
}

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

0 comments on commit 6c3d080

Please sign in to comment.