backend/drm: store pending FB in state

Instead of having a pending_fb field on the struct wlr_drm_plane,
move it to struct wlr_drm_connector_state. That way, there's no
risk having a stale pending FB around: the state doesn't survive
across tests and commits.

The cursor is a special case because it's disconnected from the
atomic state: the wlr_backend_impl.set_cursor hook sets the cursor
for the next commit. Move the field to
wlr_drm_connector.cursor_pending_fb.
This commit is contained in:
Simon Ser 2022-12-06 17:39:23 +01:00
parent ae61cd6bfb
commit 037b21647b
6 changed files with 70 additions and 51 deletions

View file

@ -130,7 +130,6 @@ void drm_plane_finish_surface(struct wlr_drm_plane *plane) {
return;
}
drm_fb_clear(&plane->pending_fb);
drm_fb_clear(&plane->queued_fb);
drm_fb_clear(&plane->current_fb);
@ -194,6 +193,11 @@ void drm_fb_clear(struct wlr_drm_fb **fb_ptr) {
*fb_ptr = NULL;
}
struct wlr_drm_fb *drm_fb_lock(struct wlr_drm_fb *fb) {
wlr_buffer_lock(fb->wlr_buf);
return fb;
}
static void drm_fb_handle_destroy(struct wlr_addon *addon) {
struct wlr_drm_fb *fb = wl_container_of(addon, fb, addon);
drm_fb_destroy(fb);