From 8dff1bb9bdbb2d785ddb5d330934166d359b3d78 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Sun, 10 Dec 2023 16:31:23 -0500 Subject: wlr_damage_ring: Replace wlr_damage_ring_rotate_buffer with original list impl The seq based implementation is complex to reason about and doesn't even work. --- include/wlr/types/wlr_damage_ring.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_damage_ring.h b/include/wlr/types/wlr_damage_ring.h index 309d7ace..203d919f 100644 --- a/include/wlr/types/wlr_damage_ring.h +++ b/include/wlr/types/wlr_damage_ring.h @@ -17,8 +17,6 @@ /* For triple buffering, a history of two frames is required. */ #define WLR_DAMAGE_RING_PREVIOUS_LEN 2 -/* Keep track of as many buffers as a swapchain can hold */ -#define WLR_DAMAGE_RING_BUFFERS_LEN 4 struct wlr_box; @@ -26,7 +24,9 @@ struct wlr_damage_ring_buffer { struct wlr_buffer *buffer; struct wl_listener destroy; pixman_region32_t damage; - uint64_t seq; + + struct wlr_damage_ring *ring; + struct wl_list link; // wlr_damage_ring.buffers }; struct wlr_damage_ring { @@ -40,8 +40,7 @@ struct wlr_damage_ring { pixman_region32_t previous[WLR_DAMAGE_RING_PREVIOUS_LEN]; size_t previous_idx; - uint64_t last_buffer_seq; - struct wlr_damage_ring_buffer buffers[WLR_DAMAGE_RING_BUFFERS_LEN]; + struct wl_list buffers; // wlr_damage_ring_buffer.link }; void wlr_damage_ring_init(struct wlr_damage_ring *ring); -- cgit v1.2.3