Do not fail plane tests when there is no display
authorLiam Middlebrook <lmiddlebrook@nvidia.com>
Thu, 26 Apr 2018 21:43:25 +0000 (14:43 -0700)
committerLiam Middlebrook <lmiddlebrook@nvidia.com>
Thu, 26 Apr 2018 21:43:25 +0000 (14:43 -0700)
Instead, we should mark these tests as not supported. The Vulkan spec
states that:
    Devices must support at least one plane on each display

If there are no displays connected, the driver is allowed to return 0
planes.

VK-GL-CTS issue: 1138

Change-Id: Ie7ddc35f4f11fbfa54f8c31cc3864f52adb1bb7f
Affects: dEQP-VK.wsi.display.get_display_plane_capabilities
Affects: dEQP-VK.wsi.display.create_display_plane_surface

external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTests.cpp

index 2d3f253..21bfa12 100644 (file)
@@ -1037,7 +1037,20 @@ tcu::TestStatus  DisplayCoverageTestInstance::testGetDisplayPlaneCapabilitiesKHR(
                TCU_FAIL_STR(string("Expected VK_SUCCESS. Have ") + getResultAsString(result));
 
        if (planeCountReported == 0)
+       {
+               DisplayVector   displaysVector;
+
+               // If we don't have any displays then it's alright to have no planes, as
+               // per the Vulkan Spec:
+               //              Devices must support at least one plane on each display
+               if (!getDisplays(displaysVector))
+                       TCU_FAIL("Failed to retrieve displays");
+
+               if (displaysVector.empty())
+                       TCU_THROW(NotSupportedError, "No display planes reported");
+
                TCU_FAIL("No planes defined");
+       }
 
        if (planeCountReported > MAX_TESTED_PLANE_COUNT)
        {
@@ -1175,6 +1188,13 @@ tcu::TestStatus  DisplayCoverageTestInstance::testCreateDisplayPlaneSurfaceKHR(vo
        DisplayVector                                                           displaysVector;
        VkResult                                                                        result;
 
+       // Get displays
+       if (!getDisplays(displaysVector))
+               TCU_FAIL("Failed to retrieve displays");
+
+       if (displaysVector.empty())
+               TCU_THROW(NotSupportedError, "No displays reported");
+
        // Get planes
        result = m_vki.getPhysicalDeviceDisplayPlanePropertiesKHR(      m_physicalDevice,               // VkPhysicalDevice                             physicalDevice
                                                                                                                                &planeCountReported,    // uint32_t*                                    pPropertyCount
@@ -1211,13 +1231,6 @@ tcu::TestStatus  DisplayCoverageTestInstance::testCreateDisplayPlaneSurfaceKHR(vo
                TCU_FAIL_STR(   string("Number of planes requested (") + de::toString(planeCountTested) +
                                                ") does not match retrieved (" + de::toString(planeCountRetrieved) + ")");
 
-       // Get displays
-       if (!getDisplays(displaysVector))
-               TCU_FAIL("Failed to retrieve displays");
-
-       if (displaysVector.empty())
-               TCU_THROW(NotSupportedError, "No displays reported");
-
        // Iterate through displays-modes
        for (DisplayVector::iterator    it =  displaysVector.begin();
                                                                        it != displaysVector.end();