summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Config.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/common/xf86Config.c')
-rw-r--r--hw/xfree86/common/xf86Config.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 71e008069..96fadc9dd 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -77,7 +77,7 @@ extern DeviceAssocRec mouse_assoc;
#include "picture.h"
#endif
-#if (defined(i386) || defined(__i386__)) && \
+#if (defined(__i386__)) && \
(defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
defined(__NetBSD__) || defined(linux) || \
(defined(SVR4) && !defined(sun)) || defined(__GNU__))
@@ -877,7 +877,7 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
};
-#if defined(i386) || defined(__i386__)
+#ifdef __i386__
static Bool
detectPC98(void)
{
@@ -1164,7 +1164,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.pixmap24 = Pix24DontCare;
xf86Info.pix24From = X_DEFAULT;
}
-#if defined(i386) || defined(__i386__)
+#ifdef __i386__
if (xf86GetOptValBool(FlagOptions, FLAG_PC98, &value)) {
xf86Info.pc98 = value;
if (value) {
@@ -1813,11 +1813,6 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
if (!servlayoutp)
return FALSE;
- if (conf_screen == NULL) {
- xf86ConfigError("No Screen sections present\n");
- return FALSE;
- }
-
/*
* which screen section is the active one?
*
@@ -1905,6 +1900,12 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
XF86ConfAdaptorLinkPtr conf_adaptor;
Bool defaultMonitor = FALSE;
+ if (!conf_screen) {
+ conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+ conf_screen->scrn_identifier = "Default Screen Section";
+ xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
+ }
+
xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
scrnum);
/*
@@ -1939,9 +1940,20 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
return FALSE;
}
+ /* Configure the device. If there isn't one configured, attach to the
+ * first inactive one that we can configure. If there's none that work,
+ * set it to NULL so that the section can be autoconfigured later */
screenp->device = xnfcalloc(1, sizeof(GDevRec));
- configDevice(screenp->device,conf_screen->scrn_device, TRUE);
- screenp->device->myScreenSection = screenp;
+ if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) {
+ conf_screen->scrn_device = xf86configptr->conf_device_lst;
+ xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
+ "\tUsing the first device section listed.\n", screenp->id);
+ }
+ if (configDevice(screenp->device,conf_screen->scrn_device, TRUE)) {
+ screenp->device->myScreenSection = screenp;
+ } else {
+ screenp->device = NULL;
+ }
screenp->options = conf_screen->scrn_option_lst;
/*
@@ -2230,13 +2242,17 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
{
int i;
+ if (!conf_device) {
+ return FALSE;
+ }
+
if (active)
xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n",
conf_device->dev_identifier);
else
xf86Msg(X_CONFIG, "|-->Inactive Device \"%s\"\n",
conf_device->dev_identifier);
-
+
devicep->identifier = conf_device->dev_identifier;
devicep->vendor = conf_device->dev_vendor;
devicep->board = conf_device->dev_board;