This fixes DRI_PRIME=1 doing nothing if the GPU order is [dGPU, dGPU,
iGPU, cpu] (or more GPUs than that) and the iGPU is the default GPU.
Fixes:
afa1fba1 ("vulkan/device_select: don't pick a cpu driver as the default")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101>
default_idx = device_select_find_non_cpu(pci_infos, physical_device_count);
/* DRI_PRIME=1 handling - pick any other device than default. */
if (default_idx != -1 && dri_prime_is_one && physical_device_count > (cpu_count + 1)) {
- if (default_idx == 0 || default_idx == 1)
- default_idx = find_non_cpu_skip(pci_infos, physical_device_count, default_idx);
+ default_idx = find_non_cpu_skip(pci_infos, physical_device_count, default_idx);
}
free(pci_infos);
return default_idx == -1 ? 0 : default_idx;