aboutsummaryrefslogtreecommitdiff
path: root/render/gbm_allocator.c
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-04-15 14:32:13 -0400
committerSimon Ser <contact@emersion.fr>2021-04-28 20:55:57 +0200
commitc75aa71816826907805606a108626b4671120a7e (patch)
tree471aa3d45646e571555829a88bd506d0cfc09e2a /render/gbm_allocator.c
parent3a04fb4560cf60c34bd968fe711a45d42993e5a4 (diff)
render/gbm_allocator: make wlr_gbm_allocator_create return a wlr_allocator
Diffstat (limited to 'render/gbm_allocator.c')
-rw-r--r--render/gbm_allocator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/render/gbm_allocator.c b/render/gbm_allocator.c
index da71cbaf..33fbf954 100644
--- a/render/gbm_allocator.c
+++ b/render/gbm_allocator.c
@@ -159,7 +159,7 @@ static struct wlr_gbm_allocator *get_gbm_alloc_from_alloc(
return (struct wlr_gbm_allocator *)alloc;
}
-struct wlr_gbm_allocator *wlr_gbm_allocator_create(int fd) {
+struct wlr_allocator *wlr_gbm_allocator_create(int fd) {
uint64_t cap;
if (drmGetCap(fd, DRM_CAP_PRIME, &cap) ||
!(cap & DRM_PRIME_CAP_EXPORT)) {
@@ -185,8 +185,11 @@ struct wlr_gbm_allocator *wlr_gbm_allocator_create(int fd) {
wlr_log(WLR_DEBUG, "Created GBM allocator with backend %s",
gbm_device_get_backend_name(alloc->gbm_device));
+ char *drm_name = drmGetDeviceNameFromFd2(fd);
+ wlr_log(WLR_DEBUG, "Using DRM node %s", drm_name);
+ free(drm_name);
- return alloc;
+ return &alloc->base;
}
static void allocator_destroy(struct wlr_allocator *wlr_alloc) {