mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
hack: force DMA-BUF heap allocator
This commit is contained in:
parent
aa6d72f904
commit
ac2a19e710
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue