aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan/renderer.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-02-27 16:49:43 +0100
committerSimon Zeni <simon@bl4ckb0ne.ca>2023-02-28 14:25:21 +0000
commit40117e1e0df79aaffd307a238fb973f0bf1edf78 (patch)
tree6e70a75c9c02bd2fc5d443e219e6d0990e3e03b2 /render/vulkan/renderer.c
parent8db0d8289087d9e63438e01f810ef01d82170eb1 (diff)
render/vulkan: prefer render node for wlr_renderer_get_drm_fd()
Instead of returning a primary node from wlr_renderer_get_drm_fd(), prefer to return a render node if any.
Diffstat (limited to 'render/vulkan/renderer.c')
-rw-r--r--render/vulkan/renderer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c
index 4e326c69..667301f9 100644
--- a/render/vulkan/renderer.c
+++ b/render/vulkan/renderer.c
@@ -2240,10 +2240,10 @@ struct wlr_renderer *wlr_vk_renderer_create_with_drm_fd(int drm_fd) {
return NULL;
}
- // We duplicate it so it's not closed while we still need it.
- dev->drm_fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 0);
+ // Do not use the drm_fd that was passed in: we should prefer the render
+ // node even if a primary node was provided
+ dev->drm_fd = vulkan_open_phdev_drm_fd(phdev);
if (dev->drm_fd < 0) {
- wlr_log_errno(WLR_ERROR, "fcntl(F_DUPFD_CLOEXEC) failed");
vulkan_device_destroy(dev);
vulkan_instance_destroy(ini);
return NULL;