aboutsummaryrefslogtreecommitdiff
path: root/include/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-06 17:39:23 +0100
committerSimon Ser <contact@emersion.fr>2022-12-07 17:45:59 +0100
commit037b21647b06957682ff8a0a1b24dcbc49e1c357 (patch)
tree17d400d4f4e3e54f161ccc5baa7820cc3691fcae /include/backend
parentae61cd6bfb97a2ab5d03b30d90dd81ee6c82d352 (diff)
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.
Diffstat (limited to 'include/backend')
-rw-r--r--include/backend/drm/drm.h4
-rw-r--r--include/backend/drm/renderer.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index 365f1ad2..fa18225c 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -22,8 +22,6 @@ struct wlr_drm_plane {
/* Only initialized on multi-GPU setups */
struct wlr_drm_surface mgpu_surf;
- /* Buffer to be submitted to the kernel on the next page-flip */
- struct wlr_drm_fb *pending_fb;
/* Buffer submitted to the kernel, will be presented on next vblank */
struct wlr_drm_fb *queued_fb;
/* Buffer currently displayed on screen */
@@ -99,6 +97,7 @@ struct wlr_drm_connector_state {
bool modeset;
bool active;
drmModeModeInfo mode;
+ struct wlr_drm_fb *primary_fb;
};
struct wlr_drm_connector {
@@ -153,7 +152,6 @@ size_t drm_crtc_get_gamma_lut_size(struct wlr_drm_backend *drm,
struct wlr_drm_crtc *crtc);
void drm_lease_destroy(struct wlr_drm_lease *lease);
-struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane);
struct wlr_drm_fb *get_next_cursor_fb(struct wlr_drm_connector *conn);
#define wlr_drm_conn_log(conn, verb, fmt, ...) \
diff --git a/include/backend/drm/renderer.h b/include/backend/drm/renderer.h
index 77ed4127..5851d228 100644
--- a/include/backend/drm/renderer.h
+++ b/include/backend/drm/renderer.h
@@ -45,6 +45,7 @@ void drm_fb_destroy(struct wlr_drm_fb *fb);
void drm_fb_clear(struct wlr_drm_fb **fb);
void drm_fb_move(struct wlr_drm_fb **new, struct wlr_drm_fb **old);
+struct wlr_drm_fb *drm_fb_lock(struct wlr_drm_fb *fb);
struct wlr_buffer *drm_surface_blit(struct wlr_drm_surface *surf,
struct wlr_buffer *buffer);