Mesa (master): radv: Fix WSI & PCI bus info initialization order.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 19 12:43:17 UTC 2018


Module: Mesa
Branch: master
Commit: 68c7833540fabea3d7af8eb470522e6403354e20
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=68c7833540fabea3d7af8eb470522e6403354e20

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Fri Oct 19 11:51:47 2018 +0200

radv: Fix WSI & PCI bus info initialization order.

Trying to access the bus info before it is initialized is not going
to work.

Fixes: baa38c144f6 "vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108491
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Tested-by: Andre Heider <a.heider at gmail.com>

---

 src/amd/vulkan/radv_device.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index e7d511bdb9..cf1132098d 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -379,6 +379,15 @@ radv_physical_device_init(struct radv_physical_device *device,
 	radv_physical_device_init_mem_types(device);
 	radv_fill_device_extension_table(device, &device->supported_extensions);
 
+	device->bus_info = *drm_device->businfo.pci;
+
+	if ((device->instance->debug_flags & RADV_DEBUG_INFO))
+		ac_print_gpu_info(&device->rad_info);
+
+	/* The WSI is structured as a layer on top of the driver, so this has
+	 * to be the last part of initialization (at least until we get other
+	 * semi-layers).
+	 */
 	result = radv_init_wsi(device);
 	if (result != VK_SUCCESS) {
 		device->ws->destroy(device->ws);
@@ -386,10 +395,6 @@ radv_physical_device_init(struct radv_physical_device *device,
 		goto fail;
 	}
 
-	if ((device->instance->debug_flags & RADV_DEBUG_INFO))
-		ac_print_gpu_info(&device->rad_info);
-
-	device->bus_info = *drm_device->businfo.pci;
 	return VK_SUCCESS;
 
 fail:




More information about the mesa-commit mailing list