Module: Mesa
Branch: main
Commit: 28f187b9a7c53359f45e05b0a5dc28d9a9868e12
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=28f187b9a7c53359f45e05b0a5dc28d9a9868e12

Author: Danylo Piliaiev <[email protected]>
Date:   Tue Oct 24 12:10:10 2023 +0200

tu: Return error when GPU is unsupported

Signed-off-by: Danylo Piliaiev <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>

---

 src/freedreno/vulkan/tu_device.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/freedreno/vulkan/tu_device.cc 
b/src/freedreno/vulkan/tu_device.cc
index f892fcedcb3..71ed243c170 100644
--- a/src/freedreno/vulkan/tu_device.cc
+++ b/src/freedreno/vulkan/tu_device.cc
@@ -595,6 +595,13 @@ tu_physical_device_init(struct tu_physical_device *device,
    VkResult result = VK_SUCCESS;
 
    const char *fd_name = fd_dev_name(&device->dev_id);
+   if (!fd_name) {
+      return vk_startup_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
+                               "device (chip_id = %" PRIX64
+                               ", gpu_id = %u) is unsupported",
+                               device->dev_id.chip_id, device->dev_id.gpu_id);
+   }
+
    if (strncmp(fd_name, "FD", 2) == 0) {
       device->name = vk_asprintf(&instance->vk.alloc,
                                  VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE,

Reply via email to