From 1d3e62c67f07a180fca02a6df1cf9648f2b50349 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sun, 12 Mar 2023 16:48:58 -0400 Subject: Stop pooling background surface buffers The wl_buffers for the background surface only need to be updated when the output dimensions change. Using the fixed pool of two buffers to cache these buffers does not help, since if a new buffer is needed, it will have a different size than whatever buffers were cached. Furthermore, because the pool has fixed size, it is possible to run out of buffers if configure events arrive faster than pool buffers are marked not busy, which can lead to protocol errors when the background surface is committed after acknowledging a new size, but without attaching a buffer that matches that size. --- pool-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pool-buffer.c') diff --git a/pool-buffer.c b/pool-buffer.c index 02884de..dfb4d0d 100644 --- a/pool-buffer.c +++ b/pool-buffer.c @@ -46,7 +46,7 @@ static const struct wl_buffer_listener buffer_listener = { .release = buffer_release }; -static struct pool_buffer *create_buffer(struct wl_shm *shm, +struct pool_buffer *create_buffer(struct wl_shm *shm, struct pool_buffer *buf, int32_t width, int32_t height, uint32_t format) { uint32_t stride = width * 4; -- cgit v1.2.3