backend/drm: track cursor FB in wlr_drm_connector_state

Use the same logic for cursor FBs as we currently use for primary
FBs. This also fixes the same bug as [1] but in a different, more
robust way.

The new logic integrates better with atomic and will be required
anyways in the future when set_cursor will be superseded by a better
API.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4577
This commit is contained in:
Simon Ser 2024-02-28 14:08:17 +01:00
parent f6659414ba
commit 16b42bf65b
5 changed files with 18 additions and 19 deletions

View file

@ -419,7 +419,7 @@ static bool crtc_commit(struct wlr_drm_connector *conn,
if (crtc->cursor) {
if (drm_connector_is_cursor_visible(conn)) {
ok = ok && set_plane_props(crtc->cursor, crtc->cursor->liftoff_layer,
get_next_cursor_fb(conn), conn->cursor_x, conn->cursor_y,
state->cursor_fb, conn->cursor_x, conn->cursor_y,
wl_list_length(&crtc->layers) + 1);
} else {
ok = ok && disable_plane(crtc->cursor);