aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-04-28 10:11:09 -0400
committerSimon Ser <contact@emersion.fr>2021-04-28 20:55:57 +0200
commitcc1b66364cc9f29456727f9864ee04e57babe8e7 (patch)
treeb560a03c1ca3e5efc973f27a64e9ce4aa784bab3 /backend/drm
parent318e3ac92cd3a172932370a7da8b2c2d24231758 (diff)
backend: use wlr_allocator_autocreate
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/renderer.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 00dfcbb0..6492ff40 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -14,7 +14,7 @@
#include "backend/drm/drm.h"
#include "backend/drm/util.h"
#include "render/drm_format_set.h"
-#include "render/gbm_allocator.h"
+#include "render/allocator.h"
#include "render/pixel_format.h"
#include "render/swapchain.h"
#include "render/wlr_renderer.h"
@@ -35,16 +35,10 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
goto error_gbm;
}
- int alloc_fd = fcntl(drm->fd, F_DUPFD_CLOEXEC, 0);
- if (alloc_fd < 0) {
- wlr_log_errno(WLR_ERROR, "fcntl(F_DUPFD_CLOEXEC) failed");
- goto error_wlr_rend;
- }
-
- renderer->allocator = wlr_gbm_allocator_create(alloc_fd);
+ renderer->allocator = wlr_allocator_autocreate(&drm->backend,
+ renderer->wlr_rend);
if (renderer->allocator == NULL) {
wlr_log(WLR_ERROR, "Failed to create allocator");
- close(alloc_fd);
goto error_wlr_rend;
}