| 1 | From 29b1484bb9555e45067669cbfe68a3c40596f4ff Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?= <lbsousajr@gmail.com> |
| 3 | Date: Thu, 3 Apr 2014 11:19:13 -0300 |
| 4 | Subject: [PATCH] xfree86: allow fallback to PCI bus probe for graphics devices |
| 5 | on non-seat0 X servers (#66851) |
| 6 | MIME-Version: 1.0 |
| 7 | Content-Type: text/plain; charset=UTF-8 |
| 8 | Content-Transfer-Encoding: 8bit |
| 9 | |
| 10 | Currently non-seat0 X servers only probe platform bus for graphics devices, |
| 11 | which is OK for most KMS-compliant drivers. However, for non-KMS drivers |
| 12 | (like NVIDIA proprietary ones), graphics devices can't be reached |
| 13 | by platform bus probe, resulting in a "No devices detected" error. |
| 14 | |
| 15 | This patch allows a fallback to PCI bus probe for non-seat0 X servers |
| 16 | in case no platform bus graphics device is found. |
| 17 | |
| 18 | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66851 |
| 19 | |
| 20 | Signed-off-by: LaƩrcio de Sousa <lbsousajr@gmail.com> |
| 21 | Reviewed-by: Hans de Goede <hdegoede@redhat.com> |
| 22 | Reviewed-by: Dave Airlie <airlied@redhat.com> |
| 23 | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> |
| 24 | --- |
| 25 | hw/xfree86/common/xf86Bus.c | 4 ++-- |
| 26 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 27 | |
| 28 | --- a/hw/xfree86/common/xf86Bus.c |
| 29 | +++ b/hw/xfree86/common/xf86Bus.c |
| 30 | @@ -81,7 +81,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool |
| 31 | if (drv->platformProbe != NULL) { |
| 32 | foundScreen = xf86platformProbeDev(drv); |
| 33 | } |
| 34 | - if (ServerIsNotSeat0()) |
| 35 | + if (ServerIsNotSeat0() && foundScreen) |
| 36 | return foundScreen; |
| 37 | #endif |
| 38 | |
| 39 | @@ -201,7 +201,7 @@ xf86BusProbe(void) |
| 40 | { |
| 41 | #ifdef XSERVER_PLATFORM_BUS |
| 42 | xf86platformProbe(); |
| 43 | - if (ServerIsNotSeat0()) |
| 44 | + if (ServerIsNotSeat0() && xf86_num_platform_devices > 0) |
| 45 | return; |
| 46 | #endif |
| 47 | #ifdef XSERVER_LIBPCIACCESS |