device_select_layer: apply DRI_PRIME even if default device is > 1 to match opengl...
authorLuna Nova <git@lunnova.dev>
Mon, 16 Jan 2023 00:09:04 +0000 (16:09 -0800)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 4 May 2023 00:55:51 +0000 (20:55 -0400)
commitf958a45a7144b0483533e10515a6c228edc69a2c
treeaeb28e05dae8dcd65c09fc1de460c9c9e944b68f
parent7fcda2b4e309cfa53a8ae3b2f03ffc363e745ef7
device_select_layer: apply DRI_PRIME even if default device is > 1 to match opengl behavior

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>
src/vulkan/device-select-layer/device_select_layer.c