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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28447>
This commit is contained in:
Connor Abbott 2024-05-08 04:54:56 -04:00 committed by Marge Bot
parent 4a5b234d5e
commit 46cd7faed3

View file

@ -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: {