[Mesa-dev] [PATCH 23/24] radv: generate the same driver UUID as radeonsi

Timothy Arceri tarceri at itsqueeze.com
Thu Jul 27 13:08:48 UTC 2017


From: Andres Rodriguez <andresx7 at gmail.com>

These need to match for interop compatibility queries.

Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
---
 src/amd/vulkan/radv_device.c  | 9 ++++++++-
 src/amd/vulkan/radv_private.h | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 9bfa5a34cd..06721e139b 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -56,20 +56,26 @@ radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
 		return -1;
 
 	memcpy(uuid, &mesa_timestamp, 4);
 	memcpy((char*)uuid + 4, &llvm_timestamp, 4);
 	memcpy((char*)uuid + 8, &f, 2);
 	snprintf((char*)uuid + 10, VK_UUID_SIZE - 10, "radv");
 	return 0;
 }
 
 static void
+radv_get_driver_uuid(void *uuid)
+{
+	ac_compute_driver_uuid(uuid, VK_UUID_SIZE);
+}
+
+static void
 radv_get_device_uuid(struct radeon_info *info, void *uuid)
 {
 	ac_compute_device_uuid(info, uuid, VK_UUID_SIZE);
 }
 
 static const VkExtensionProperties instance_extensions[] = {
 	{
 		.extensionName = VK_KHR_SURFACE_EXTENSION_NAME,
 		.specVersion = 25,
 	},
@@ -328,20 +334,21 @@ radv_physical_device_init(struct radv_physical_device *device,
 						  &device->extensions,
 						  ext_sema_device_extensions,
 						  ARRAY_SIZE(ext_sema_device_extensions));
 		if (result != VK_SUCCESS)
 			goto fail;
 	}
 
 	fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
 	device->name = get_chip_name(device->rad_info.family);
 
+	radv_get_driver_uuid(&device->device_uuid);
 	radv_get_device_uuid(&device->rad_info, &device->device_uuid);
 
 	if (device->rad_info.family == CHIP_STONEY ||
 	    device->rad_info.chip_class >= GFX9) {
 		device->has_rbplus = true;
 		device->rbplus_allowed = device->rad_info.family == CHIP_STONEY;
 	}
 
 	return VK_SUCCESS;
 
@@ -785,21 +792,21 @@ void radv_GetPhysicalDeviceProperties2KHR(
 	vk_foreach_struct(ext, pProperties->pNext) {
 		switch (ext->sType) {
 		case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
 			VkPhysicalDevicePushDescriptorPropertiesKHR *properties =
 				(VkPhysicalDevicePushDescriptorPropertiesKHR *) ext;
 			properties->maxPushDescriptors = MAX_PUSH_DESCRIPTORS;
 			break;
 		}
 		case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR: {
 			VkPhysicalDeviceIDPropertiesKHR *properties = (VkPhysicalDeviceIDPropertiesKHR*)ext;
-			radv_device_get_cache_uuid(0, properties->driverUUID);
+			memcpy(properties->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
 			memcpy(properties->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
 			properties->deviceLUIDValid = false;
 			break;
 		}
 		default:
 			break;
 		}
 	}
 }
 
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 21a8d410f0..5d6ab9e533 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -260,20 +260,21 @@ struct radv_extensions {
 
 struct radv_physical_device {
 	VK_LOADER_DATA                              _loader_data;
 
 	struct radv_instance *                       instance;
 
 	struct radeon_winsys *ws;
 	struct radeon_info rad_info;
 	char                                        path[20];
 	const char *                                name;
+	uint8_t                                     driver_uuid[VK_UUID_SIZE];
 	uint8_t                                     device_uuid[VK_UUID_SIZE];
 	uint8_t                                     cache_uuid[VK_UUID_SIZE];
 
 	int local_fd;
 	struct wsi_device                       wsi_device;
 	struct radv_extensions                      extensions;
 
 	bool has_rbplus; /* if RB+ register exist */
 	bool rbplus_allowed; /* if RB+ is allowed */
 };
-- 
2.13.3



More information about the mesa-dev mailing list