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

@ -134,7 +134,7 @@ static bool legacy_crtc_commit(struct wlr_drm_connector *conn,
}
if (cursor != NULL && drm_connector_is_cursor_visible(conn)) {
struct wlr_drm_fb *cursor_fb = get_next_cursor_fb(conn);
struct wlr_drm_fb *cursor_fb = state->cursor_fb;
if (cursor_fb == NULL) {
wlr_drm_conn_log(conn, WLR_DEBUG, "Failed to acquire cursor FB");
return false;