From bf757065553959948f49815c2ed2958ccd109260 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 30 Nov 2023 21:07:48 +0100 Subject: [PATCH] render/allocator/gbm: add _with_drm_fd to create function name Reserve wlr_gbm_allocator_create() for a potential future function which takes an already-existing gbm_device as input. --- include/render/allocator/gbm.h | 2 +- render/allocator/allocator.c | 2 +- render/allocator/gbm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/render/allocator/gbm.h b/include/render/allocator/gbm.h index 7e043faf5..ea3e3243b 100644 --- a/include/render/allocator/gbm.h +++ b/include/render/allocator/gbm.h @@ -29,6 +29,6 @@ struct wlr_gbm_allocator { * * Takes ownership over the FD. */ -struct wlr_allocator *wlr_gbm_allocator_create(int drm_fd); +struct wlr_allocator *wlr_gbm_allocator_create_with_drm_fd(int drm_fd); #endif diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c index f71902f27..ff31fb7e8 100644 --- a/render/allocator/allocator.c +++ b/render/allocator/allocator.c @@ -109,7 +109,7 @@ struct wlr_allocator *allocator_autocreate_with_drm_fd( if (gbm_fd < 0) { return NULL; } - if ((alloc = wlr_gbm_allocator_create(gbm_fd)) != NULL) { + if ((alloc = wlr_gbm_allocator_create_with_drm_fd(gbm_fd)) != NULL) { return alloc; } close(gbm_fd); diff --git a/render/allocator/gbm.c b/render/allocator/gbm.c index 2ce7b2fd2..9c9dc75c6 100644 --- a/render/allocator/gbm.c +++ b/render/allocator/gbm.c @@ -192,7 +192,7 @@ static struct wlr_gbm_allocator *get_gbm_alloc_from_alloc( return alloc; } -struct wlr_allocator *wlr_gbm_allocator_create(int fd) { +struct wlr_allocator *wlr_gbm_allocator_create_with_drm_fd(int fd) { uint64_t cap; if (drmGetCap(fd, DRM_CAP_PRIME, &cap) || !(cap & DRM_PRIME_CAP_EXPORT)) {