summaryrefslogtreecommitdiff
path: root/src/freedreno/vulkan/tu_device.c
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2021-09-24 12:28:31 -0700
committerMarge Bot <eric+marge@anholt.net>2021-10-01 22:32:10 +0000
commit5116388e0ba98f080de91e37249e195421e78c0b (patch)
treea7d6b86f120d9fe3faf72729f481b65a1563a9b2 /src/freedreno/vulkan/tu_device.c
parent7e471541e0d18a1385e6b7d777ac0cd9c24fee55 (diff)
turnip: Expose a device name similar to the blob.
We add "Turnip" so that users (and vulkan.gpuinfo.org) can distinguish us without requiring VK_KHR_driver_properties. This will be a lot more user-friendly than "FD618", though. I made some little vk_asprintf helpers, because I figure other drivers setting up deviceName's will want them too. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13041>
Diffstat (limited to 'src/freedreno/vulkan/tu_device.c')
-rw-r--r--src/freedreno/vulkan/tu_device.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index 9976d4f1ba1..855409db3ee 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -202,7 +202,16 @@ tu_physical_device_init(struct tu_physical_device *device,
{
VkResult result = VK_SUCCESS;
- device->name = fd_dev_name(&device->dev_id);
+ const char *fd_name = fd_dev_name(&device->dev_id);
+ if (strncmp(fd_name, "FD", 2) == 0) {
+ device->name = vk_asprintf(&instance->vk.alloc,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE,
+ "Turnip Adreno (TM) %s", &fd_name[2]);
+ } else {
+ device->name = vk_strdup(&instance->vk.alloc, fd_name,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+
+ }
const struct fd_dev_info *info = fd_dev_info(&device->dev_id);
if (!info) {
@@ -277,6 +286,8 @@ tu_physical_device_finish(struct tu_physical_device *device)
if (device->master_fd != -1)
close(device->master_fd);
+ vk_free(&device->instance->vk.alloc, (void *)device->name);
+
vk_physical_device_finish(&device->vk);
}