summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/xf86.h1
-rw-r--r--hw/xfree86/common/xf86Bus.c26
-rw-r--r--hw/xfree86/common/xf86Globals.c1
-rw-r--r--hw/xfree86/common/xf86pciBus.c4
-rw-r--r--hw/xfree86/common/xf86platformBus.c4
5 files changed, 33 insertions, 3 deletions
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index e54c81170..f7246882e 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -55,6 +55,7 @@
extern _X_EXPORT int xf86DoConfigure;
extern _X_EXPORT int xf86DoShowOptions;
extern _X_EXPORT Bool xf86DoConfigurePass1;
+extern _X_EXPORT Bool xf86ProbeIgnorePrimary;
extern _X_EXPORT Bool xorgHWAccess;
extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index a3a989866..983680362 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -117,14 +117,34 @@ xf86BusConfig(void)
int i, j;
/*
- * Now call each of the Probe functions. Each successful probe will
- * result in an extra entry added to the xf86Screens[] list for each
- * instance of the hardware found.
+ * 3 step probe to (hopefully) ensure that we always find at least 1
+ * (non GPU) screen:
+ *
+ * 1. Call each drivers probe function normally,
+ * Each successful probe will result in an extra entry added to the
+ * xf86Screens[] list for each instance of the hardware found.
*/
for (i = 0; i < xf86NumDrivers; i++) {
xf86CallDriverProbe(xf86DriverList[i], FALSE);
}
+ /*
+ * 2. If no Screens were found, call each drivers probe function with
+ * ignorePrimary = TRUE, to ensure that we do actually get a
+ * Screen if there is atleast one supported video card.
+ */
+ if (xf86NumScreens == 0) {
+ xf86ProbeIgnorePrimary = TRUE;
+ for (i = 0; i < xf86NumDrivers && xf86NumScreens == 0; i++) {
+ xf86CallDriverProbe(xf86DriverList[i], FALSE);
+ }
+ xf86ProbeIgnorePrimary = FALSE;
+ }
+
+ /*
+ * 3. Call xf86platformAddGPUDevices() to add any additional video cards as
+ * GPUScreens (GPUScreens are only supported by platformBus drivers).
+ */
for (i = 0; i < xf86NumDrivers; i++) {
xf86platformAddGPUDevices(xf86DriverList[i]);
}
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 07cfabf89..e962b756b 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -152,6 +152,7 @@ XF86ConfigPtr xf86configptr = NULL;
Bool xf86Resetting = FALSE;
Bool xf86Initialising = FALSE;
Bool xf86DoConfigure = FALSE;
+Bool xf86ProbeIgnorePrimary = FALSE;
Bool xf86DoShowOptions = FALSE;
DriverPtr *xf86DriverList = NULL;
int xf86NumDrivers = 0;
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index e61ae0cd4..b0c78e7f0 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -352,6 +352,10 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func)
Bool
xf86IsPrimaryPci(struct pci_device *pPci)
{
+ /* Add max. 1 screen for the IgnorePrimary fallback path */
+ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
+ return TRUE;
+
if (primaryBus.type == BUS_PCI)
return pPci == primaryBus.id.pci;
#ifdef XSERVER_PLATFORM_BUS
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 8dd0d5da7..063e81c2a 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -114,6 +114,10 @@ xf86_find_platform_device_by_devnum(int major, int minor)
static Bool
xf86IsPrimaryPlatform(struct xf86_platform_device *plat)
{
+ /* Add max. 1 screen for the IgnorePrimary fallback path */
+ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0)
+ return TRUE;
+
if (primaryBus.type == BUS_PLATFORM)
return plat == primaryBus.id.plat;
#ifdef XSERVER_LIBPCIACCESS