Mesa (main): vulkan/device_select: add has_vulkan11 flag with has_pci_bus flag
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Mar 8 15:17:01 UTC 2022
Module: Mesa
Branch: main
Commit: 3332fcd9c0b987202d7a38ad0451f3022ce886a8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3332fcd9c0b987202d7a38ad0451f3022ce886a8
Author: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu at amd.com>
Date: Thu Jan 13 16:24:48 2022 +0530
vulkan/device_select: add has_vulkan11 flag with has_pci_bus flag
In EnumeratePhysicalDevices(), pci bus info is available only in
vulkan version >= 1.1. hence adding has_vulkan11 flag in places
where has_pci_bus is used in EnumeratePhysicalDevices() code flow.
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14535>
---
src/vulkan/device-select-layer/device_select_layer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/vulkan/device-select-layer/device_select_layer.c b/src/vulkan/device-select-layer/device_select_layer.c
index 90fbb29469c..17496c2aef3 100644
--- a/src/vulkan/device-select-layer/device_select_layer.c
+++ b/src/vulkan/device-select-layer/device_select_layer.c
@@ -234,7 +234,7 @@ static void print_gpu(const struct instance_info *info, unsigned index, VkPhysic
}
fprintf(stderr, " GPU %d: %x:%x \"%s\" %s", index, properties.properties.vendorID,
properties.properties.deviceID, properties.properties.deviceName, type);
- if (info->has_pci_bus)
+ if (info->has_vulkan11 && info->has_pci_bus)
fprintf(stderr, " %04x:%02x:%02x.%x", ext_pci_properties.pciDomain,
ext_pci_properties.pciBus, ext_pci_properties.pciDevice,
ext_pci_properties.pciFunction);
@@ -430,7 +430,7 @@ static uint32_t get_default_device(const struct instance_info *info,
if (dri_prime && !strcmp(dri_prime, "1"))
dri_prime_is_one = true;
- if (dri_prime && !dri_prime_is_one && !info->has_pci_bus) {
+ if (dri_prime && !dri_prime_is_one && !info->has_vulkan11 && !info->has_pci_bus) {
fprintf(stderr, "device-select: cannot correctly use DRI_PRIME tag\n");
}
@@ -444,7 +444,7 @@ static uint32_t get_default_device(const struct instance_info *info,
if (selection)
default_idx = device_select_find_explicit_default(pci_infos, physical_device_count, selection);
- if (default_idx == -1 && info->has_pci_bus && dri_prime && !dri_prime_is_one)
+ if (default_idx == -1 && info->has_vulkan11 && info->has_pci_bus && dri_prime && !dri_prime_is_one)
default_idx = device_select_find_dri_prime_tag_default(pci_infos, physical_device_count, dri_prime);
if (default_idx == -1 && info->has_wayland)
default_idx = device_select_find_wayland_pci_default(pci_infos, physical_device_count);
More information about the mesa-commit
mailing list