external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDescriptorPoolTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDescriptorSetTests.cpp \
+ external/vulkancts/modules/vulkan/api/vktApiDeviceDrmPropertiesTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiDriverPropertiesTests.cpp \
external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp \
dEQP-VK.api.info.image_format_properties2.2d.linear.g10x6_b10x6r10x6_2plane_444_unorm_3pack16_ext
dEQP-VK.api.info.image_format_properties2.2d.linear.g12x4_b12x4r12x4_2plane_444_unorm_3pack16_ext
dEQP-VK.api.info.image_format_properties2.2d.linear.g16_b16r16_2plane_444_unorm_ext
+dEQP-VK.api.device_drm_properties.drm_files_exist
dEQP-VK.api.device_init.enumerate_devices_alloc_leak
dEQP-VK.api.device_init.create_device_global_priority
dEQP-VK.api.device_init.create_device_global_priority_query
dEQP-VK.api.info.android.mandatory_extensions
dEQP-VK.api.info.android.no_unknown_extensions
dEQP-VK.api.info.android.no_layers
+dEQP-VK.api.device_drm_properties.drm_files_exist
dEQP-VK.api.device_init.create_instance_name_version
dEQP-VK.api.device_init.create_instance_invalid_api_version
dEQP-VK.api.device_init.create_instance_null_appinfo
#define VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NV_device_generated_commands"
#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles"
#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties"
-#define DECL_EXT_DRM_EXTENSION_NAME "core_property"
+#define VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME "VK_EXT_physical_device_drm"
#define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host"
#define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls"
#define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map"
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION, 39}; }
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceDiscardRectanglePropertiesEXT>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION, 38}; }
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceDriverProperties>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION, 37}; }
-template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceDrmPropertiesEXT>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT, DECL_EXT_DRM_EXTENSION_NAME, 0, 36}; }
+template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceDrmPropertiesEXT>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT, VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION, 36}; }
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceExternalMemoryHostPropertiesEXT>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION, 35}; }
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceFloatControlsProperties>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION, 34}; }
template<> PropertyDesc makePropertyDesc<VkPhysicalDeviceFragmentDensityMapPropertiesEXT>(void) { return PropertyDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION, 33}; }
{ createPropertyStructWrapper<VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV>, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION },
{ createPropertyStructWrapper<VkPhysicalDeviceDiscardRectanglePropertiesEXT>, VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION },
{ createPropertyStructWrapper<VkPhysicalDeviceDriverProperties>, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION },
- { createPropertyStructWrapper<VkPhysicalDeviceDrmPropertiesEXT>, DECL_EXT_DRM_EXTENSION_NAME, 0 },
+ { createPropertyStructWrapper<VkPhysicalDeviceDrmPropertiesEXT>, VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION },
{ createPropertyStructWrapper<VkPhysicalDeviceExternalMemoryHostPropertiesEXT>, VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION },
{ createPropertyStructWrapper<VkPhysicalDeviceFloatControlsProperties>, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME, VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION },
{ createPropertyStructWrapper<VkPhysicalDeviceFragmentDensityMapPropertiesEXT>, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME, VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION },
vktApiTests.hpp
vktApiSmokeTests.cpp
vktApiSmokeTests.hpp
+ vktApiDeviceDrmPropertiesTests.cpp
+ vktApiDeviceDrmPropertiesTests.hpp
vktApiDeviceInitializationTests.cpp
vktApiDeviceInitializationTests.hpp
vktApiDriverPropertiesTests.cpp
--- /dev/null
+/*-------------------------------------------------------------------------
+* Vulkan Conformance Tests
+* ------------------------
+*
+* Copyright (c) 2021 NVIDIA, Inc.
+* Copyright (c) 2021 The Khronos Group Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*//*!
+* \file
+* \brief VK_EXT_device_drm_properties tests
+*//*--------------------------------------------------------------------*/
+
+#include "vktApiDeviceDrmPropertiesTests.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktTestCaseUtil.hpp"
+#include "deFilePath.hpp"
+#include "deDirectoryIterator.hpp"
+#include "deDynamicLibrary.hpp"
+#if DEQP_SUPPORT_DRM
+#include <sys/sysmacros.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <xf86drm.h>
+#endif
+
+using namespace vk;
+
+namespace vkt
+{
+namespace api
+{
+namespace
+{
+
+enum TestType
+{
+ TEST_FILES_EXIST = 0,
+};
+
+void checkSupport (Context& context, const TestType config)
+{
+ DE_UNREF(config);
+ context.requireDeviceFunctionality("VK_EXT_physical_device_drm");
+}
+
+#if DEQP_SUPPORT_DRM
+class LibDrm : protected de::DynamicLibrary
+{
+ static const char* libDrmFiles[];
+
+ typedef int (*PFNDRMGETDEVICES2PROC)(deUint32, drmDevicePtr[], int);
+ typedef int (*PFNDRMGETDEVICESPROC)(drmDevicePtr[], int);
+ typedef void (*PFNDRMFREEDEVICESPROC)(drmDevicePtr[], int);
+ PFNDRMGETDEVICES2PROC pGetDevices2;
+ PFNDRMGETDEVICESPROC pGetDevices;
+ PFNDRMFREEDEVICESPROC pFreeDevices;
+
+ int intGetDevices(drmDevicePtr devices[], int maxDevices) const
+ {
+ if (pGetDevices2)
+ return pGetDevices2(0, devices, maxDevices);
+ else
+ return pGetDevices(devices, maxDevices);
+ }
+
+public:
+ LibDrm() : DynamicLibrary(libDrmFiles) {
+ pGetDevices2 = (PFNDRMGETDEVICES2PROC)getFunction("drmGetDevices2");
+ pGetDevices = (PFNDRMGETDEVICESPROC)getFunction("drmGetDevices");
+ pFreeDevices = (PFNDRMFREEDEVICESPROC)getFunction("drmFreeDevices");
+
+ if (!pGetDevices2 && !pGetDevices)
+ TCU_FAIL("Could not load a valid drmGetDevices() variant from libdrm");
+
+ if (!pFreeDevices)
+ TCU_FAIL("Could not load drmFreeDevices() from libdrm");
+ }
+
+ drmDevicePtr *getDevices(int *pNumDevices) const
+ {
+ *pNumDevices = intGetDevices(DE_NULL, 0);
+
+ if (*pNumDevices < 0)
+ TCU_FAIL("Failed to query number of DRM devices in system");
+
+ if (*pNumDevices == 0)
+ return DE_NULL;
+
+ drmDevicePtr *devs = new drmDevicePtr[*pNumDevices];
+
+ *pNumDevices = intGetDevices(devs, *pNumDevices);
+
+ if (*pNumDevices < 0)
+ {
+ delete[] devs;
+ TCU_FAIL("Failed to query list of DRM devices in system");
+ }
+
+ return devs;
+ }
+
+ void freeDevices(drmDevicePtr *devices, int count) const
+ {
+ pFreeDevices(devices, count);
+ delete[] devices;
+ }
+
+ ~LibDrm() { }
+};
+
+const char* LibDrm::libDrmFiles[] =
+{
+ "libdrm.so.2",
+ "libdrm.so",
+ DE_NULL
+};
+#endif // DEQP_SUPPORT_DRM
+
+void testFilesExist (const VkPhysicalDeviceDrmPropertiesEXT& deviceDrmProperties)
+{
+ bool primaryFound = !deviceDrmProperties.hasPrimary;
+ bool renderFound = !deviceDrmProperties.hasRender;
+
+#if DEQP_SUPPORT_DRM
+ static const LibDrm libDrm;
+
+ int numDrmDevices;
+ drmDevicePtr* drmDevices = libDrm.getDevices(&numDrmDevices);
+
+ for (int i = 0; i < numDrmDevices; i++)
+ {
+ for (int j = 0; j < DRM_NODE_MAX; j++)
+ {
+ if (!(drmDevices[i]->available_nodes & (1 << j)))
+ continue;
+
+ struct stat statBuf;
+ deMemset(&statBuf, 0, sizeof(statBuf));
+ int res = stat(drmDevices[i]->nodes[j], &statBuf);
+
+ if (res || !(statBuf.st_mode & S_IFCHR))
+ continue;
+
+ if (deviceDrmProperties.primaryMajor == major(statBuf.st_rdev) &&
+ deviceDrmProperties.primaryMinor == minor(statBuf.st_rdev))
+ {
+ primaryFound = true;
+ continue;
+ }
+
+ if (deviceDrmProperties.renderMajor == major(statBuf.st_rdev) &&
+ deviceDrmProperties.renderMinor == minor(statBuf.st_rdev))
+ {
+ renderFound = true;
+ continue;
+ }
+ }
+ }
+
+ libDrm.freeDevices(drmDevices, numDrmDevices);
+#endif // DEQP_SUPPORT_DRM
+
+ if (!primaryFound)
+ TCU_FAIL("DRM primary device file not found");
+
+ if (!renderFound)
+ TCU_FAIL("DRM render device file not found");
+}
+
+static tcu::TestStatus testDeviceDrmProperties (Context& context, const TestType testType)
+{
+
+ const VkPhysicalDevice physDevice = context.getPhysicalDevice();
+ VkPhysicalDeviceProperties2 deviceProperties2;
+ const int memsetPattern = 0xaa;
+ VkPhysicalDeviceDrmPropertiesEXT deviceDrmProperties;
+
+ deMemset(&deviceDrmProperties, 0, sizeof(deviceDrmProperties));
+ deviceDrmProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT;
+ deviceDrmProperties.pNext = DE_NULL;
+
+ deMemset(&deviceProperties2, memsetPattern, sizeof(deviceProperties2));
+ deviceProperties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+ deviceProperties2.pNext = &deviceDrmProperties;
+
+ context.getInstanceInterface().getPhysicalDeviceProperties2(physDevice, &deviceProperties2);
+
+ switch (testType)
+ {
+ case TEST_FILES_EXIST: testFilesExist (deviceDrmProperties); break;
+ default: TCU_THROW(InternalError, "Unknown test type specified");
+ }
+
+ return tcu::TestStatus::pass("Pass");
+}
+
+static void createTestCases (tcu::TestCaseGroup* group)
+{
+ addFunctionCase(group, "drm_files_exist", "Verify device files for major/minor nodes exist", checkSupport, testDeviceDrmProperties, TEST_FILES_EXIST);
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createDeviceDrmPropertiesTests(tcu::TestContext& testCtx)
+{
+ return createTestGroup(testCtx, "device_drm_properties", "VK_EXT_device_drm_properties tests", createTestCases);
+}
+
+} // api
+} // vkt
--- /dev/null
+#ifndef _VKTAPIDEVICEDRMPROPERTIESTESTS_HPP
+#define _VKTAPIDEVICEDRMPROPERTIESTESTS_HPP
+/*-------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2021 NVIDIA, Inc.
+ * Copyright (c) 2021 The Khronos Group Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief VK_KHR_driver_properties tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+namespace api
+{
+
+tcu::TestCaseGroup* createDeviceDrmPropertiesTests (tcu::TestContext& testCtx);
+
+} // api
+} // vkt
+
+#endif // _VKTAPIDEVICEDRMPROPERTIESTESTS_HPP
#include "vktTestGroupUtil.hpp"
#include "vktApiSmokeTests.hpp"
+#include "vktApiDeviceDrmPropertiesTests.hpp"
#include "vktApiDeviceInitializationTests.hpp"
#include "vktApiDriverPropertiesTests.hpp"
#include "vktApiObjectManagementTests.hpp"
apiTests->addChild(createDriverPropertiesTests (testCtx));
apiTests->addChild(createSmokeTests (testCtx));
apiTests->addChild(api::createFeatureInfoTests (testCtx));
+ apiTests->addChild(createDeviceDrmPropertiesTests (testCtx));
apiTests->addChild(createDeviceInitializationTests (testCtx));
apiTests->addChild(createObjectManagementTests (testCtx));
apiTests->addChild(createBufferTests (testCtx));
dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x10_srgb_block
dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x12_unorm_block
dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x12_srgb_block
+dEQP-VK.api.device_drm_properties.drm_files_exist
dEQP-VK.api.device_init.create_instance_name_version
dEQP-VK.api.device_init.create_instance_invalid_api_version
dEQP-VK.api.device_init.create_instance_null_appinfo
extType = "MAINTENANCE2"
elif extType == "SHADER_CORE":
extType = "SHADER_CORE_PROPERTIES"
+ elif extType == "DRM":
+ extType = "PHYSICAL_DEVICE_DRM"
# end handling special cases
ptrnExtensionName = r'^\s*#define\s+(\w+' + sExtSuffix + '_' + extType + sVerSuffix +'[_0-9]*_EXTENSION_NAME).+$'
matchExtensionName = re.search(ptrnExtensionName, src, re.M)