From 4e7a8707cce75b4cdc046581ec0c1cc7c0c26e02 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 29 Jun 2021 17:08:32 +0200 Subject: buffer: add data_ptr access flags This allows callers to specify the operations they'll perform on the returned data pointer. The motivations for this are: - The upcoming Linux MAP_NOSIGBUS flag may only be usable on read-only mappings. - gbm_bo_map with GBM_BO_TRANSFER_READ hurts performance. --- render/allocator/drm_dumb.c | 2 +- render/allocator/shm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'render/allocator') diff --git a/render/allocator/drm_dumb.c b/render/allocator/drm_dumb.c index ea982a03..170d9c33 100644 --- a/render/allocator/drm_dumb.c +++ b/render/allocator/drm_dumb.c @@ -128,7 +128,7 @@ create_err: } static bool drm_dumb_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, - void **data, uint32_t *format, size_t *stride) { + uint32_t flags, void **data, uint32_t *format, size_t *stride) { struct wlr_drm_dumb_buffer *buf = drm_dumb_buffer_from_buffer(wlr_buffer); *data = buf->data; *stride = buf->stride; diff --git a/render/allocator/shm.c b/render/allocator/shm.c index 7b32cf8d..77054dbe 100644 --- a/render/allocator/shm.c +++ b/render/allocator/shm.c @@ -31,7 +31,7 @@ static bool buffer_get_shm(struct wlr_buffer *wlr_buffer, } static bool shm_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, - void **data, uint32_t *format, size_t *stride) { + uint32_t flags, void **data, uint32_t *format, size_t *stride) { struct wlr_shm_buffer *buffer = shm_buffer_from_buffer(wlr_buffer); *data = buffer->data; *format = buffer->shm.format; -- cgit v1.2.3