xfree86: Fallback to first platform device as primary

When neither of the various bus implementations was able to find a
primary bus and device, fallback to using the platform bus as primary
bus and the first platform device as primary device.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2f0183222b4279266e6ef60b923738ff55f0afba)
[hdegoede: backport to 1.16 which doesn't have syspath directly in OdevAttributes]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
xfree86: Allow non-PCI devices as primary

On platforms that don't support PCI or have no GPU attached to the PCI
bus, there can still be a primary device on a non-PCI bus.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5d133276de9c50146e80ffc69edd429c2afe98e6)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>