panvk: Rename the error labels in create_device()

It's usually clearer to describe what the error unwinding entrypoint
does than which type of error it's supposed to handle, because some
entrypoints can be called from different error paths.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29451>
This commit is contained in:
Boris Brezillon
2024-06-28 09:17:56 +02:00
committed by Marge Bot
parent 91c9393da1
commit fd8700b793

View File

@@ -131,10 +131,8 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
result = vk_device_init(&device->vk, &physical_device->vk, &dispatch_table,
pCreateInfo, pAllocator);
if (result != VK_SUCCESS) {
vk_free(&device->vk.alloc, device);
return result;
}
if (result != VK_SUCCESS)
goto err_free_dev;
/* Must be done after vk_device_init() because this function memset(0) the
* whole struct.
@@ -154,7 +152,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
if (!device->kmod.dev) {
result = vk_errorf(instance, panvk_errno_to_vk_error(), "cannot create device");
goto fail_dev;
goto err_free_dev;
}
if (instance->debug_flags &
@@ -175,7 +173,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
if (!device->kmod.vm) {
result = vk_error(physical_device, VK_ERROR_OUT_OF_HOST_MEMORY);
goto fail_vm;
goto err_destroy_kdev;
}
panvk_device_init_mempools(device);
@@ -187,7 +185,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
if (!device->tiler_heap) {
result = vk_error(physical_device, VK_ERROR_OUT_OF_HOST_MEMORY);
goto fail_priv_bo;
goto err_free_priv_bos;
}
device->sample_positions =
@@ -196,7 +194,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
if (!device->sample_positions) {
result = vk_error(physical_device, VK_ERROR_OUT_OF_HOST_MEMORY);
goto fail_priv_bo;
goto err_free_priv_bos;
}
panfrost_upload_sample_positions(device->sample_positions->addr.host);
@@ -206,7 +204,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
result = panvk_per_arch(blend_shader_cache_init)(device);
if (result != VK_SUCCESS)
goto fail_priv_bo;
goto err_free_priv_bos;
panvk_per_arch(meta_init)(device);
@@ -220,7 +218,7 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!device->queues[qfi]) {
result = VK_ERROR_OUT_OF_HOST_MEMORY;
goto fail;
goto err_finish_queues;
}
memset(device->queues[qfi], 0,
@@ -232,14 +230,14 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
result = panvk_per_arch(queue_init)(device, &device->queues[qfi][q], q,
queue_create);
if (result != VK_SUCCESS)
goto fail;
goto err_finish_queues;
}
}
*pDevice = panvk_device_to_handle(device);
return VK_SUCCESS;
fail:
err_finish_queues:
for (unsigned i = 0; i < PANVK_MAX_QUEUE_FAMILIES; i++) {
for (unsigned q = 0; q < device->queue_count[i]; q++)
panvk_queue_finish(&device->queues[i][q]);
@@ -250,16 +248,16 @@ fail:
panvk_per_arch(meta_cleanup)(device);
panvk_per_arch(blend_shader_cache_cleanup)(device);
fail_priv_bo:
err_free_priv_bos:
panvk_priv_bo_unref(device->sample_positions);
panvk_priv_bo_unref(device->tiler_heap);
panvk_device_cleanup_mempools(device);
pan_kmod_vm_destroy(device->kmod.vm);
fail_vm:
err_destroy_kdev:
pan_kmod_dev_destroy(device->kmod.dev);
fail_dev:
err_free_dev:
vk_free(&device->vk.alloc, device);
return result;
}