backend/drm: store pending layer FBs in wlr_drm_connector_state

This avoids storing state related to wlr_output_state in temporary
field in wlr_drm_layer. That way we don't need to be careful we
cleaning up, drm_connector_state_finish() will release pending
buffers.
This commit is contained in:
Simon Ser 2023-06-12 17:28:49 +02:00
parent 6e8fb5509f
commit 6336e72c68
3 changed files with 40 additions and 25 deletions

View file

@ -43,8 +43,6 @@ struct wlr_drm_layer {
struct wlr_addon addon; // wlr_output_layer.addons
struct wl_list link; // wlr_drm_crtc.layers
/* 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 */
@ -127,6 +125,7 @@ struct wlr_drm_connector_state {
bool active;
drmModeModeInfo mode;
struct wlr_drm_fb *primary_fb;
struct wlr_drm_fb **layer_fbs; // same length as wlr_output_state.layers if non-NULL
};
struct wlr_drm_connector {