radv: Move wsi initialization later in physical_device_init
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 18 Nov 2017 23:30:34 +0000 (15:30 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 18:04:19 +0000 (10:04 -0800)
We need it to happen after memory type setup so that we can query memory
types in wsi_device_init.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/amd/vulkan/radv_device.c

index 07c639755b4dd7e5e8a0dc7421f82497b2ba048a..f4320275b356a53521fa287c10a639b729836caf 100644 (file)
@@ -214,16 +214,10 @@ radv_physical_device_init(struct radv_physical_device *device,
 
        device->local_fd = fd;
        device->ws->query_info(device->ws, &device->rad_info);
-       result = radv_init_wsi(device);
-       if (result != VK_SUCCESS) {
-               device->ws->destroy(device->ws);
-               goto fail;
-       }
 
        device->name = get_chip_name(device->rad_info.family);
 
        if (radv_device_get_cache_uuid(device->rad_info.family, device->cache_uuid)) {
-               radv_finish_wsi(device);
                device->ws->destroy(device->ws);
                result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
                                   "cannot generate UUID");
@@ -259,6 +253,13 @@ radv_physical_device_init(struct radv_physical_device *device,
        device->has_clear_state = device->rad_info.chip_class >= CIK;
 
        radv_physical_device_init_mem_types(device);
+
+       result = radv_init_wsi(device);
+       if (result != VK_SUCCESS) {
+               device->ws->destroy(device->ws);
+               goto fail;
+       }
+
        return VK_SUCCESS;
 
 fail: