Fix anv_enumerate_physical_devices

No compatible devices should not return error.

Change-Id: Icd81e7e5309b61c5fdb2b32f43a2cc0dee627137
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/405854
Reviewed-by: John Bauman <jbauman@google.com>
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 1b1326d..7ae67d0 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -884,7 +884,7 @@
    instance->physical_devices_enumerated = true;
 
 #if defined(ANV_MAGMA)
-   VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER;
+   VkResult result = VK_SUCCESS;
 
 #ifdef DEV_GPU_PATH_OVERRIDE
    struct anv_physical_device *pdevice;
@@ -892,6 +892,9 @@
       DEV_GPU_PATH_OVERRIDE, DEV_GPU_PATH_OVERRIDE, &pdevice);
    if (result == VK_SUCCESS) {
       list_addtail(&pdevice->link, &instance->physical_devices);
+   } else if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
+      /* Incompatible device, skip. */
+      result = VK_SUCCESS;
    }
 #else
    const char DEV_GPU[] = "/dev/class/gpu";
@@ -899,8 +902,8 @@
    struct os_dirent* de;
    os_dir_t* dir = os_opendir(DEV_GPU);
    if (!dir) {
-      printf("Error opening %s\n", DEV_GPU);
-      return VK_ERROR_INCOMPATIBLE_DRIVER;
+      intel_loge("Error opening %s", DEV_GPU);
+      return VK_SUCCESS;
    }
 
    while ((de = os_readdir(dir)) != NULL) {
@@ -911,7 +914,7 @@
       struct anv_physical_device *pdevice;
       result = anv_physical_device_try_create(instance,
          name, name, &pdevice);
-      /* Incompatible DRM device, skip. */
+      /* Incompatible device, skip. */
       if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
          result = VK_SUCCESS;
          continue;