summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_device.c5
-rw-r--r--src/amd/vulkan/radv_private.h1
-rw-r--r--src/amd/vulkan/radv_wsi.c2
-rw-r--r--src/amd/vulkan/radv_wsi_x11.c8
4 files changed, 12 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 7900ece9c89..3d0e74273e4 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -225,6 +225,8 @@ radv_physical_device_init(struct radv_physical_device *device,
result = VK_ERROR_INCOMPATIBLE_DRIVER;
goto fail;
}
+
+ device->local_fd = fd;
device->ws->query_info(device->ws, &device->rad_info);
result = radv_init_wsi(device);
if (result != VK_SUCCESS) {
@@ -249,7 +251,7 @@ radv_physical_device_init(struct radv_physical_device *device,
fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
device->name = device->rad_info.name;
- close(fd);
+
return VK_SUCCESS;
fail:
@@ -263,6 +265,7 @@ radv_physical_device_finish(struct radv_physical_device *device)
radv_extensions_finish(device->instance, &device->extensions);
radv_finish_wsi(device);
device->ws->destroy(device->ws);
+ close(device->local_fd);
}
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index ac21b075c2c..5fabc409d82 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -280,6 +280,7 @@ struct radv_physical_device {
const char * name;
uint8_t uuid[VK_UUID_SIZE];
+ int local_fd;
struct wsi_device wsi_device;
struct radv_extensions extensions;
};
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index 9c9e1bb0a8d..ea8e7849722 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -92,7 +92,7 @@ VkResult radv_GetPhysicalDeviceSurfaceSupportKHR(
return iface->get_support(surface, &device->wsi_device,
&device->instance->alloc,
- queueFamilyIndex, pSupported);
+ queueFamilyIndex, device->local_fd, pSupported);
}
VkResult radv_GetPhysicalDeviceSurfaceCapabilitiesKHR(
diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c
index 946b99095ac..97d4277c490 100644
--- a/src/amd/vulkan/radv_wsi_x11.c
+++ b/src/amd/vulkan/radv_wsi_x11.c
@@ -45,7 +45,9 @@ VkBool32 radv_GetPhysicalDeviceXcbPresentationSupportKHR(
return wsi_get_physical_device_xcb_presentation_support(
&device->wsi_device,
&device->instance->alloc,
- queueFamilyIndex, connection, visual_id);
+ queueFamilyIndex,
+ device->local_fd,
+ connection, visual_id);
}
VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR(
@@ -59,7 +61,9 @@ VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR(
return wsi_get_physical_device_xcb_presentation_support(
&device->wsi_device,
&device->instance->alloc,
- queueFamilyIndex, XGetXCBConnection(dpy), visualID);
+ queueFamilyIndex,
+ device->local_fd,
+ XGetXCBConnection(dpy), visualID);
}
VkResult radv_CreateXcbSurfaceKHR(