From 8665cf3327b713f334b0483593a924c197f892f2 Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Tue, 9 Oct 2007 22:45:15 -0400 Subject: [PATCH] Don't require that the screen explicitly attach the device section This will allow the screen to not explicitly have a device section. If this is the case and there is a device section in the xorg.conf, the first one will be used. If there is no device section at all, a default one will be created that loads the automatically determined module. --- hw/xfree86/common/xf86Config.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 1b99e9556..9629df5cc 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1939,11 +1939,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)); - if (configDevice(screenp->device,conf_screen->scrn_device, TRUE)) + 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 + } else { screenp->device = NULL; + } screenp->options = conf_screen->scrn_option_lst; /*