diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c index 27b08fc82..75ee4bd11 100644 --- a/render/allocator/allocator.c +++ b/render/allocator/allocator.c @@ -18,6 +18,8 @@ #include "render/allocator/gbm.h" #endif +#include "render/allocator/dma_heap.h" + void wlr_allocator_init(struct wlr_allocator *alloc, const struct wlr_allocator_interface *impl, uint32_t buffer_caps) { assert(impl && impl->destroy && impl->create_buffer); @@ -96,6 +98,13 @@ struct wlr_allocator *allocator_autocreate_with_drm_fd( int drm_fd) { uint32_t renderer_caps = renderer->render_buffer_caps; + int heap_fd = open("/dev/dma_heap/system", O_RDWR | O_CLOEXEC); + if (heap_fd < 0) { + wlr_log_errno(WLR_ERROR, "Failed to open /dev/dma_heap/system"); + return NULL; + } + return wlr_dma_heap_allocator_create(heap_fd); + struct wlr_allocator *alloc = NULL; uint32_t gbm_caps = WLR_BUFFER_CAP_DMABUF;