mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
render/allocator: add udmabuf allocator
udmabuf can create a DMA-BUF backed by a memfd. This is useful when running with a software implementation of GL/Vulkan: the memfd can be passed to the parent compositor via wl_shm and the DMA-BUF can be imported via the usual APIs into GL/Vulkan.
This commit is contained in:
parent
1c604207c6
commit
7cf8e80ffe
7 changed files with 209 additions and 3 deletions
23
include/render/allocator/udmabuf.h
Normal file
23
include/render/allocator/udmabuf.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef RENDER_ALLOCATOR_UDMABUF_H
|
||||
#define RENDER_ALLOCATOR_UDMABUF_H
|
||||
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
|
||||
struct wlr_udmabuf_buffer {
|
||||
struct wlr_buffer base;
|
||||
|
||||
size_t size;
|
||||
struct wlr_shm_attributes shm;
|
||||
struct wlr_dmabuf_attributes dmabuf;
|
||||
};
|
||||
|
||||
struct wlr_udmabuf_allocator {
|
||||
struct wlr_allocator base;
|
||||
|
||||
int fd;
|
||||
};
|
||||
|
||||
struct wlr_allocator *wlr_udmabuf_allocator_create(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#mesondefine WLR_HAS_VULKAN_RENDERER
|
||||
|
||||
#mesondefine WLR_HAS_GBM_ALLOCATOR
|
||||
#mesondefine WLR_HAS_UDMABUF_ALLOCATOR
|
||||
|
||||
#mesondefine WLR_HAS_XWAYLAND
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue