vulkan/vk_device: Add a drm_fd field
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 18 Oct 2021 21:24:03 +0000 (16:24 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 16 Nov 2021 16:02:08 +0000 (10:02 -0600)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>

src/vulkan/runtime/vk_device.c
src/vulkan/runtime/vk_device.h

index 13d674e..a39c569 100644 (file)
@@ -93,6 +93,8 @@ vk_device_init(struct vk_device *device,
 
    list_inithead(&device->queues);
 
+   device->drm_fd = -1;
+
 #ifdef ANDROID
    mtx_init(&device->swapchain_private_mtx, mtx_plain);
    device->swapchain_private = NULL;
index d716c4d..14426ab 100644 (file)
@@ -65,6 +65,9 @@ struct vk_device {
     */
    VkResult (*check_status)(struct vk_device *device);
 
+   /* Set by vk_device_set_drm_fd() */
+   int drm_fd;
+
 #ifdef ANDROID
    mtx_t swapchain_private_mtx;
    struct hash_table *swapchain_private;
@@ -81,6 +84,12 @@ vk_device_init(struct vk_device *device,
                const VkDeviceCreateInfo *pCreateInfo,
                const VkAllocationCallbacks *alloc);
 
+static inline void
+vk_device_set_drm_fd(struct vk_device *device, int drm_fd)
+{
+   device->drm_fd = drm_fd;
+}
+
 void
 vk_device_finish(struct vk_device *device);