From 3fdbfb0be82224d472ad6de3a91813064f4cd4b2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 4 Nov 2024 19:05:38 +0100 Subject: [PATCH] buffer: add more docs --- include/wlr/types/wlr_buffer.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/wlr/types/wlr_buffer.h b/include/wlr/types/wlr_buffer.h index 874edf82b..fadc560a3 100644 --- a/include/wlr/types/wlr_buffer.h +++ b/include/wlr/types/wlr_buffer.h @@ -17,11 +17,15 @@ struct wlr_buffer; struct wlr_renderer; +/** + * Shared-memory attributes for a buffer. + */ struct wlr_shm_attributes { int fd; - uint32_t format; - int width, height, stride; - off_t offset; + uint32_t format; // FourCC code, see DRM_FORMAT_* in + int width, height; + int stride; // Number of bytes between consecutive pixel lines + off_t offset; // Offset in bytes of the first pixel in FD }; /** @@ -130,6 +134,12 @@ enum wlr_buffer_data_ptr_access_flag { */ bool wlr_buffer_begin_data_ptr_access(struct wlr_buffer *buffer, uint32_t flags, void **data, uint32_t *format, size_t *stride); +/** + * Indicate that a pointer to a buffer's underlying memory will no longer be + * used. + * + * This function must be called after wlr_buffer_begin_data_ptr_access(). + */ void wlr_buffer_end_data_ptr_access(struct wlr_buffer *buffer); /**