mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 16:50:10 +01:00
vulkan/device_select: print the dri_prime warning only if needed
The next commit will allow a different DRI_PRIME syntax, so move this printf in the right if block. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17298>
This commit is contained in:
parent
4005ba3ed4
commit
a71b92fff8
1 changed files with 7 additions and 6 deletions
|
|
@ -427,10 +427,6 @@ 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_vulkan11 && !info->has_pci_bus) {
|
||||
fprintf(stderr, "device-select: cannot correctly use DRI_PRIME tag\n");
|
||||
}
|
||||
|
||||
struct device_pci_info *pci_infos = (struct device_pci_info *)calloc(physical_device_count, sizeof(struct device_pci_info));
|
||||
if (!pci_infos)
|
||||
return 0;
|
||||
|
|
@ -441,8 +437,13 @@ 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_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 && dri_prime && !dri_prime_is_one) {
|
||||
if (!info->has_vulkan11 && !info->has_pci_bus)
|
||||
fprintf(stderr, "device-select: cannot correctly use DRI_PRIME tag\n");
|
||||
else
|
||||
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);
|
||||
if (default_idx == -1 && info->has_xcb)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue