wlroots/render
Simon Ser 30ccac3a02 buffer: introduce wlr_buffer_acquire()
A footgun in the wlr_buffer API is that there's no difference
between acquiring a buffer and increasing the lock count. In other
words, transitioning a buffer from the released state to the
acquired state is not explicit. This may result in hard-to-debug
failures if there is a dangling released wlr_buffer somewhere
(e.g. wlr_client_buffer.source [1]) and some piece of code calls
wlr_buffer_lock(). In that case, the buffer will be acquired and
released again. In the context of a wlr_buffer issued from a
Wayland protocol wl_buffer object, this can cause the underlying
memory to be used after wl_buffer.release has been sent to the
client, and a double wl_buffer.release event to be sent.

Make it so acquiring a buffer is an explicit operation to make sure
the caller means the state transition and is prepared for a new
release event. wlr_buffer_acquire() forbids calls on already-acquired
buffers, and wlr_buffer_lock() now forbids calls on released buffers.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4904
2024-11-22 11:56:47 +01:00
..
allocator render/allocator: drop allocator_autocreate_with_drm_fd() 2024-11-07 18:55:01 +01:00
gles2 gles2/pass: remove duplicate variable declarations 2024-08-27 20:25:18 +08:00
pixman render/pixman: Fix non-uniform scale with rotation 2024-05-23 11:56:59 +00:00
vulkan render/vulkan: Garbage collect unused buffers 2024-11-07 09:49:29 +00:00
color.c render/color: Invert ownership model of color_transform types. 2024-08-24 14:33:22 -04:00
color_fallback.c render/color: add fallback stub when LCMS2 is disabled 2024-06-04 17:45:51 +00:00
color_lcms2.c render/color: Invert ownership model of color_transform types. 2024-08-24 14:33:22 -04:00
dmabuf.c Define _POSIX_C_SOURCE globally 2024-02-15 15:41:12 +01:00
dmabuf_fallback.c render/dmabuf: add dmabuf_export_sync_file() 2022-12-06 14:54:09 +00:00
dmabuf_linux.c render/dmabuf: add dmabuf_export_sync_file() 2022-12-06 14:54:09 +00:00
drm_format_set.c drm_format_set: Add wlr_drm_format_set_remove 2024-11-08 13:45:05 +01:00
drm_syncobj.c render/drm_syncobj: add addon set 2024-11-11 15:22:22 +00:00
egl.c render/egl: Release devices before return 2024-08-19 23:18:11 +08:00
meson.build build: check eglext.h header version 2024-06-27 17:54:57 +00:00
pass.c render: drop legacy render pass 2023-11-22 00:55:56 +01:00
pixel_format.c render/pixel-format: Move has_alpha into it's own array 2024-01-31 13:47:17 -05:00
swapchain.c buffer: introduce wlr_buffer_acquire() 2024-11-22 11:56:47 +01:00
wlr_renderer.c Consider using vulkan renderer in default configuration 2024-11-06 08:52:58 +01:00
wlr_texture.c wlr_texture: Introduce wlr_texture_preferred_read_format 2023-11-30 19:56:54 -05:00