Linux WSI checks the WS availability on create
authorTony Zlatinski <tzlatinski@nvidia.com>
Tue, 16 Jun 2020 13:04:08 +0000 (08:04 -0500)
committerTony Zlatinski <tzlatinski@nvidia.com>
Thu, 18 Jun 2020 15:22:34 +0000 (10:22 -0500)
Before creating a display of a specific WSI type,
check for the server availability, first. If the display server of
the requested WSI type (XLIB/XCB/WAYLAND) is not present/running,
then when throw an exception of type NotSupportedError
rather than one of type ResourceError.

This would allow for the tests to be marked as unsupported,
rather than causing the CTS to crash/exit.

Affects: dEQP-VK.wsi.wayland.*
         dEQP-VK.wsi.xcb.*
         dEQP-VK.wsi.xlib.*
         dEQP-VK.image.swapchain*

Components: Vulkan, WSI, Linux platform

VK-GL-CTS issue: 2422

Change-Id: I7538be79e528ed9cde38cff3404b5f3603bdf5c1

framework/platform/lnx/tcuLnxVulkanPlatform.cpp

index b933dad..6f0e554 100644 (file)
@@ -209,6 +209,11 @@ VulkanPlatform::VulkanPlatform (EventState& eventState)
 
 vk::wsi::Display* VulkanPlatform::createWsiDisplay (vk::wsi::Type wsiType) const
 {
+       if (!hasDisplay(wsiType))
+       {
+           throw NotSupportedError("This display type is not available: ", NULL, __FILE__, __LINE__);
+       }
+
        switch(wsiType)
        {
 #if defined (DEQP_SUPPORT_X11)