winex11.drv: Avoid adding duplicate GPUs.

Merged Paul Gofman requested to merge gofman/wine:dup_gpus into master

On certain dual GPU configurations (AMD integrated / discrete GPU laptop in my case) vkGetRandROutputDisplayEXT() doesn't work the way we currently expect. That is, it returns success and a valid VkDisplay handler for any randr provider and GPU combination. The configuration ends up broken in various aspects, the same GPU gets added twice with identical parameters while another GPU is not represented at all.

I think it is not a Vulkan or xrandr bug, this behaviour probably reflects the fact that one can present from any of Vulkan devices to the displays plugged to any of those outputs.

The patch avoids adding the device twice and also another device gets represented as well. The relation between the added GPUs and monitors ends up being somewhat arbitrary but then it doesn't affect much in the case when displays are accessible though any of adapters.

The alternative to consider would be to have a completely separate path to be taken if Vulkan is available which instead of attaching Vulkan device info to xrandr-driven GPUs list would have GPU device spawned by Vulkan device and use xrandr to link the adapters and displays to GPUs. This way it would also help Wayland where we don't have real xrandr providers (only one WAYLAND provider with all the displays) and end up without creating proper GPU devices.

Merge request reports