Choose optimal tiling with dmabuf in synchronization tests.
authorTapani Pälli <tapani.palli@intel.com>
Wed, 5 Oct 2022 16:59:48 +0000 (19:59 +0300)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 27 Oct 2022 17:10:24 +0000 (17:10 +0000)
This is revert of commit 55027ea63. Problem is that while that change
caused coverage to raise on some drivers it decreased coverage on
others. Ideally this will be written in more dynamic way as a
follow-up work so that everyone could have coverage with these
tests.

Component: Vulkan

Affects: dEQP-VK.synchronization.cross_instance*

VK-GL-CTS issue: 2887

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Change-Id: I252c87ccd1870067417166bf1a4ba769a153105f

external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp

index f5a13d4..71f27ab 100644 (file)
@@ -87,15 +87,6 @@ struct TestConfig
        const bool                                                                                      dedicated;
 };
 
-// A helper function to choose tiling type for cross instance sharing tests.
-// On Linux, DMABUF requires VK_EXT_image_drm_format_modifier support when
-// VK_IMAGE_TILING_OPTIMAL is used, therefore we choose to use linear with these tests.
-vk::VkImageTiling chooseTiling(VkExternalMemoryHandleTypeFlagBits memoryHandleType)
-{
-       // Choose tiling depending on memory handle type
-       return memoryHandleType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT ? vk::VK_IMAGE_TILING_LINEAR : vk::VK_IMAGE_TILING_OPTIMAL;
-}
-
 // A helper class to test for extensions upfront and throw not supported to speed up test runtimes compared to failing only
 // after creating unnecessary vkInstances.  A common example of this is win32 platforms taking a long time to run _fd tests.
 class NotSupportedChecker
@@ -167,7 +158,7 @@ public:
                                &externalInfo,
                                config.resource.imageFormat,
                                config.resource.imageType,
-                               chooseTiling(config.memoryHandleType),
+                               vk::VK_IMAGE_TILING_OPTIMAL,
                                readOp.getInResourceUsageFlags() | writeOp.getOutResourceUsageFlags(),
                                0u
                        };
@@ -679,7 +670,7 @@ Move<VkImage> createImage(const vk::DeviceInterface&                                vkd,
                1u,
                1u,
                resourceDesc.imageSamples,
-               chooseTiling(externalType),
+               vk::VK_IMAGE_TILING_OPTIMAL,
                readOp.getInResourceUsageFlags() | writeOp.getOutResourceUsageFlags(),
                vk::VK_SHARING_MODE_EXCLUSIVE,
 
@@ -794,7 +785,7 @@ de::MovePtr<Resource> importResource (const vk::DeviceInterface&                            vkd,
                        DE_NULL,
                        (vk::VkExternalMemoryHandleTypeFlags)externalType
                };
-               const vk::VkImageTiling                         tiling                                  = chooseTiling(externalType);
+               const vk::VkImageTiling                         tiling                                  = vk::VK_IMAGE_TILING_OPTIMAL;
                const vk::VkImageCreateInfo                     createInfo                              =
                {
                        vk::VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
@@ -1080,7 +1071,7 @@ tcu::TestStatus SharingTestInstance::iterate (void)
 
                        vk::Move<vk::VkImage>                   image                                   = createImage(m_vkdA, *m_deviceA, resourceDesc, extent, m_queueFamilyIndicesA,
                                                                                                                                                                  *m_supportReadOp, *m_supportWriteOp, m_memoryHandleType);
-                       const vk::VkImageTiling                 tiling                                  = chooseTiling(m_memoryHandleType);
+                       const vk::VkImageTiling                 tiling                                  = vk::VK_IMAGE_TILING_OPTIMAL;
                        const vk::VkMemoryRequirements  requirements                    = getMemoryRequirements(m_vkdA, *m_deviceA, *image, m_config.dedicated, m_getMemReq2Supported);
                                                                                        exportedMemoryTypeIndex = chooseMemoryType(requirements.memoryTypeBits);
                        vk::Move<vk::VkDeviceMemory>    memory                                  = allocateExportableMemory(m_vkdA, *m_deviceA, requirements.size, exportedMemoryTypeIndex, m_memoryHandleType, m_config.dedicated ? *image : (vk::VkImage)0);