aboutsummaryrefslogtreecommitdiff
path: root/render/allocator/allocator.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-11-24 10:33:13 +0100
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-11-25 15:12:32 +0000
commite4f748c6e9d618eb2ee8f15aa22aae8dcde4cc4a (patch)
treef0f710b1afbcecaeaebfea38105a6a5bbcb50431 /render/allocator/allocator.c
parentbf578255606d2bcc9d283c3a5042deddf29c52b5 (diff)
render/allocator: fallback to renderer DRM FD in autocreate
If the backend doesn't have a DRM FD, fallback to the renderer's. This accomodates for the situation where the headless backend hasn't picked a DRM FD in particular, but the renderer has picked one.
Diffstat (limited to 'render/allocator/allocator.c')
-rw-r--r--render/allocator/allocator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c
index 15d55a0d..5108ad04 100644
--- a/render/allocator/allocator.c
+++ b/render/allocator/allocator.c
@@ -139,6 +139,9 @@ 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);
+ if (drm_fd < 0) {
+ drm_fd = wlr_renderer_get_drm_fd(renderer);
+ }
return allocator_autocreate_with_drm_fd(backend, renderer, drm_fd);
}