intel/vulkan: Support INTEL_DEVID_OVERRIDE environment variable
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 10 Feb 2018 02:38:28 +0000 (18:38 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 27 Feb 2018 19:15:10 +0000 (11:15 -0800)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
src/intel/vulkan/anv_device.c

index dd5f2f492860b3be5905131724a893e8b2687d0b..8be88acc52c3b7c379022547a4f490e84ead1785 100644 (file)
@@ -296,10 +296,16 @@ anv_physical_device_init(struct anv_physical_device *device,
 
    device->no_hw = getenv("INTEL_NO_HW") != NULL;
 
-   device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
-   if (!device->chipset_id) {
-      result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
-      goto fail;
+   const int pci_id_override = gen_get_pci_device_id_override();
+   if (pci_id_override < 0) {
+      device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
+      if (!device->chipset_id) {
+         result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
+         goto fail;
+      }
+   } else {
+      device->chipset_id = pci_id_override;
+      device->no_hw = true;
    }
 
    device->name = gen_get_device_name(device->chipset_id);