buffer: add wlr_dmabuf_buffer

This commit is contained in:
Simon Ser 2021-06-29 21:01:11 +02:00 committed by Simon Zeni
parent 18adb43a44
commit 08e5b909f9
2 changed files with 83 additions and 0 deletions

View file

@ -53,6 +53,25 @@ struct wlr_readonly_data_buffer *readonly_data_buffer_create(uint32_t format,
*/
bool readonly_data_buffer_drop(struct wlr_readonly_data_buffer *buffer);
struct wlr_dmabuf_buffer {
struct wlr_buffer base;
struct wlr_dmabuf_attributes dmabuf;
bool saved;
};
/**
* Wraps a DMA-BUF into a wlr_buffer. The DMA-BUF may be accessed until
* dmabuf_buffer_drop() is called.
*/
struct wlr_dmabuf_buffer *dmabuf_buffer_create(
struct wlr_dmabuf_attributes *dmabuf);
/**
* Drops ownership of the buffer (see wlr_buffer_drop() for more details) and
* takes a reference to the DMA-BUF (by dup'ing its file descriptors) if a
* consumer still has the buffer locked.
*/
bool dmabuf_buffer_drop(struct wlr_dmabuf_buffer *buffer);
/**
* Buffer capabilities.
*