From 46cd7faed36161d5e2c1a59ee0cd3cc378a7c53f Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 8 May 2024 04:54:56 -0400 Subject: [PATCH] tu: Move fd_dev_info() before name generation Remove the redundant error that will never be hit in practice (because if fd_dev_name() succeeds then so will fd_dev_info()) and move it up so that we can use the info when generating the name. Part-of: --- src/freedreno/vulkan/tu_device.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index ec2c027addc..48710397a15 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -1326,6 +1326,9 @@ tu_physical_device_init(struct tu_physical_device *device, device->dev_id.chip_id, device->dev_id.gpu_id); } + const struct fd_dev_info info = fd_dev_info(&device->dev_id); + assert(info.chip); + if (strncmp(fd_name, "FD", 2) == 0) { device->name = vk_asprintf(&instance->vk.alloc, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE, @@ -1340,12 +1343,6 @@ tu_physical_device_init(struct tu_physical_device *device, "device name alloc fail"); } - const struct fd_dev_info info = fd_dev_info(&device->dev_id); - if (!info.chip) { - result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, - "device %s is unsupported", device->name); - goto fail_free_name; - } switch (fd_dev_gen(&device->dev_id)) { case 6: case 7: {