[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'debian-unstable'



 debian/changelog                                                            |   19 
 debian/patches/07-xfree86-fix-build-with-xv-disabled.diff                   |   50 
 debian/patches/08-config-xorg-conf-d.diff                                   | 1287 +++++++++
 debian/patches/09-inputclass-sans-abi9.diff                                 | 1334 ++++++++++
 debian/patches/10-config-libudev-backend.diff                               |  725 +++++
 debian/patches/11-Move-config_init-after-CreateWellKnownSockets-and-In.diff |   34 
 debian/patches/11-xfree86-fix-video-fallback.diff                           |  123 
 debian/patches/12-Add-libudev-input-hotplug-backend.diff                    |  710 -----
 debian/patches/12-xfree86-dont-complain-about-missing-coredevices.diff      |   58 
 debian/patches/13-configure-config-udev-defaults-to-off-for-now.diff        |   23 
 debian/patches/13-unbreak-input-abi.diff                                    |  148 +
 debian/patches/14-config-add-example-udev-rules.diff                        |   27 
 debian/patches/14-tone-down-nidr-errors.diff                                |   20 
 debian/patches/15-config-udev-look-for-xkb-rules-model-layout-variant-.diff |   40 
 debian/patches/16-config-dont-filter-input-subsys.diff                      |   42 
 debian/patches/16-xfree86-fix-build-with-xv-disabled.diff                   |   53 
 debian/patches/series                                                       |   15 
 17 files changed, 3772 insertions(+), 936 deletions(-)

New commits:
commit 8d44f6806196c6b77917b1483f975ee5e607a55b
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Tue Mar 30 13:52:39 2010 +0300

    Explain a bit more.

diff --git a/debian/changelog b/debian/changelog
index 62cad49..b781f32 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,9 @@ xorg-server (2:1.7.6-2) UNRELEASED; urgency=low
   * Add 08-config-xorg-conf-d.diff, 09-inputclass-sans-abi9.diff,
     10-config-libudev-backend.diff. Backport xorg.conf.d, inputclass
     and libudev support from xserver 1.8. Replaces the patches we had
-    before.
+    before. This allows us to migrate from a temporary udev based
+    input device configuration straight to the long term solution
+    introduced in 1.8.
   * Add 11-xfree86-fix-video-fallback.diff from SUSE. Allows the video
     fallback method to work when there's an xorg.conf around.
   * Add 12-xfree86-dont-complain-about-missing-coredevices.diff.

commit cc96fc4f50cfbf1056b99e3af37d0624003349f9
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Tue Mar 30 13:41:00 2010 +0300

    Update the changelog to explain the backport.

diff --git a/debian/changelog b/debian/changelog
index ef4b504..62cad49 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,17 @@
-xorg-server (2:1.7.6-1.1) UNRELEASED; urgency=low
-
-  * Backport xorg.conf.d, inputclass and libudev support from
-    xserver 1.8. The udev support is slightly different from what we had.
+xorg-server (2:1.7.6-2) UNRELEASED; urgency=low
+
+  * Add 08-config-xorg-conf-d.diff, 09-inputclass-sans-abi9.diff,
+    10-config-libudev-backend.diff. Backport xorg.conf.d, inputclass
+    and libudev support from xserver 1.8. Replaces the patches we had
+    before.
+  * Add 11-xfree86-fix-video-fallback.diff from SUSE. Allows the video
+    fallback method to work when there's an xorg.conf around.
+  * Add 12-xfree86-dont-complain-about-missing-coredevices.diff.
+    No reason to complain about these, unless AEI is off.
+  * Add 13-unbreak-input-abi.diff. Keep the old NewInputDeviceRequest(),
+    rename the new as NIDR18() and call it from NIDR(). This way we
+    don't break the input ABI.
+  * Add 14-tone-down-nidr-errors.diff. Use X_INFO instead of X_ERROR.
 
  -- Timo Aaltonen <tjaalton@ubuntu.com>  Wed, 24 Mar 2010 16:08:25 +0200
 

commit 7ce6a0ee6ae7dbf380f639c9a235997889651635
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Tue Mar 30 13:23:16 2010 +0300

    Refresh patch 07.

diff --git a/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff b/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff
index 184301f..8281634 100644
--- a/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff
+++ b/debian/patches/07-xfree86-fix-build-with-xv-disabled.diff
@@ -8,11 +8,11 @@ Subject: [PATCH] xfree86: fix build with xv disabled
  hw/xfree86/modes/xf86Crtc.h |    2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)
 
-diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
-index 30b49af..62f8737 100644
---- a/hw/xfree86/modes/xf86Crtc.c
-+++ b/hw/xfree86/modes/xf86Crtc.c
-@@ -3009,6 +3009,7 @@ xf86_crtc_box_area(BoxPtr box)
+Index: xorg-server/hw/xfree86/modes/xf86Crtc.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/modes/xf86Crtc.c	2010-03-30 13:22:36.000000000 +0300
++++ xorg-server/hw/xfree86/modes/xf86Crtc.c	2010-03-30 13:22:39.000000000 +0300
+@@ -3011,6 +3011,7 @@
      return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
  }
  
@@ -20,7 +20,7 @@ index 30b49af..62f8737 100644
  /*
   * Return the crtc covering 'box'. If two crtcs cover a portion of
   * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
-@@ -3097,6 +3098,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+@@ -3099,6 +3100,7 @@
  
      return ret;
  }
@@ -28,11 +28,11 @@ index 30b49af..62f8737 100644
  
  xf86_crtc_notify_proc_ptr
  xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
-diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
-index 9baa956..2fb32c1 100644
---- a/hw/xfree86/modes/xf86Crtc.h
-+++ b/hw/xfree86/modes/xf86Crtc.h
-@@ -908,6 +908,7 @@ xf86_hide_cursors (ScrnInfoPtr scrn);
+Index: xorg-server/hw/xfree86/modes/xf86Crtc.h
+===================================================================
+--- xorg-server.orig/hw/xfree86/modes/xf86Crtc.h	2010-03-30 13:22:36.000000000 +0300
++++ xorg-server/hw/xfree86/modes/xf86Crtc.h	2010-03-30 13:22:39.000000000 +0300
+@@ -934,6 +934,7 @@
  extern _X_EXPORT void
  xf86_cursors_fini (ScreenPtr screen);
  
@@ -40,7 +40,7 @@ index 9baa956..2fb32c1 100644
  /*
   * For overlay video, compute the relevant CRTC and
   * clip video to that.
-@@ -926,6 +927,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+@@ -952,6 +953,7 @@
  			    RegionPtr   reg,
  			    INT32	width,
  			    INT32	height);
@@ -48,6 +48,3 @@ index 9baa956..2fb32c1 100644
      
  extern _X_EXPORT xf86_crtc_notify_proc_ptr
  xf86_wrap_crtc_notify (ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new);
--- 
-1.6.6.1
-

commit f1cdff35391eb165ecd1b03cb7983f3a7e14dbfd
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Tue Mar 30 13:21:29 2010 +0300

    Rename the new patches to have a double-digit prefix.

diff --git a/debian/patches/08-config-xorg-conf-d.diff b/debian/patches/08-config-xorg-conf-d.diff
new file mode 100644
index 0000000..cf70c92
--- /dev/null
+++ b/debian/patches/08-config-xorg-conf-d.diff
@@ -0,0 +1,1287 @@
+From 871bbe1d87fa3c7ebd075e1d1eec33e45b08493d Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Wed, 30 Dec 2009 17:16:45 +0000
+Subject: Merge remote branch 'dbn/xorg.conf.d'
+
+---
+Index: xorg-server/configure.ac
+===================================================================
+--- xorg-server.orig/configure.ac	2010-03-24 13:05:51.000000000 +0200
++++ xorg-server/configure.ac	2010-03-24 13:05:51.000000000 +0200
+@@ -1696,6 +1696,7 @@
+ 
+ 	dnl these only go in xorg-config.h
+ 	XF86CONFIGFILE="xorg.conf"
++	XF86CONFIGDIR="xorg.conf.d"
+ 	CONFIGFILE="$sysconfdir/$XF86CONFIGFILE"
+ 	LOGPREFIX="$logdir/Xorg."
+ 	AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
+@@ -1708,6 +1709,7 @@
+ 	AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
+ 	AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file])
+ 	AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
++	AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
+ 	AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
+ 	AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
+ 	AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
+Index: xorg-server/cpprules.in
+===================================================================
+--- xorg-server.orig/cpprules.in	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/cpprules.in	2010-03-24 13:05:51.000000000 +0200
+@@ -36,7 +36,8 @@
+ 	-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
+ 	-D__mandir__=$(mandir) \
+ 	-D__projectroot__=$(prefix) \
+-	-D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \
++	-D__xconfigfile__=$(__XCONFIGFILE__) \
++	-D__xconfigdir__=$(__XCONFIGDIR__) \
+ 	-D__xkbdir__=$(XKB_BASE_DIRECTORY) \
+ 	-D__modulepath__="$(DEFAULT_MODULE_PATH)" \
+ 	-D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) 
+Index: xorg-server/hw/xfree86/common/xf86AutoConfig.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/common/xf86AutoConfig.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/common/xf86AutoConfig.c	2010-03-24 13:05:51.000000000 +0200
+@@ -272,7 +272,8 @@
+     for (cp = builtinConfig; *cp; cp++)
+ 	xf86ErrorFVerb(3, "\t%s", *cp);
+     xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n");
+-    
++
++    xf86initConfigFiles();
+     xf86setBuiltinConfig(builtinConfig);
+     ret = xf86HandleConfigFile(TRUE);
+     FreeConfig();
+Index: xorg-server/hw/xfree86/common/xf86Config.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/common/xf86Config.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/common/xf86Config.c	2010-03-24 13:05:51.000000000 +0200
+@@ -95,6 +95,23 @@
+ 			"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+ 			"%P/lib/X11/%X"
+ #endif
++#ifndef ROOT_CONFIGDIRPATH
++#define ROOT_CONFIGDIRPATH	"%A," "%R," \
++				"/etc/X11/%R," "%P/etc/X11/%R," \
++				"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
++				"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
++				"%P/etc/X11/%X," \
++				"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
++				"%P/lib/X11/%X"
++#endif
++#ifndef USER_CONFIGDIRPATH
++#define USER_CONFIGDIRPATH	"/etc/X11/%S," "%P/etc/X11/%S," \
++				"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
++				"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
++				"%P/etc/X11/%X," \
++				"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
++				"%P/lib/X11/%X"
++#endif
+ #ifndef PROJECTROOT
+ #define PROJECTROOT	"/usr/X11R6"
+ #endif
+@@ -1471,6 +1488,45 @@
+        {0}, FALSE },
+ };
+ 
++static Bool
++configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
++{
++    XF86ConfInputrefPtr irp;
++    IDevPtr *indp;
++    int count = 0;
++
++    /*
++     * Count the number of input devices.
++     */
++    irp = layout->lay_input_lst;
++    while (irp) {
++	count++;
++	irp = (XF86ConfInputrefPtr)irp->list.next;
++    }
++    DebugF("Found %d input devices in the layout section %s\n",
++	    count, layout.lay_identifier);
++    indp = xnfcalloc((count + 1), sizeof(IDevPtr));
++    indp[count] = NULL;
++    irp = layout->lay_input_lst;
++    count = 0;
++    while (irp) {
++	indp[count] = xnfalloc(sizeof(IDevRec));
++	if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
++	    while(count--)
++		xfree(indp[count]);
++	    xfree(indp);
++	    return FALSE;
++	}
++	indp[count]->extraOptions = irp->iref_option_lst;
++	count++;
++	irp = (XF86ConfInputrefPtr)irp->list.next;
++    }
++    servlayoutp->inputs = indp;
++
++    return TRUE;
++}
++
++
+ /*
+  * figure out which layout is active, which screens are used in that layout,
+  * which drivers and monitors are used in these screens
+@@ -1481,14 +1537,12 @@
+ {
+     XF86ConfAdjacencyPtr adjp;
+     XF86ConfInactivePtr idp;
+-    XF86ConfInputrefPtr irp;
+     int count = 0;
+     int scrnum;
+     XF86ConfLayoutPtr l;
+     MessageType from;
+     screenLayoutPtr slp;
+     GDevPtr gdp;
+-    IDevPtr* indp;
+     int i = 0, j;
+ 
+     if (!servlayoutp)
+@@ -1701,37 +1755,13 @@
+         count++;
+         idp = (XF86ConfInactivePtr)idp->list.next;
+     }
+-    /*
+-     * Count the number of input devices.
+-     */
+-    count = 0;
+-    irp = conf_layout->lay_input_lst;
+-    while (irp) {
+-        count++;
+-        irp = (XF86ConfInputrefPtr)irp->list.next;
+-    }
+-    DebugF("Found %d input devices in the layout section %s\n",
+-           count, conf_layout->lay_identifier);
+-    indp = xnfcalloc((count + 1), sizeof(IDevPtr));
+-    indp[count] = NULL;
+-    irp = conf_layout->lay_input_lst;
+-    count = 0;
+-    while (irp) {
+-        indp[count] = xnfalloc(sizeof(IDevRec));
+-	if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
+-            while(count--) 
+-                xfree(indp[count]);
+-            xfree(indp);
+-            return FALSE;
+-	}
+-	indp[count]->extraOptions = irp->iref_option_lst;
+-        count++;
+-        irp = (XF86ConfInputrefPtr)irp->list.next;
+-    }
++
++    if (!configInputDevices(conf_layout, servlayoutp))
++	return FALSE;
++
+     servlayoutp->id = conf_layout->lay_identifier;
+     servlayoutp->screens = slp;
+     servlayoutp->inactives = gdp;
+-    servlayoutp->inputs = indp;
+     servlayoutp->options = conf_layout->lay_option_lst;
+     from = X_DEFAULT;
+ 
+@@ -1743,12 +1773,14 @@
+  * the only active screen.
+  */
+ static Bool
+-configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
++configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
++                    XF86ConfigPtr xf86configptr)
+ {
+     MessageType from;
+     XF86ConfScreenPtr s;
+     screenLayoutPtr slp;
+     IDevPtr *indp;
++    XF86ConfLayoutRec layout;
+ 
+     if (!servlayoutp)
+ 	return FALSE;
+@@ -1784,10 +1816,19 @@
+     servlayoutp->screens = slp;
+     servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec));
+     servlayoutp->options = NULL;
+-    /* Set up an empty input device list, then look for some core devices. */
+-    indp = xnfalloc(sizeof(IDevPtr));
+-    *indp = NULL;
+-    servlayoutp->inputs = indp;
++
++    memset(&layout, 0, sizeof(layout));
++    layout.lay_identifier = servlayoutp->id;
++    if (xf86layoutAddInputDevices(xf86configptr, &layout) > 0) {
++	if (!configInputDevices(&layout, servlayoutp))
++	    return FALSE;
++	from = X_DEFAULT;
++    } else {
++	/* Set up an empty input device list, then look for some core devices. */
++	indp = xnfalloc(sizeof(IDevPtr));
++	*indp = NULL;
++	servlayoutp->inputs = indp;
++    }
+ 
+     return TRUE;
+ }
+@@ -2428,34 +2469,53 @@
+ ConfigStatus
+ xf86HandleConfigFile(Bool autoconfig)
+ {
+-    const char *filename;
+-    char *searchpath;
+-    MessageType from = X_DEFAULT;
++    const char *filename, *dirname;
++    char *filesearch, *dirsearch;
++    MessageType filefrom = X_DEFAULT;
++    MessageType dirfrom = X_DEFAULT;
+     char *scanptr;
+     Bool singlecard = 0;
+     Bool implicit_layout = FALSE;
+ 
+     if (!autoconfig) {
+-	if (getuid() == 0)
+-	    searchpath = ROOT_CONFIGPATH;
+-	else
+-	    searchpath = USER_CONFIGPATH;
++	if (getuid() == 0) {
++	    filesearch = ROOT_CONFIGPATH;
++	    dirsearch = ROOT_CONFIGDIRPATH;
++	} else {
++	    filesearch = USER_CONFIGPATH;
++	    dirsearch = USER_CONFIGDIRPATH;
++	}
+ 
+ 	if (xf86ConfigFile)
+-	    from = X_CMDLINE;
+-
+-	filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
++	    filefrom = X_CMDLINE;
++	if (xf86ConfigDir)
++	    dirfrom = X_CMDLINE;
++
++	xf86initConfigFiles();
++	filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
++	dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
+ 	if (filename) {
+-	    xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
++	    xf86MsgVerb(filefrom, 0, "Using config file: \"%s\"\n", filename);
+ 	    xf86ConfigFile = xnfstrdup(filename);
+ 	} else {
+ 	    if (xf86ConfigFile)
+ 		xf86Msg(X_ERROR, "Unable to locate/open config file: \"%s\"\n",
+ 			xf86ConfigFile);
+-	    return CONFIG_NOFILE;
+ 	}
++	if (dirname) {
++	    xf86MsgVerb(dirfrom, 0, "Using config directory: \"%s\"\n",
++			dirname);
++	    xf86ConfigDir = xnfstrdup(dirname);
++	} else {
++	    if (xf86ConfigDir)
++		xf86Msg(X_ERROR,
++			"Unable to locate/open config directory: \"%s\"\n",
++			xf86ConfigDir);
++	}
++	if (!filename && !dirname)
++	    return CONFIG_NOFILE;
+     }
+-     
++
+     if ((xf86configptr = xf86readConfigFile ()) == NULL) {
+ 	xf86Msg(X_ERROR, "Problem parsing the config file\n");
+ 	return CONFIG_PARSE_ERROR;
+@@ -2481,7 +2541,8 @@
+ 		    "No Layout section.  Using the first Screen section.\n");
+ 	}
+ 	if (!configImpliedLayout(&xf86ConfigLayout,
+-				 xf86configptr->conf_screen_lst)) {
++				 xf86configptr->conf_screen_lst,
++				 xf86configptr)) {
+             xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
+ 	    return CONFIG_PARSE_ERROR;
+ 	}
+Index: xorg-server/hw/xfree86/common/xf86Globals.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/common/xf86Globals.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/common/xf86Globals.c	2010-03-24 13:05:51.000000000 +0200
+@@ -143,6 +143,7 @@
+ #endif
+ };
+ const char *xf86ConfigFile = NULL;
++const char *xf86ConfigDir = NULL;
+ const char *xf86ModulePath = DEFAULT_MODULE_PATH;
+ MessageType xf86ModPathFrom = X_DEFAULT;
+ const char *xf86LogFile = DEFAULT_LOGPREFIX;
+Index: xorg-server/hw/xfree86/common/xf86Init.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/common/xf86Init.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/common/xf86Init.c	2010-03-24 13:05:51.000000000 +0200
+@@ -1373,6 +1373,19 @@
+     xf86ConfigFile = argv[i + 1];
+     return 2;
+   }
++  if (!strcmp(argv[i], "-configdir"))
++  {
++    CHECK_FOR_REQUIRED_ARGUMENT();
++    if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) {
++      FatalError("\nInvalid argument for %s\n"
++	  "\tFor non-root users, the file specified with %s must be\n"
++	  "\ta relative path and must not contain any \"..\" elements.\n"
++	  "\tUsing default "__XCONFIGDIR__" search path.\n\n",
++	  argv[i], argv[i]);
++    }
++    xf86ConfigDir = argv[i + 1];
++    return 2;
++  }
+   if (!strcmp(argv[i],"-flipPixels"))
+   {
+     xf86FlipPixels = TRUE;
+@@ -1656,6 +1669,8 @@
+   }
+   ErrorF("-config file           specify a configuration file, relative to the\n");
+   ErrorF("                       "__XCONFIGFILE__" search path, only root can use absolute\n");
++  ErrorF("-configdir dir         specify a configuration directory, relative to the\n");
++  ErrorF("                       "__XCONFIGDIR__" search path, only root can use absolute\n");
+   ErrorF("-verbose [n]           verbose startup messages\n");
+   ErrorF("-logverbose [n]        verbose log messages\n");
+   ErrorF("-quiet                 minimal startup messages\n");
+Index: xorg-server/hw/xfree86/common/xf86Priv.h
+===================================================================
+--- xorg-server.orig/hw/xfree86/common/xf86Priv.h	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/common/xf86Priv.h	2010-03-24 13:05:51.000000000 +0200
+@@ -46,6 +46,7 @@
+  * The global state of these things is held in xf86InfoRec (when appropriate).
+  */
+ extern _X_EXPORT const char *xf86ConfigFile;
++extern _X_EXPORT const char *xf86ConfigDir;
+ extern _X_EXPORT  Bool xf86AllowMouseOpenFail;
+ #ifdef XF86VIDMODE
+ extern _X_EXPORT  Bool xf86VidModeDisabled;
+Index: xorg-server/hw/xfree86/doc/man/Xorg.man.pre
+===================================================================
+--- xorg-server.orig/hw/xfree86/doc/man/Xorg.man.pre	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/doc/man/Xorg.man.pre	2010-03-24 13:05:51.000000000 +0200
+@@ -109,7 +109,7 @@
+ .B __xservername__
+ supports several mechanisms for supplying/obtaining configuration and
+ run-time parameters: command line options, environment variables, the
+-__xconfigfile__(__filemansuffix__) configuration file, auto-detection, and
++__xconfigfile__(__filemansuffix__) configuration files, auto-detection, and
+ fallback defaults.  When the same information is supplied in more than
+ one way, the highest precedence mechanism is used.  The list of mechanisms
+ is ordered from highest precedence to lowest.  Note that not all parameters
+@@ -176,6 +176,13 @@
+ with real-uid 0), or for files relative to a directory in the config
+ search path for all other users.
+ .TP 8
++.BI \-configdir " directory"
++Read the server configuration files from
++.IR directory .
++This option will work for any directory when the server is run as root
++(i.e, with real-uid 0), or for directories relative to a directory in the
++config directory search path for all other users.
++.TP 8
+ .B \-configure
+ When this option is specified, the
+ .B __xservername__
+@@ -456,6 +463,10 @@
+ .B __xservername__
+ typically uses a configuration file called
+ .B __xconfigfile__
++and configuration files with the suffix
++.I .conf
++in a directory called
++.B __xconfigdir__
+ for its initial setup.
+ Refer to the __xconfigfile__(__filemansuffix__) manual page for information
+ about the format of this file.
+@@ -464,7 +475,9 @@
+ has a mechanism for automatically generating a built-in configuration
+ at run-time when no
+ .B __xconfigfile__
+-file is present.  The current version of this automatic configuration
++file or
++.B __xconfigdir__
++files are present.  The current version of this automatic configuration
+ mechanism works in two ways.
+ .PP
+ The first is via enhancements that have made many components of the
+@@ -486,7 +499,7 @@
+ .SH FILES
+ The
+ .B __xservername__
+-server config file can be found in a range of locations.  These are
++server config files can be found in a range of locations.  These are
+ documented fully in the __xconfigfile__(__filemansuffix__) manual page.  The
+ most commonly used locations are shown here.
+ .TP 30
+@@ -505,6 +518,21 @@
+ .B __projectroot__/lib/X11/__xconfigfile__
+ Server configuration file.
+ .TP 30
++.B /etc/X11/__xconfigdir__
++Server configuration directory.
++.TP 30
++.B /etc/X11/__xconfigdir__-4
++Server configuration directory.
++.TP 30
++.B /etc/__xconfigdir__
++Server configuration directory.
++.TP 30
++.B __projectroot__/etc/__xconfigdir__
++Server configuration directory.
++.TP 30
++.B __projectroot__/lib/X11/__xconfigdir__
++Server configuration directory.
++.TP 30
+ .BI __logdir__/__xservername__. n .log
+ Server log file for display
+ .IR n .
+Index: xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre
+===================================================================
+--- xorg-server.orig/hw/xfree86/doc/man/xorg.conf.man.pre	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre	2010-03-24 13:05:51.000000000 +0200
+@@ -2,27 +2,35 @@
+ .ds q \N'34'
+ .TH __xconfigfile__ __filemansuffix__ __vendorversion__
+ .SH NAME
+-__xconfigfile__ \- configuration File for __xservername__ X server
++__xconfigfile__ and __xconfigdir__ \- configuration files for
++__xservername__ X server
+ .SH INTRODUCTION
+ .B __xservername__
+ supports several mechanisms for supplying/obtaining configuration and
+ run-time parameters: command line options, environment variables, the
+-__xconfigfile__ configuration file, auto-detection, and fallback defaults.
+-When the same information is supplied in more than one way, the highest
+-precedence mechanism is used.  The list of mechanisms is ordered from
+-highest precedence to lowest.  Note that not all parameters can be
+-supplied via all methods.  The available command line options and
+-environment variables (and some defaults) are described in the Xserver(__appmansuffix__)
+-and __xservername__(__appmansuffix__) manual pages.  Most configuration file parameters, with
+-their defaults, are described below.  Driver and module specific
+-configuration parameters are described in the relevant driver or module
+-manual page.
++__xconfigfile__ and __xconfigdir__ configuration files, auto-detection,
++and fallback defaults. When the same information is supplied in more
++than one way, the highest precedence mechanism is used. The list of
++mechanisms is ordered from highest precedence to lowest. Note that not
++all parameters can be supplied via all methods. The available command
++line options and environment variables (and some defaults) are
++described in the Xserver(__appmansuffix__) and
++__xservername__(__appmansuffix__) manual pages. Most configuration file
++parameters, with their defaults, are described below. Driver and module
++specific configuration parameters are described in the relevant driver
++or module manual page.
+ .SH DESCRIPTION
+ .B __xservername__
+ uses a configuration file called
+ .I __xconfigfile__
++and files ending in the suffix
++.I .conf
++from the directory
++.I __xconfigdir__
+ for its initial setup.
+-This configuration file is searched for in the following places when the
++The
++.I __xconfigfile__
++configuration file is searched for in the following places when the
+ server is started as a normal user:
+ .PP
+ .RS 4
+@@ -93,9 +101,28 @@
+ is the machine's hostname as reported by
+ .BR gethostname (__libmansuffix__).
+ .PP
++Additional configuration files are searched for in the following
++directories:
++.PP
++.RS 4
++.nf
++.I /etc/X11/__xconfigdir__\-4
++.I /etc/X11/__xconfigdir__
++.I /etc/__xconfigdir__
++.IR __projectroot__/etc/X11/__xconfigdir__. <hostname>
++.I __projectroot__/etc/X11/__xconfigdir__\-4
++.I __projectroot__/etc/X11/__xconfigdir__
++.IR __projectroot__/lib/X11/__xconfigdir__. <hostname>
++.I __projectroot__/lib/X11/__xconfigdir__\-4
++.I __projectroot__/lib/X11/__xconfigdir__
++.fi
++.RE
++.PP
+ The
+ .I __xconfigfile__
+-file is composed of a number of sections which may be present in any order,
++and
++.I __xconfigdir__
++files are composed of a number of sections which may be present in any order,
+ or omitted to use default configuration values.
+ Each section has the form:
+ .PP
+@@ -853,6 +880,11 @@
+ See the individual input driver manual pages for a description of the
+ device\-specific options.
+ .TP 7
++.BI "Option \*qAutoServerLayout\*q  \*q" boolean \*q
++Always add the device to the ServerLayout section used by this instance of
++the server. This affects implied layouts as well as explicit layouts
++specified in the configuration and/or on the command line.
++.TP 7
+ .BI "Option \*qCorePointer\*q"
+ Deprecated, use
+ .B SendCoreEvents
+Index: xorg-server/hw/xfree86/parser/Layout.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/parser/Layout.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/parser/Layout.c	2010-03-24 13:05:51.000000000 +0200
+@@ -64,6 +64,10 @@
+ #include "Configint.h"
+ #include <string.h>
+ 
++
++/* Needed for auto server layout */
++extern int xf86CheckBoolOption(void* optlist, const char *name, int deflt);
++
+ extern LexRec val;
+ 
+ static xf86ConfigSymTabRec LayoutTab[] =
+@@ -450,15 +454,67 @@
+ }
+ 
+ int
++xf86layoutAddInputDevices(XF86ConfigPtr config, XF86ConfLayoutPtr layout)
++{
++    int count = 0;
++    XF86ConfInputPtr input = config->conf_input_lst;
++    XF86ConfInputrefPtr inptr;
++
++    /* add all AutoServerLayout devices to the server layout */
++    while (input)
++    {
++	if (xf86CheckBoolOption(input->inp_option_lst, "AutoServerLayout", FALSE))
++	{
++	    XF86ConfInputrefPtr iref = layout->lay_input_lst;
++
++	    /* avoid duplicates if referenced but lists AutoServerLayout too */
++	    while (iref)
++	    {
++		if (strcmp(iref->iref_inputdev_str, input->inp_identifier) == 0)
++		    break;
++		iref = iref->list.next;
++	    }
++
++	    if (!iref)
++	    {
++		XF86ConfInputrefPtr iptr;
++		iptr = calloc(1, sizeof(XF86ConfInputrefRec));
++		iptr->iref_inputdev_str = input->inp_identifier;
++		layout->lay_input_lst = (XF86ConfInputrefPtr)
++		    xf86addListItem((glp)layout->lay_input_lst, (glp)iptr);
++		count++;
++	    }
++	}
++	input = input->list.next;
++    }
++
++    inptr = layout->lay_input_lst;
++    while (inptr)
++    {
++	input = xf86findInput (inptr->iref_inputdev_str,
++		config->conf_input_lst);
++	if (!input)
++	{
++	    xf86validationError (UNDEFINED_INPUT_MSG,
++		    inptr->iref_inputdev_str, layout->lay_identifier);
++	    return -1;
++	}
++	else
++	    inptr->iref_inputdev = input;
++	inptr = inptr->list.next;
++    }
++
++    return count;
++}
++
++int
+ xf86validateLayout (XF86ConfigPtr p)
+ {
+ 	XF86ConfLayoutPtr layout = p->conf_layout_lst;
+ 	XF86ConfAdjacencyPtr adj;
+ 	XF86ConfInactivePtr iptr;
+-	XF86ConfInputrefPtr inptr;
+ 	XF86ConfScreenPtr screen;
+ 	XF86ConfDevicePtr device;
+-	XF86ConfInputPtr input;
+ 
+ 	while (layout)
+ 	{
+@@ -500,21 +556,10 @@
+ 				iptr->inactive_device = device;
+ 			iptr = iptr->list.next;
+ 		}
+-		inptr = layout->lay_input_lst;
+-		while (inptr)
+-		{
+-			input = xf86findInput (inptr->iref_inputdev_str,
+-									p->conf_input_lst);
+-			if (!input)
+-			{
+-				xf86validationError (UNDEFINED_INPUT_MSG,
+-						inptr->iref_inputdev_str, layout->lay_identifier);
+-				return (FALSE);
+-			}
+-			else
+-				inptr->iref_inputdev = input;
+-			inptr = inptr->list.next;
+-		}
++
++		if (xf86layoutAddInputDevices(p, layout) == -1)
++		    return FALSE;
++
+ 		layout = layout->list.next;
+ 	}
+ 	return (TRUE);
+Index: xorg-server/hw/xfree86/parser/scan.c
+===================================================================
+--- xorg-server.orig/hw/xfree86/parser/scan.c	2010-03-24 13:01:50.000000000 +0200
++++ xorg-server/hw/xfree86/parser/scan.c	2010-03-24 13:05:51.000000000 +0200
+@@ -62,8 +62,11 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/types.h>
++#include <dirent.h>
+ #include <unistd.h>
+ #include <stdarg.h>
++#include <X11/Xdefs.h>
+ #include <X11/Xfuncproto.h>
+ 
+ #if defined(_POSIX_SOURCE)
+@@ -90,17 +93,24 @@
+ #include "xf86tokens.h"
+ 
+ #define CONFIG_BUF_LEN     1024
++#define CONFIG_MAX_FILES   64
+ 
+ static int StringToToken (char *, xf86ConfigSymTabRec *);
+ 
+-static FILE *configFile = NULL;
++static struct {
++	FILE *file;
++	char *path;
++} configFiles[CONFIG_MAX_FILES];
+ static const char **builtinConfig = NULL;
+ static int builtinIndex = 0;
+ static int configPos = 0;		/* current readers position */
+ static int configLineNo = 0;	/* linenumber */
+ static char *configBuf, *configRBuf;	/* buffer for lines */
+ static char *configPath;		/* path to config file */
++static char *configDirPath;		/* path to config dir */
+ static char *configSection = NULL;	/* name of current section being parsed */
++static int numFiles = 0;		/* number of config files */
++static int curFileIndex = 0;		/* index of current config file */
+ static int pushToken = LOCK_TOKEN;
+ static int eol_seen = 0;		/* private state to handle comments */
+ LexRec val;
+@@ -155,7 +165,7 @@
+ /*
+  * xf86getNextLine --
+  *
+- *  read from the configFile FILE stream until we encounter a new
++ *  read from the configFiles FILE stream until we encounter a new
+  *  line; this is effectively just a big wrapper for fgets(3).
+  *
+  *  xf86getToken() assumes that we will read up to the next
+@@ -213,9 +223,18 @@
+ 	/* read in another block of chars */
+ 
+ 	do {
+-		ret = fgets(configBuf + pos, configBufLen - pos - 1, configFile);
++		ret = fgets(configBuf + pos, configBufLen - pos - 1,
++			    configFiles[curFileIndex].file);
+ 
+-		if (!ret) break;
++		if (!ret) {
++			/* stop if there are no more files */
++			if (++curFileIndex >= numFiles) {
++				curFileIndex = 0;
++				break;
++			}
++			configLineNo = 0;
++			continue;
++		}
+ 
+ 		/* search for EOL in the new block of chars */
+ 
+@@ -306,7 +325,7 @@
+ 		if (!c)
+ 		{
+ 			char *ret;
+-			if (configFile)
++			if (numFiles > 0)
+ 				ret = xf86getNextLine();
+ 			else {
+ 				if (builtinConfig[builtinIndex] == NULL)
+@@ -575,6 +594,12 @@
+ #ifndef XCONFIGFILE
+ #define XCONFIGFILE	"xorg.conf"
+ #endif
++#ifndef XCONFIGDIR
++#define XCONFIGDIR	"xorg.conf.d"
++#endif
++#ifndef XCONFIGSUFFIX
++#define XCONFIGSUFFIX	".conf"
++#endif
+ #ifndef PROJECTROOT
+ #define PROJECTROOT	"/usr/X11R6"
+ #endif
+@@ -616,7 +641,8 @@
+ 
+ static char *
+ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
+-				int *cmdlineUsed, int *envUsed, char *XConfigFile)
++				int *cmdlineUsed, int *envUsed,
++				const char *XConfigFile)
+ {
+ 	char *result;
+ 	int i, l;
+@@ -745,7 +771,164 @@
+ 	return result;
+ }
+ 
+-/* 
++/*
++ * Given some searching parameters, locate and open the xorg config file.
++ */
++static char *
++OpenConfigFile(const char *path, const char *cmdline, const char *projroot,
++	       const char *confname)
++{
++	char *filepath = NULL;
++	char *pathcopy;
++	const char *template;
++	int cmdlineUsed = 0;
++	FILE *file = NULL;
++
++	pathcopy = strdup(path);
++	for (template = strtok(pathcopy, ","); template && !file;
++	     template = strtok(NULL, ",")) {
++		filepath = DoSubstitution(template, cmdline, projroot,
++					  &cmdlineUsed, NULL, confname);
++		if (!filepath)
++			continue;
++		if (cmdline && !cmdlineUsed) {
++			free(filepath);
++			filepath = NULL;
++			continue;
++		}
++		file = fopen(filepath, "r");
++		if (!file) {
++			free(filepath);
++			filepath = NULL;
++		}
++	}
++
++	if (file) {
++		configFiles[numFiles].file = file;
++		configFiles[numFiles].path = strdup(filepath);
++		numFiles++;
++	}
++	return filepath;
++}
++
++/*
++ * Match non-hidden files in the xorg config directory with a .conf
++ * suffix. This filter is passed to scandir(3).
++ */
++static int
++ConfigFilter(const struct dirent *de)
++{
++	const char *name = de->d_name;
++	size_t len = strlen(name);
++	size_t suflen = strlen(XCONFIGSUFFIX);
++
++	if (!name || name[0] == '.' || len <= suflen)
++		return 0;
++	if (strcmp(&name[len-suflen], XCONFIGSUFFIX) != 0)
++		return 0;
++	return 1;
++}
++
++static Bool
++AddConfigDirFiles(const char *dirpath, struct dirent **list, int num)
++{
++	int i;
++	Bool openedFile = FALSE;
++	Bool warnOnce = FALSE;
++
++	for (i = 0; i < num; i++) {
++		char *path;
++		FILE *file;
++
++		if (numFiles >= CONFIG_MAX_FILES) {
++			if (!warnOnce) {
++				ErrorF("Maximum number of configuration "
++				       "files opened\n");
++				warnOnce = TRUE;
++			}
++			free(list[i]);
++			continue;
++		}
++
++		path = malloc(PATH_MAX + 1);
++		snprintf(path, PATH_MAX + 1, "%s/%s", dirpath,
++			 list[i]->d_name);
++		free(list[i]);
++		file = fopen(path, "r");
++		if (!file) {
++			free(path);
++			continue;
++		}
++		openedFile = TRUE;
++


Reply to: