Revert "Implement Vulkan API for reading the display's size"
This reverts commit 3fa9877324791bdeb56bcf3d4e0cb8a57ec2e0e7.
That change caused a regression. See MA-230.
Change-Id: I2c42c0e9d0f1d0eaed091907dff1863f22ff96c8
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 59d7286..12be23b 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 98e7090..521a34b 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 80d638e..1fb85f0ab 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 f0c583b..780c704 100644
--- a/src/vulkan/wsi/wsi_common_magma.cc
+++ b/src/vulkan/wsi/wsi_common_magma.cc
@@ -343,11 +343,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;