wlroots/include
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
..
backend backend/wayland: add support for explicit sync 2024-11-11 15:22:22 +00:00
interfaces types/wlr_input_device: move init and finish function to private API 2022-03-07 16:37:41 +00:00
render renderer: Drop mention of wlr_renderer_begin_with_buffer 2024-11-11 22:48:50 +00:00
types Support direct scanout with src crop and dst boxes 2024-10-22 18:28:09 +01:00
util util/time: Move NSEC_PER_SEC to header 2024-11-07 10:22:56 +01:00
wlr buffer: introduce wlr_buffer_acquire() 2024-11-22 11:56:47 +01:00
xcursor Add some missing includes/declarations 2023-06-05 21:06:19 +00:00
xwayland xwayland/xwm: implement somewhat asynchronous request flushing 2024-10-07 21:51:15 +03:00
meson.build render/color: add fallback stub when LCMS2 is disabled 2024-06-04 17:45:51 +00:00