mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
render/gbm_allocator: make wlr_gbm_allocator_create return a wlr_allocator
This commit is contained in:
parent
3a04fb4560
commit
c75aa71816
7 changed files with 24 additions and 21 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue