xserver: Branch 'master' - 2 commits

Julien Cristau jcristau at kemper.freedesktop.org
Mon Jul 28 08:46:15 PDT 2008


 hw/xfree86/common/xf86Config.c |   86 +++++++++++++++++++++--------------------
 hw/xfree86/loader/loadmod.c    |   17 ++++----
 2 files changed, 55 insertions(+), 48 deletions(-)

New commits:
commit e39a16aa58456aaecee54edc64f189c958db0902
Author: Julien Cristau <jcristau at debian.org>
Date:   Sat Jul 26 16:35:19 2008 +0200

    xfree86: don't output a spurious newline to the log when loading a module

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 6031db7..70c54a7 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -847,14 +847,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
     char *m = NULL;
     const char **cim;
 
-    xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"\n", module);
-
-    for (cim = compiled_in_modules; *cim; cim++)
-	if (!strcmp (module, *cim))
-	{
-	    xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", module);
-	    return (ModuleDescPtr) 1;
-	}
+    xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
 
     patterns = InitPatterns(patternlist);
     name = LoaderGetCanonicalName(module, patterns);
@@ -869,6 +862,14 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
 	xf86ErrorFVerb(3, "\n");
 	m = (char *)module;
     }
+
+    for (cim = compiled_in_modules; *cim; cim++)
+	if (!strcmp (m, *cim))
+	{
+	    xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);
+	    return (ModuleDescPtr) 1;
+	}
+
     if (!name) {
 	if (errmaj)
 	    *errmaj = LDR_BADUSAGE;
commit 2eaed4a10fe5bf727579bca4ab8d4a47c8763a7d
Author: Julien Cristau <jcristau at debian.org>
Date:   Sat Jul 26 15:35:42 2008 +0200

    xfree86: use xorg.conf input devices if there is no ServerLayout
    
    If xorg.conf has no ServerLayout section, use the first mouse and
    keyboard sections as core devices, even with AllowEmptyInput.

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 4b4a9a8..4b56152 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1315,7 +1315,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 3. First core pointer device. */
-    if (!foundPointer) {
+    if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
 	XF86ConfInputPtr p;
 
 	for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1331,7 +1331,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 4. First pointer with 'mouse' as the driver. */
-    if (!foundPointer) {
+    if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
 	confInput = xf86findInput(CONF_IMPLICIT_POINTER,
 				  xf86configptr->conf_input_lst);
 	if (!confInput) {
@@ -1346,7 +1346,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 5. Built-in default. */
-    if (!foundPointer) {
+    if (!foundPointer && !xf86Info.allowEmptyInput) {
 	bzero(&defPtr, sizeof(defPtr));
 	defPtr.inp_identifier = strdup("<default pointer>");
 	defPtr.inp_driver = strdup("mouse");
@@ -1373,9 +1373,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     if (!foundPointer) {
-	/* This shouldn't happen. */
-	xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
-	return FALSE;
+	if (!xf86Info.allowEmptyInput) {
+	    /* This shouldn't happen. */
+	    xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
+	    return FALSE;
+	} else {
+	    xf86Msg(X_INFO, "Cannot locate a core pointer device.\n");
+	}
     }
 
     /*
@@ -1392,7 +1396,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	    found = 1; break;
 	}
     }
-    if (!found) {
+    if (!found && !xf86Info.allowEmptyInput) {
 	xf86Msg(X_INFO, "No default mouse found, adding one\n");
 	bzero(&defPtr, sizeof(defPtr));
 	defPtr.inp_identifier = strdup("<default pointer>");
@@ -1451,7 +1455,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 3. First core keyboard device. */
-    if (!foundKeyboard) {
+    if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
 	XF86ConfInputPtr p;
 
 	for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1467,7 +1471,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
-    if (!foundKeyboard) {
+    if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
 	confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
 				  xf86configptr->conf_input_lst);
 	if (!confInput) {
@@ -1482,7 +1486,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     /* 5. Built-in default. */
-    if (!foundKeyboard) {
+    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
 	bzero(&defKbd, sizeof(defKbd));
 	defKbd.inp_identifier = strdup("<default keyboard>");
 	defKbd.inp_driver = strdup("kbd");
@@ -1509,21 +1513,39 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     if (!foundKeyboard) {
-	/* This shouldn't happen. */
-	xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
-	return FALSE;
+	if (!xf86Info.allowEmptyInput) {
+		/* This shouldn't happen. */
+		xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
+		return FALSE;
+	} else {
+		xf86Msg(X_INFO, "Cannot locate a core keyboard device.\n");
+	}
     }
 
     if (pointerMsg) {
-	xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
-		"explicitly in the layout.\n"
-		"\tUsing the %s.\n", pointerMsg);
+	if (implicitLayout)
+	    xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n",
+	            pointerMsg);
+	else
+	    xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
+	            "explicitly in the layout.\n"
+	            "\tUsing the %s.\n", pointerMsg);
     }
 
     if (keyboardMsg) {
-	xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
-		"explicitly in the layout.\n"
-		"\tUsing the %s.\n", keyboardMsg);
+	if (implicitLayout)
+	    xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n",
+	            keyboardMsg);
+	else
+	    xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
+	            "explicitly in the layout.\n"
+	            "\tUsing the %s.\n", keyboardMsg);
+    }
+
+    if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) {
+	xf86Msg(X_INFO, "The server relies on HAL to provide the list of "
+	                "input devices.\n\tIf no devices become available, "
+	                "reconfigure HAL or disable AllowEmptyInput.\n");
     }
 
     return TRUE;
@@ -2470,26 +2492,8 @@ addDefaultModes(MonPtr monitorp)
 }
 
 static void
-checkInput(serverLayoutPtr layout) {
-    if (!xf86Info.allowEmptyInput)
-        checkCoreInputDevices(layout, FALSE);
-    else
-    {
-        xf86Msg(X_INFO, "AllowEmptyInput is on.\n"
-                "\tThe server relies on HAL to provide the list of input "
-                "devices.\n\tIf no devices become available, reconfigure "
-                "HAL.\n");
-        if (!layout->inputs || !*layout->inputs)
-        {
-            /* No input device specified in ServerLayout. */
-            if (xf86configptr->conf_input_lst &&
-                    xf86configptr->conf_input_lst->inp_identifier)
-                xf86Msg(X_WARNING, "Input devices specified in xorg.conf, but"
-                        " not referenced in ServerLayout.\n\tThese devices"
-                        " will NOT be available.\n");
-        }
-
-    }
+checkInput(serverLayoutPtr layout, Bool implicit_layout) {
+    checkCoreInputDevices(layout, implicit_layout);
 }
 
 /*
@@ -2503,6 +2507,7 @@ xf86HandleConfigFile(Bool autoconfig)
     MessageType from = X_DEFAULT;
     char *scanptr;
     Bool singlecard = 0;
+    Bool implicit_layout = FALSE;
 
     if (!autoconfig) {
 	if (getuid() == 0)
@@ -2555,6 +2560,7 @@ xf86HandleConfigFile(Bool autoconfig)
             xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
 	    return CONFIG_PARSE_ERROR;
 	}
+	implicit_layout = TRUE;
     } else {
 	if (xf86configptr->conf_flags != NULL) {
 	  char *dfltlayout = NULL;
@@ -2612,7 +2618,7 @@ xf86HandleConfigFile(Bool autoconfig)
     configDRI(xf86configptr->conf_dri);
 #endif
 
-    checkInput(&xf86ConfigLayout);
+    checkInput(&xf86ConfigLayout, implicit_layout);
 
     /*
      * Handle some command line options that can override some of the


More information about the xorg-commit mailing list