buffer: replace get_data_ptr with {begin,end}_data_ptr_access

This new API allows buffer implementations to know when a user is
actively accessing the buffer's underlying storage. This is
important for the upcoming client-backed wlr_buffer implementation.
This commit is contained in:
Simon Ser 2021-06-02 17:02:28 +02:00 committed by Simon Zeni
parent 9e58301df7
commit 38ba5881a0
7 changed files with 79 additions and 18 deletions

View file

@ -81,7 +81,8 @@ struct wlr_buffer *wlr_allocator_create_buffer(struct wlr_allocator *alloc,
return NULL;
}
if (alloc->buffer_caps & WLR_BUFFER_CAP_DATA_PTR) {
assert(buffer->impl->get_data_ptr);
assert(buffer->impl->begin_data_ptr_access &&
buffer->impl->end_data_ptr_access);
}
if (alloc->buffer_caps & WLR_BUFFER_CAP_DMABUF) {
assert(buffer->impl->get_dmabuf);