mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
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.
This commit is contained in:
parent
bf57825560
commit
e4f748c6e9
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue