hack: force DMA-BUF heap allocator

This commit is contained in:
Simon Ser 2024-10-02 22:12:45 +02:00
parent aa6d72f904
commit ac2a19e710

View file

@ -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;