render/gbm_allocator: make wlr_gbm_allocator_create return a wlr_allocator

This commit is contained in:
Simon Zeni 2021-04-15 14:32:13 -04:00 committed by Simon Ser
parent 3a04fb4560
commit c75aa71816
7 changed files with 24 additions and 21 deletions

View file

@ -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) {