Revert "Implement Vulkan API for reading the display's size"

This reverts commit 8afbfd8cc23f6d6253f70727ecbc6aba4027c3d2.

Reverting this change because it causes vkCreateMagmaSurfaceKHR() to
fail if vkEnumeratePhysicalDevices() hasn't first been called on the
given VkInstance.  That causes the Waterfall demo to fail.

MA-250

Change-Id: I6a57c7254ffb223fd8b8ac5520c55a6bd3d72dc7
diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h
index a06e7c8..f06610b 100644
--- a/include/vulkan/vk_icd.h
+++ b/include/vulkan/vk_icd.h
@@ -86,7 +86,6 @@
 #ifdef VK_USE_PLATFORM_MAGMA_KHR
 typedef struct _VkIcdSurfaceMagma {
    VkIcdSurfaceBase base;
-   VkExtent2D       display_size;
 } VkIcdSurfaceMagma;
 #endif // VK_USE_PLATFORM_MAGMA_KHR
 
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 911f096..bb96c76 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -67,7 +67,6 @@
    fd = open(path, O_RDONLY);
    if (fd < 0)
       return vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
-   device->device_fd = fd;
 
    device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
    device->instance = instance;
@@ -187,6 +186,7 @@
    /* XXX: Actually detect bit6 swizzling */
    isl_device_init(&device->isl_dev, &device->info, swizzled);
 
+   close(fd);
    return VK_SUCCESS;
 
 fail:
@@ -199,8 +199,6 @@
 {
    anv_finish_wsi(device);
    ralloc_free(device->compiler);
-   int result = close(device->device_fd);
-   assert(result == 0);
 }
 
 static const VkExtensionProperties global_extensions[] = {
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index bd9965c..173dcf3 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -493,7 +493,6 @@
     struct anv_instance *                       instance;
     uint32_t                                    chipset_id;
     char                                        path[64];
-    int                                         device_fd;
     const char *                                name;
     struct gen_device_info                      info;
     uint64_t                                    aperture_size;
diff --git a/src/intel/vulkan/anv_wsi_magma.cc b/src/intel/vulkan/anv_wsi_magma.cc
index 8aa4bae..bef5467 100644
--- a/src/intel/vulkan/anv_wsi_magma.cc
+++ b/src/intel/vulkan/anv_wsi_magma.cc
@@ -26,10 +26,6 @@
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_MAGMA_SURFACE_CREATE_INFO_KHR);
 
-   magma_display_size display_size;
-   if (magma_display_get_size(instance->physicalDevice.device_fd, &display_size) != MAGMA_STATUS_OK)
-      return VK_ERROR_INITIALIZATION_FAILED;
-
    if (!pAllocator)
       pAllocator = &instance->alloc;
 
@@ -39,8 +35,6 @@
       return VK_ERROR_OUT_OF_HOST_MEMORY;
 
    surface->base.platform = VK_ICD_WSI_PLATFORM_MAGMA;
-   surface->display_size.width = display_size.width;
-   surface->display_size.height = display_size.height;
 
    *pSurface = _VkIcdSurfaceBase_to_handle(&surface->base);
 
diff --git a/src/vulkan/wsi/wsi_common_magma.cc b/src/vulkan/wsi/wsi_common_magma.cc
index bfd1fb1..a22f28a 100644
--- a/src/vulkan/wsi/wsi_common_magma.cc
+++ b/src/vulkan/wsi/wsi_common_magma.cc
@@ -333,11 +333,11 @@
 {
    DLOG("magma_surface_get_capabilities");
 
-   auto* magma_surface = reinterpret_cast<VkIcdSurfaceMagma*>(icd_surface);
+   VkExtent2D any_extent = {0xFFFFFFFF, 0xFFFFFFFF};
 
    caps->minImageExtent = {1, 1};
-   caps->maxImageExtent = magma_surface->display_size;
-   caps->currentExtent = magma_surface->display_size;
+   caps->maxImageExtent = any_extent;
+   caps->currentExtent = any_extent;
 
    caps->supportedCompositeAlpha =
        VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR | VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;