aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/types/wlr_buffer.h24
-rw-r--r--include/wlr/types/wlr_buffer.h4
2 files changed, 21 insertions, 7 deletions
diff --git a/include/types/wlr_buffer.h b/include/types/wlr_buffer.h
index 4817e23f..6f8d3b1c 100644
--- a/include/types/wlr_buffer.h
+++ b/include/types/wlr_buffer.h
@@ -70,16 +70,30 @@ struct wlr_dmabuf_buffer *dmabuf_buffer_create(
bool dmabuf_buffer_drop(struct wlr_dmabuf_buffer *buffer);
/**
+ * Buffer data pointer access flags.
+ */
+enum wlr_buffer_data_ptr_access_flag {
+ /**
+ * The buffer contents can be read back.
+ */
+ WLR_BUFFER_DATA_PTR_ACCESS_READ = 1 << 0,
+ /**
+ * The buffer contents can be written to.
+ */
+ WLR_BUFFER_DATA_PTR_ACCESS_WRITE = 1 << 1,
+};
+
+/**
* Get a pointer to a region of memory referring to the buffer's underlying
* storage. The format and stride can be used to interpret the memory region
* contents.
*
- * The returned pointer should be pointing to a valid memory region for read
- * and write operations. The returned pointer is only valid up to the next
- * buffer_end_data_ptr_access call.
+ * The returned pointer should be pointing to a valid memory region for the
+ * operations specified in the flags. The returned pointer is only valid up to
+ * the next buffer_end_data_ptr_access call.
*/
-bool buffer_begin_data_ptr_access(struct wlr_buffer *buffer, void **data,
- uint32_t *format, size_t *stride);
+bool buffer_begin_data_ptr_access(struct wlr_buffer *buffer, uint32_t flags,
+ void **data, uint32_t *format, size_t *stride);
void buffer_end_data_ptr_access(struct wlr_buffer *buffer);
#endif
diff --git a/include/wlr/types/wlr_buffer.h b/include/wlr/types/wlr_buffer.h
index c714ddb6..6bf3c97b 100644
--- a/include/wlr/types/wlr_buffer.h
+++ b/include/wlr/types/wlr_buffer.h
@@ -30,8 +30,8 @@ struct wlr_buffer_impl {
struct wlr_dmabuf_attributes *attribs);
bool (*get_shm)(struct wlr_buffer *buffer,
struct wlr_shm_attributes *attribs);
- bool (*begin_data_ptr_access)(struct wlr_buffer *buffer, void **data,
- uint32_t *format, size_t *stride);
+ bool (*begin_data_ptr_access)(struct wlr_buffer *buffer, uint32_t flags,
+ void **data, uint32_t *format, size_t *stride);
void (*end_data_ptr_access)(struct wlr_buffer *buffer);
};