xserver-multidpi/hw
Laszlo Ersek ca8d88e503 xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform()
The new platform bus code and the old PCI bus code overlap. Platform bus
can handle any type of device, including PCI devices, whereas the PCI code
can only handle PCI devices. Some drivers only support the old style
PCI-probe methods, but the primary device detection code is server based,
not driver based; so we might end up with a primary device which only has
a PCI bus-capable driver, but was detected as primary by the platform
code, or the other way around.

(The above paragraph was shamelessly stolen from Hans de Goede, and
customized.)

The latter case applies to QEMU's virtio-gpu-pci device: it is detected as
a BUS_PCI primary device, but we actually probe it first (with the
modesetting driver) through xf86platformProbeDev(). The
xf86IsPrimaryPlatform() function doesn't recognize the device as primary
(it bails out as soon as it sees BUS_PCI); instead, we add the device as a
secondary graphics card under "autoAddGPU". In turn, the success of this
automatic probing-as-GPU prevents xf86CallDriverProbe() from proceeding to
the PCI probing.

The result is that the server exits with no primary devices detected.

Commit cf66471353 ("xfree86: use udev to provide device enumeration for
kms devices (v10)") added "cross-bus" matching to xf86IsPrimaryPci(). Port
that now to xf86IsPrimaryPlatform(), so that we can probe virtio-gpu-pci
as a primary card in platform bus code.

Cc: Adam Jackson <ajax@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-28 14:53:39 -04:00
..
dmx Switch poll() users to xserver_poll() 2016-07-21 15:04:36 -04:00
kdrive xephyr: Don't crash if the server advertises zero xv adaptors 2016-09-28 14:53:39 -04:00
vfb Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xfree86 xfree86: recognize primary BUS_PCI device in xf86IsPrimaryPlatform() 2016-09-28 14:53:39 -04:00
xnest Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xquartz XQuartz: Silence an expected TSan warning 2016-09-22 14:55:03 -07:00
xwayland xwayland: Clear up x_cursor on UnrealizeCursor() 2016-09-28 14:23:59 -04:00
xwin hw/xwin: Add 'dri' to DIST_SUBDIRS 2016-09-16 10:57:23 -07:00
Makefile.am Xwayland DDX 2014-04-03 15:19:22 -07:00