compositor-drm: prefer PCI boot_vga GPU over other GPUs
authorDavid Herrmann <dh.herrmann@googlemail.com>
Mon, 29 Oct 2012 18:21:16 +0000 (19:21 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 29 Oct 2012 20:31:38 +0000 (16:31 -0400)
commit0af066ff25329278ed48f1a62b980f359ad3d235
tree397ac037272040c71aceed91ee3b72da4c55c236
parent4df7e27055aaf1fbcc8ea6c4cc29a1facfcad62a
compositor-drm: prefer PCI boot_vga GPU over other GPUs

If we can find a boot_vga PCI GPU, we should prefer it over any other GPU
that is connected to the system. The boot_vga flag tells us that this GPU
is the primary system GPU.

This fixes problems on two-GPU-systems were the wrong GPU is used. It also
fixes systems were DisplayLink GPUs are available with lower IDs than PCI
GPUs (although, this seems unlikely).

Note that udev_enumerate guarantees that the entry-list is sorted. So for
systems that have platform-GPUs, these should almost always be reported
prior to hotpluggable (PCI, USB, ...) GPUs, as the kernel probes them
first.

https://bugs.freedesktop.org/show_bug.cgi?id=56237

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/compositor-drm.c