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

Submitted by Andres Rodriguez on July 7, 2017, 4:24 a.m.

Details

Message ID 20170707042457.18219-25-andresx7@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 3 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez July 7, 2017, 4:24 a.m.
These need to match for interop compatibility queries.

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

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 176e0c2..b2a867f 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -63,6 +63,12 @@  radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
 }
 
 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);
@@ -300,6 +306,7 @@  radv_physical_device_init(struct radv_physical_device *device,
 	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 ||
@@ -744,7 +751,7 @@  void radv_GetPhysicalDeviceProperties2KHR(
 		}
 		case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHX: {
 			VkPhysicalDeviceIDPropertiesKHX *properties = (VkPhysicalDeviceIDPropertiesKHX*)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;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 5130439..5f09d05 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -267,6 +267,7 @@  struct radv_physical_device {
 	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];