anv: Better handle return codes from anv_physical_device_init
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 00:51:56 +0000 (17:51 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 16:26:41 +0000 (09:26 -0700)
The case where we just want the loop to continue is INCOMPATIBLE_DRIVER
because that simply means that whatever FD we opened isn't a supported
Intel chip.  Other error codes such as OUT_OF_HOST_MEMORY are actual errors
and we should be returning early in that case.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_device.c

index 37615ef122531bfa08cbd505035d1b9271037452..fcbe5873aa2733611a49defdb8d77754c574dd97 100644 (file)
@@ -350,7 +350,7 @@ VkResult anv_EnumeratePhysicalDevices(
          snprintf(path, sizeof(path), "/dev/dri/renderD%d", 128 + i);
          result = anv_physical_device_init(&instance->physicalDevice,
                                            instance, path);
-         if (result == VK_SUCCESS)
+         if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
             break;
       }