diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/allocator.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/render/allocator.c b/render/allocator.c index 1c076bfd..46d7b2de 100644 --- a/render/allocator.c +++ b/render/allocator.c @@ -18,11 +18,11 @@ void wlr_allocator_init(struct wlr_allocator *alloc, wl_signal_init(&alloc->events.destroy); } -struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend, - struct wlr_renderer *renderer) { +struct wlr_allocator *allocator_autocreate_with_drm_fd( + struct wlr_backend *backend, struct wlr_renderer *renderer, + int drm_fd) { uint32_t backend_caps = backend_get_buffer_caps(backend); uint32_t renderer_caps = renderer_get_render_buffer_caps(renderer); - int drm_fd = wlr_backend_get_drm_fd(backend); struct wlr_allocator *alloc = NULL; uint32_t gbm_caps = WLR_BUFFER_CAP_DMABUF; @@ -51,6 +51,13 @@ struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend, return NULL; } +struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend, + struct wlr_renderer *renderer) { + // Note, drm_fd may be negative if unavailable + int drm_fd = wlr_backend_get_drm_fd(backend); + return allocator_autocreate_with_drm_fd(backend, renderer, drm_fd); +} + void wlr_allocator_destroy(struct wlr_allocator *alloc) { if (alloc == NULL) { return; |