From 187d7e44307cb8efe8281b12b74d70e4c3893cc9 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 19 Jul 2020 22:13:18 +0300 Subject: [PATCH] Test imported signaled sync fd New tests: dEQP-VK.api.external.fence.sync_fd.import_signaled_temporary Components: Vulkan Change-Id: Ifb79338443d09596494c30d3d1527f79ac39e1b4 --- android/cts/master/vk-master-2020-03-01.txt | 1 + android/cts/master/vk-master.txt | 1 + .../vulkan/api/vktApiExternalMemoryTests.cpp | 30 ++++++++++++++++++++++ external/vulkancts/mustpass/master/vk-default.txt | 1 + 4 files changed, 33 insertions(+) diff --git a/android/cts/master/vk-master-2020-03-01.txt b/android/cts/master/vk-master-2020-03-01.txt index b64e1bf..8cc0cc0 100644 --- a/android/cts/master/vk-master-2020-03-01.txt +++ b/android/cts/master/vk-master-2020-03-01.txt @@ -56077,6 +56077,7 @@ dEQP-VK.api.external.memory.dma_buf.dedicated.image.info dEQP-VK.api.external.memory.dma_buf.dedicated.image.bind_export_import_bind dEQP-VK.api.external.memory.dma_buf.dedicated.image.export_bind_import_bind dEQP-VK.api.external.memory.dma_buf.dedicated.image.export_import_bind_bind +dEQP-VK.api.external.fence.sync_fd.import_signaled_temporary dEQP-VK.api.pipeline.pipeline_layout.lifetime.destroy_after_end dEQP-VK.api.tooling_info.validate_getter dEQP-VK.api.tooling_info.validate_tools_properties diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index a865bc5..90bc87a 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -143907,6 +143907,7 @@ dEQP-VK.api.external.fence.sync_fd.signal_export_import_wait_temporary dEQP-VK.api.external.fence.sync_fd.signal_import_temporary dEQP-VK.api.external.fence.sync_fd.reset_temporary dEQP-VK.api.external.fence.sync_fd.transference_temporary +dEQP-VK.api.external.fence.sync_fd.import_signaled_temporary dEQP-VK.api.external.fence.sync_fd.export_multiple_times_temporary dEQP-VK.api.external.fence.sync_fd.dup_temporary dEQP-VK.api.external.fence.sync_fd.dup2_temporary diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index ee0ea77..a3e210d 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -1934,6 +1934,31 @@ tcu::TestStatus testFenceSignalExportImportWait (Context& context, } } +tcu::TestStatus testFenceImportSyncFdSignaled (Context& context, + const FenceTestConfig config) +{ + const vk::PlatformInterface& vkp (context.getPlatformInterface()); + const CustomInstance instance (createTestInstance(context, 0u, 0u, config.externalType)); + const vk::InstanceDriver& vki (instance.getDriver()); + const vk::VkPhysicalDevice physicalDevice (vk::chooseDevice(vki, instance, context.getTestContext().getCommandLine())); + const deUint32 queueFamilyIndex (chooseQueueFamilyIndex(vki, physicalDevice, 0u)); + const vk::VkFenceImportFlags flags = config.permanence == PERMANENCE_TEMPORARY ? vk::VK_FENCE_IMPORT_TEMPORARY_BIT : (vk::VkFenceImportFlagBits)0u; + + checkFenceSupport(vki, physicalDevice, config.externalType); + + { + const vk::Unique device (createTestDevice(context, vkp, instance, vki, physicalDevice, 0u, 0u, config.externalType, queueFamilyIndex)); + const vk::DeviceDriver vkd (vkp, instance, *device); + NativeHandle handle = -1; + const vk::Unique fence (createAndImportFence(vkd, *device, config.externalType, handle, flags)); + + if (vkd.waitForFences(*device, 1u, &*fence, VK_TRUE, 0) != vk::VK_SUCCESS) + return tcu::TestStatus::pass("Imported -1 sync fd isn't signaled"); + + return tcu::TestStatus::pass("Pass"); + } +} + tcu::TestStatus testFenceExportSignalImportWait (Context& context, const FenceTestConfig config) { @@ -3892,6 +3917,11 @@ de::MovePtr createFenceTests (tcu::TestContext& testCtx, vk: addFunctionCase(fenceGroup.get(), std::string("reset_") + permanenceName, "Test resetting the fence.", testFenceReset, config); addFunctionCase(fenceGroup.get(), std::string("transference_") + permanenceName, "Test fences transference.", testFenceTransference, config); + if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT) + { + addFunctionCase(fenceGroup.get(), std::string("import_signaled_") + permanenceName, "Test import signaled fence fd.", testFenceImportSyncFdSignaled, config); + } + if (externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT || externalType == vk::VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT) { diff --git a/external/vulkancts/mustpass/master/vk-default.txt b/external/vulkancts/mustpass/master/vk-default.txt index e38f2a6..ea2b2f2 100644 --- a/external/vulkancts/mustpass/master/vk-default.txt +++ b/external/vulkancts/mustpass/master/vk-default.txt @@ -143906,6 +143906,7 @@ dEQP-VK.api.external.fence.sync_fd.signal_export_import_wait_temporary dEQP-VK.api.external.fence.sync_fd.signal_import_temporary dEQP-VK.api.external.fence.sync_fd.reset_temporary dEQP-VK.api.external.fence.sync_fd.transference_temporary +dEQP-VK.api.external.fence.sync_fd.import_signaled_temporary dEQP-VK.api.external.fence.sync_fd.export_multiple_times_temporary dEQP-VK.api.external.fence.sync_fd.dup_temporary dEQP-VK.api.external.fence.sync_fd.dup2_temporary -- 2.7.4