summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-07-25 10:40:55 -0700
committerMark Janes <[email protected]>2019-08-01 16:39:51 -0700
commite4a0070db4462d450ca89cf488de549cf6a3a885 (patch)
treed558e3c05c9b4741a75012a7d85cb5988574afbe /src/intel/vulkan/anv_device.c
parent49465f1330f2c7bc43815ca935cbacc81cd97ff5 (diff)
anv: use initialization routine for gen_device_info
Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r--src/intel/vulkan/anv_device.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index c4b42fa3fe9..cdc0cffc0f2 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -390,19 +390,15 @@ anv_physical_device_init(struct anv_physical_device *device,
assert(strlen(path) < ARRAY_SIZE(device->path));
snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
- device->no_hw = getenv("INTEL_NO_HW") != NULL;
+ if (!gen_get_device_info_from_fd(fd, &device->info)) {
+ result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
+ goto fail;
+ }
+ device->chipset_id = device->info.chipset_id;
+ device->no_hw = device->info.no_hw;
- 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;
+ if (getenv("INTEL_NO_HW") != NULL)
device->no_hw = true;
- }
device->pci_info.domain = drm_device->businfo.pci->domain;
device->pci_info.bus = drm_device->businfo.pci->bus;
@@ -410,10 +406,6 @@ anv_physical_device_init(struct anv_physical_device *device,
device->pci_info.function = drm_device->businfo.pci->func;
device->name = gen_get_device_name(device->chipset_id);
- if (!gen_get_device_info(device->chipset_id, &device->info)) {
- result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
- goto fail;
- }
if (device->info.is_haswell) {
intel_logw("Haswell Vulkan support is incomplete");