xserver: Branch 'master' - 3 commits

Peter Hutterer whot at kemper.freedesktop.org
Thu Jul 3 06:26:46 PDT 2008


 hw/xfree86/common/xf86Config.c       |   36 +++++++++++++++++++++++++++++------
 hw/xfree86/common/xf86Init.c         |    3 +-
 hw/xfree86/doc/man/xorg.conf.man.pre |    3 +-
 3 files changed, 34 insertions(+), 8 deletions(-)

New commits:
commit e317943c125d7fdbe62c750324640eb30c88fa15
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 2 12:23:03 2008 +0930

    xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled.
    
    Remove AEI check from configImpliedLayout as the setting isn't actually parsed
    at this point anyway (written by Sasha Hlusiak).
    
    Resurrect checkInput() and check for devices there if AEI is false (this also
    creates the default devices if required).
    
    Set AllowEmptyInput to enabled by default if hotplugging is enabled.

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 35a48ee..bea2130 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1087,9 +1087,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     }
 #endif
 
-    xf86Info.allowEmptyInput = FALSE;
-    if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
-        xf86Info.allowEmptyInput = TRUE;
+    /* AllowEmptyInput is automatically true if we're hotplugging */
+    xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
+    xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
 
     xf86Info.useDefaultFontPath = TRUE;
     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
@@ -1874,9 +1874,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
     indp = xnfalloc(sizeof(IDevPtr));
     *indp = NULL;
     servlayoutp->inputs = indp;
-    if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE))
-	return FALSE;
-    
+
     return TRUE;
 }
 
@@ -2479,6 +2477,12 @@ addDefaultModes(MonPtr monitorp)
     return TRUE;
 }
 
+static void
+checkInput(serverLayoutPtr layout) {
+    if (!xf86Info.allowEmptyInput)
+        checkCoreInputDevices(layout, FALSE);
+}
+
 /*
  * load the config file and fill the global data structure
  */
@@ -2599,6 +2603,8 @@ xf86HandleConfigFile(Bool autoconfig)
     configDRI(xf86configptr->conf_dri);
 #endif
 
+    checkInput(&xf86ConfigLayout);
+
     /*
      * Handle some command line options that can override some of the
      * ServerFlags settings.
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 8b66f89..3af1b78 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -696,7 +696,8 @@ the X server to load. Disabled by default.
 .TP 7
 .BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
 If enabled, don't add the standard keyboard and mouse drivers, if there are no
-input devices in the config file.  Disabled by default.
+input devices in the config file.  Enabled by default if AutoAddDevices and
+AutoEnableDevices is enabled, otherwise disabled.
 .TP 7
 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
 If this option is disabled, then no devices will be added from HAL events.
commit fe5cf7cb00fd926cefff933adbdbceea7353f4c2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 1 13:18:54 2008 +0930

    xfree86: handle missing Screen lines in the ServerLayout #16301
    
    If no Screen is specified in the ServerLayout section, either take the first
    one from the config file or autogenerate a default screen.
    
    X.Org Bug 16301 <http://bugs.freedesktop.org/show_bug.cgi?id=16301>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 6fd0273..35a48ee 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1608,10 +1608,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
         count++;
         adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
     }
+
 #ifdef DEBUG
     ErrorF("Found %d screens in the layout section %s",
            count, conf_layout->lay_identifier);
 #endif
+    if (!count) /* alloc enough storage even if no screen is specified */
+        count = 1;
+
     slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec));
     slp[count].screen = NULL;
     /*
@@ -1666,6 +1670,20 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
         adjp = (XF86ConfAdjacencyPtr)adjp->list.next;
     }
 
+    /* No screen was specified in the layout. take the first one from the
+     * config file, or - if it is NULL - configScreen autogenerates one for
+     * us */
+    if (!count)
+    {
+        slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
+	if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst,
+                          0, X_CONFIG)) {
+	    xfree(slp[0].screen);
+	    xfree(slp);
+	    return FALSE;
+	}
+    }
+
     /* XXX Need to tie down the upper left screen. */
 
     /* Fill in the refscreen and top/bottom/left/right values */
commit 6674b87a7dca7d6ffd9dd9af888c5256b13d7877
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sun Jun 29 20:05:27 2008 +0930

    xfree86: move declaration of configured_device to start of function.
    
    Last I checked C doesn't allow declarations halfway down a block.

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 46c4a96..5418ca0 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -472,6 +472,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
   MessageType		 pix24From = X_DEFAULT;
   Bool			 pix24Fail = FALSE;
   Bool			 autoconfig = FALSE;
+  GDevPtr		 configured_device;
   
   xf86Initialising = TRUE;
 
@@ -555,7 +556,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     /* If there aren't any specified in the config file, autoconfig them */
     /* FIXME: Does not handle multiple active screen sections, but I'm not
      * sure if we really want to handle that case*/
-    GDevPtr configured_device = xf86ConfigLayout.screens->screen->device;
+    configured_device = xf86ConfigLayout.screens->screen->device;
     if ((!configured_device) || (!configured_device->driver)) {
         if (!autoConfigDevice(configured_device)) {
             xf86Msg(X_ERROR, "Automatic driver configuration failed\n");


More information about the xorg-commit mailing list