[Xquartz-changes] xserver: Branch 'master' - 65 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Wed Mar 23 09:12:36 PDT 2011


 Xext/panoramiX.c                   |   26 
 Xext/panoramiX.h                   |    4 
 Xext/panoramiXprocs.c              |   50 
 Xext/panoramiXsrv.h                |   23 
 Xext/shm.c                         |    6 
 Xext/xvdisp.c                      |    4 
 Xext/xvdix.h                       |   12 
 Xext/xvmain.c                      |   14 
 Xext/xvmc.c                        |    6 
 Xi/exglobals.h                     |    2 
 Xi/extinit.c                       |    2 
 Xi/xipassivegrab.c                 |    4 
 Xi/xiproperty.c                    |    4 
 composite/compext.c                |    5 
 config/hal.c                       |    6 
 config/udev.c                      |    6 
 configure.ac                       |   70 -
 dix/Makefile.am                    |    1 
 dix/deprecated.c                   |  165 --
 dix/devices.c                      |    2 
 dix/eventconvert.c                 |    3 
 dix/events.c                       |   10 
 dix/getevents.c                    |   38 
 dix/ptrveloc.c                     |  217 +--
 dix/window.c                       |    4 
 fb/fbpict.c                        |    4 
 glx/glapi.c                        |  209 ---
 glx/glapi.h                        |   24 
 glx/glthread.c                     |  162 --
 glx/glthread.h                     |   71 -
 glx/glxdri.c                       |   44 
 glx/glxdri2.c                      |   39 
 glx/glxdricommon.c                 |   57 
 glx/glxdricommon.h                 |    5 
 glx/glxdriswrast.c                 |   50 
 hw/dmx/dmx.h                       |    2 
 hw/dmx/dmxcb.c                     |    7 
 hw/dmx/dmxextension.c              |    4 
 hw/dmx/dmxgcops.c                  |    2 
 hw/dmx/dmxpict.c                   |   87 -
 hw/dmx/dmxpict.h                   |   10 
 hw/dmx/doc/Makefile.am             |    7 
 hw/xfree86/Makefile.am             |    6 
 hw/xfree86/common/xf86Config.c     |    4 
 hw/xfree86/common/xf86Configure.c  |    5 
 hw/xfree86/common/xf86Xinput.c     |    3 
 hw/xfree86/doc/Makefile.am         |    2 
 hw/xfree86/doc/man/Makefile.am     |    3 
 hw/xfree86/doc/man/Xorg.man        |  689 ----------
 hw/xfree86/doc/man/xorg.conf.d.man |    1 
 hw/xfree86/doc/man/xorg.conf.man   | 2478 ------------------------------------
 hw/xfree86/loader/Makefile.am      |    9 
 hw/xfree86/man/Makefile.am         |    3 
 hw/xfree86/man/Xorg.man            |  689 ++++++++++
 hw/xfree86/man/xorg.conf.d.man     |    1 
 hw/xfree86/man/xorg.conf.man       | 2485 +++++++++++++++++++++++++++++++++++++
 hw/xfree86/modes/xf86Crtc.c        |   21 
 hw/xfree86/os-support/xf86_OSlib.h |   11 
 hw/xfree86/parser/scan.c           |   11 
 hw/xfree86/vbe/vbe.c               |    2 
 include/dix-config.h.in            |    3 
 include/dix.h                      |   31 
 include/input.h                    |   12 
 include/misc.h                     |   16 
 include/propertyst.h               |    4 
 include/ptrveloc.h                 |   26 
 include/resource.h                 |   31 
 include/xkbsrv.h                   |    5 
 mi/mipointer.c                     |   12 
 mi/mipointer.h                     |    1 
 mi/misprite.c                      |   41 
 miext/cw/cw.h                      |    2 
 miext/cw/cw_render.c               |   64 
 os/access.c                        |   19 
 os/osinit.c                        |    9 
 os/utils.c                         |   11 
 os/xdmcp.c                         |    2 
 randr/randr.c                      |    2 
 randr/randrstr.h                   |    4 
 randr/rrcrtc.c                     |  155 ++
 record/record.c                    |    1 
 render/mipict.c                    |   64 
 render/mipict.h                    |   27 
 render/mitri.c                     |   64 
 render/picture.c                   |   45 
 render/picturestr.h                |    2 
 render/render.c                    |   27 
 test/.gitignore                    |    2 
 test/Makefile.am                   |    9 
 test/list.c                        |  176 ++
 test/xi2/Makefile.am               |    6 
 xkb/XKBAlloc.c                     |   19 
 xkb/ddxLoad.c                      |   22 
 xkb/xkb.c                          |   34 
 xkb/xkbActions.c                   |   11 
 95 files changed, 4098 insertions(+), 4752 deletions(-)

New commits:
commit c55baebf4ebf1887262cc16899eb297b9f284f6e
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Mar 22 19:01:48 2011 -0700

    GLX: Support TLS with better portability
    
    AX_TLS detects when toolchains support __thread or __declspec(thread),
    but existing code assumed __thread.
    
    This also adds a check to configure.ac to error out if TLS is requested
    but unsupported.
    
    Found-by: Tinderbox
    http://tinderbox.x.org/builds/2011-03-22-0007
    
    Regression-from: 82b1eaa6cad20f39dbf15573bdb3d62acbcd91f9
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Reviewed-by: Tom Fogal <tfogal at alumni.unh.edu>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/configure.ac b/configure.ac
index b681163..9e04ff0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -590,7 +590,10 @@ AC_ARG_ENABLE(aiglx,          AS_HELP_STRING([--enable-aiglx], [Build accelerate
                                 [AIGLX=yes])
 AX_TLS
 AC_ARG_ENABLE(glx-tls,        AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
-                                [GLX_USE_TLS=$enableval],
+                                [GLX_USE_TLS=$enableval
+                                 if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
+                                   AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
+                                 fi],
                                 [GLX_USE_TLS=no
                                  if test "${ac_cv_tls}" != "none" ; then
                                    GLX_USE_TLS=yes
diff --git a/glx/glapi.c b/glx/glapi.c
index 209ae50..19576a7 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -184,11 +184,11 @@ static GLint NoOpUnused(void)
 /*@{*/
 #if defined(GLX_USE_TLS)
 
-PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch
+PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch
     __attribute__((tls_model("initial-exec")))
     = (struct _glapi_table *) __glapi_noop_table;
 
-PUBLIC __thread void * _glapi_tls_Context
+PUBLIC TLS void * _glapi_tls_Context
     __attribute__((tls_model("initial-exec")));
 
 PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL;
diff --git a/glx/glapi.h b/glx/glapi.h
index 80b53aa..dec8328 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -83,7 +83,7 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
 const extern void *_glapi_Context;
 const extern struct _glapi_table *_glapi_Dispatch;
 
-extern __thread void * _glapi_tls_Context
+extern TLS void * _glapi_tls_Context
     __attribute__((tls_model("initial-exec")));
 
 # define GET_CURRENT_CONTEXT(C)  GLcontext *C = (GLcontext *) _glapi_tls_Context
diff --git a/glx/glthread.h b/glx/glthread.h
index 28793fc..140e2aa 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -233,7 +233,7 @@ _glthread_SetTSD(_glthread_TSD *, void *);
 
 #if defined(GLX_USE_TLS)
 
-extern __thread struct _glapi_table * _glapi_tls_Dispatch
+extern TLS struct _glapi_table * _glapi_tls_Dispatch
     __attribute__((tls_model("initial-exec")));
 
 #define GET_DISPATCH() _glapi_tls_Dispatch
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index fc93f3e..fd9ecce 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -444,6 +444,9 @@
 /* Define to 1 if you have the `ffs' function. */
 #undef HAVE_FFS
 
+/* If the compiler supports a TLS storage class define it to that here */
+#undef TLS
+
 /* Correctly set _XSERVER64 for OSX fat binaries */
 #ifdef __APPLE__
 #include "dix-config-apple-verbatim.h"
commit 03f45df93469f6aef391e97007b9614e0770cc4c
Merge: efcb727... 5fb329a...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Mar 23 13:38:37 2011 +0900

    Merge remote-tracking branch 'airlied/xinerama-cleanup'

commit efcb7275ce5de651f91ba4ff8bb227dfb68bb154
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Mar 17 19:26:37 2011 -0400

    test: git ignore the list test executable
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/.gitignore b/test/.gitignore
index db8c5f3..86e687f 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,7 +1,7 @@
-#		Add & Override for this directory and it's subdirectories
 libxservertest.c
 
 input
+list
 xkb
 xtest
 xi2/protocol-eventconvert
commit 6a5bf15fa99cf5b2358b3b3e2f29e5044aa8724a
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Mar 17 19:26:36 2011 -0400

    Add generalized unit test support using util-macros.
    
    A handful of modules have begun adding unit test programs.
    These macros will help providing a consistent interface which will
    help package builders and developers to manage the functionality.
    
    XORG_ENABLE_UNIT_TESTS will turn on/off unit testing, regardless
    of how it is implemented. The default (yes/no) can be specified by each
    module. It can be used by itself if glib or -wrap support is not needed.
    
    XORG_WITH_GLIB will probe the system for glib-2.0. A different version
    can be specified in each module. It will consult XORG_ENABLE_UNIT_TESTS
    but can be used by itself in contexts other then unit testing.
    The default (yes/no) can be specified by each module.
    
    XORG_LD_WRAP will probe the linker for -wrap support. It will consult
    XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts
    other then unit testing.
    
    configure options:
      --enable-unit-tests     Enable building unit test cases (default: auto)
      --with-glib             Use GLib library for unit testing (default: auto)
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 345c167..b681163 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,9 +32,9 @@ AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Require xorg-macros minimum of 1.10 for XORG_CHECK_SGML_DOCTOOLS
+# Require xorg-macros minimum of 1.13 for XORG_ENABLE_UNIT_TESTS
 m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
+          [m4_fatal([must install xorg-macros 1.13 or later before running autoconf/autogen])])
 XORG_MACROS_VERSION(1.10)
 XORG_DEFAULT_OPTIONS
 XORG_WITH_DOXYGEN(1.6.1)
@@ -43,6 +43,9 @@ XORG_ENABLE_DOCS
 XORG_ENABLE_DEVEL_DOCS
 XORG_WITH_XMLTO(0.0.20)
 XORG_WITH_FOP
+XORG_ENABLE_UNIT_TESTS
+XORG_WITH_GLIB
+XORG_LD_WRAP
 
 m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])])
 XORG_FONT_MACROS_VERSION(1.1)
@@ -458,9 +461,6 @@ AC_ARG_ENABLE(werror,        AS_HELP_STRING([--enable-werror],
 AC_ARG_ENABLE(debug,         AS_HELP_STRING([--enable-debug],
 				  [Enable debugging (default: disabled)]),
 			        [DEBUGGING=$enableval], [DEBUGGING=no])
-AC_ARG_ENABLE(unit-tests,    AS_HELP_STRING([--enable-unit-tests],
-                                  [Enable unit-tests (default: auto)]),
-                                [UNITTESTS=$enableval], [UNITTESTS=auto])
 AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default]
   [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]),
                                 [USE_SIGIO_BY_DEFAULT=$enableval], [])
@@ -1270,50 +1270,6 @@ if test "x$DEBUGGING" = xyes; then
 fi
 AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
 
-# If unittests aren't explicitly disabled, check for required support
-if test "x$UNITTESTS" != xno ; then
-       PKG_CHECK_MODULES([GLIB], $LIBGLIB,
-                         [HAVE_GLIB=yes], [HAVE_GLIB=no])
-
-       # Check if linker supports -wrap, passed via compiler flags
-       # When cross-compiling, reports no, since unit tests run from
-       # "make check", so would be running on build machine,  not target
-       AC_MSG_CHECKING([whether the linker supports -wrap])
-       save_LDFLAGS="$LDFLAGS"
-       LDFLAGS="$LDFLAGS -Wl,-wrap,exit"
-       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-	void __wrap_exit (int s)
-	{
-	    __real_exit (0);
-	}]],
-	[[exit (1);]])],
-                     [linker_can_wrap="yes"],
-                     [linker_can_wrap="no"],
-                     [linker_can_wrap="no"])
-       AC_MSG_RESULT([$linker_can_wrap])
-       LDFLAGS="$save_LDFLAGS"
-fi
-
-if test "x$UNITTESTS" = xauto; then
-       if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then
-           UNITTESTS=yes
-       else
-           UNITTESTS=no
-       fi
-fi
-if test "x$UNITTESTS" = xyes; then
-       if test "x$HAVE_GLIB" = xno; then
-           AC_MSG_ERROR([glib required to build unit tests])
-       fi
-       if test "x$linker_can_wrap" = xno; then
-           AC_MSG_ERROR([ld -wrap support required to build unit tests])
-       fi
-       AC_DEFINE(UNITTESTS, 1, [Enable unit tests])
-       AC_SUBST([GLIB_LIBS])
-       AC_SUBST([GLIB_CFLAGS])
-fi
-AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes])
-
 AC_DEFINE(XTEST, 1, [Support XTest extension])
 AC_DEFINE(XSYNC, 1, [Support XSync extension])
 AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
diff --git a/test/Makefile.am b/test/Makefile.am
index be54e5f..34f21d7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,6 @@
-if UNITTESTS
+if ENABLE_UNIT_TESTS
+if HAVE_GLIB
+if HAVE_LD_WRAP
 SUBDIRS= . xi2
 check_PROGRAMS = xkb input xtest list
 check_LTLIBRARIES = libxservertest.la
@@ -35,6 +37,8 @@ libxservertest_la_LIBADD = \
             $(top_builddir)/os/libos.la \
             @XORG_LIBS@
 endif
+endif
+endif
 
 CLEANFILES=libxservertest.c
 
diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am
index d8dc7e9..e197869 100644
--- a/test/xi2/Makefile.am
+++ b/test/xi2/Makefile.am
@@ -1,4 +1,6 @@
-if UNITTESTS
+if ENABLE_UNIT_TESTS
+if HAVE_GLIB
+if HAVE_LD_WRAP
 check_PROGRAMS =  \
 	protocol-xiqueryversion \
 	protocol-xiquerydevice \
@@ -49,3 +51,5 @@ protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointe
 protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c
 protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c
 endif
+endif
+endif
commit ee583cb33423fa79beb22db20b30e10a677f9b5a
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Mar 17 19:26:35 2011 -0400

    config: group document related XORG_ macros together
    
    No functional changes.
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 7eb4151..345c167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,10 @@ XORG_MACROS_VERSION(1.10)
 XORG_DEFAULT_OPTIONS
 XORG_WITH_DOXYGEN(1.6.1)
 XORG_CHECK_SGML_DOCTOOLS(1.5)
+XORG_ENABLE_DOCS
+XORG_ENABLE_DEVEL_DOCS
+XORG_WITH_XMLTO(0.0.20)
+XORG_WITH_FOP
 
 m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])])
 XORG_FONT_MACROS_VERSION(1.1)
@@ -698,11 +702,6 @@ if test "x$INT10" = xyes; then
 	AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
 fi
 
-XORG_ENABLE_DOCS
-XORG_ENABLE_DEVEL_DOCS
-XORG_WITH_XMLTO(0.0.20)
-XORG_WITH_FOP
-
 dnl Handle installing libxf86config
 AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
 
commit d5b16b037b8fe12ba85c68c8289b6a8cc5e3a09d
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Mar 17 23:48:52 2011 -0700

    Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"
    
    This reverts commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad.
    
    The drivers used the top bits of the usage_hint to store driver
    private flags (intel, radeon, nouveau).
    
    With EXA we need to get at this data so if we migrate the pixmap we
    can create the correct type of pixmap in the driver, however this
    commit truncates the usage_hint into 8-bit class and loses all the
    good stuff.
    
    Signed-off-by: Dave Airlie <airlied at gmail.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa.h b/exa/exa.h
index 6de6300..8c93d15 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -712,7 +712,7 @@ typedef struct _ExaDriver {
      * driver MUST fill out new_fb_pitch with valid pitch of pixmap
      */
     void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
-			   int depth, int class, int bitsPerPixel,
+			   int depth, int usage_hint, int bitsPerPixel,
 			   int *new_fb_pitch);
     /** @} */
 } ExaDriverRec, *ExaDriverPtr;
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 640b26a..169ce3a 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -54,7 +54,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class)
+		unsigned usage_hint)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -66,7 +66,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, class);
+    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, usage_hint);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index 4d2a1a5..b9903d1 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -48,7 +48,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class)
+		unsigned usage_hint)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -60,7 +60,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
@@ -78,7 +78,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
+	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     }
     else {
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index a563357..fb47151 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -39,7 +39,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
     ExaPixmapPriv(pPixmap);
     int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
     int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
-    int class = pPixmap->drawable.class;
+    int usage_hint = pPixmap->usage_hint;
     int paddedWidth = pExaPixmap->sys_pitch;
 
     /* Already done. */
@@ -55,7 +55,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
+        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     } else {
 	if (paddedWidth < pExaPixmap->fb_pitch)
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 24fce76..fd1afb2 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -47,7 +47,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class)
+		unsigned usage_hint)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -59,7 +59,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 1f6dede..e5d90d4 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -588,7 +588,7 @@ extern const GCFuncs exaGCFuncs;
 /* exa_classic.c */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class);
+		unsigned usage_hint);
 
 Bool
 exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
@@ -603,7 +603,7 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
 /* exa_driver.c */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class);
+		unsigned usage_hint);
 
 Bool
 exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
@@ -618,7 +618,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
 /* exa_mixed.c */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned class);
+		unsigned usage_hint);
 
 Bool
 exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
diff --git a/fb/fb.h b/fb/fb.h
index d905219..021a940 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1625,11 +1625,11 @@ fbPictureInit (ScreenPtr pScreen,
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned class);
+		   unsigned usage_hint);
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned class);
+		unsigned usage_hint);
 
 extern _X_EXPORT Bool
 fbDestroyPixmap (PixmapPtr pPixmap);
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index e24f394..2e600ed 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -546,7 +546,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
     pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
 				     pOldTile->drawable.height,
 				     pOldTile->drawable.depth,
-				     pOldTile->drawable.class);
+				     pOldTile->usage_hint);
     if (!pNewTile)
 	return 0;
     fbGetDrawable (&pOldTile->drawable, 
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index 232de82..41b12ce 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -30,7 +30,7 @@
 
 PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned class)
+		   unsigned usage_hint)
 {
     PixmapPtr	pPixmap;
     size_t	datasize;
@@ -54,7 +54,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     if (!pPixmap)
 	return NullPixmap;
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = class;
+    pPixmap->drawable.class = 0;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -78,12 +78,14 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     pPixmap->screen_y = 0;
 #endif
 
+    pPixmap->usage_hint = usage_hint;
+
     return pPixmap;
 }
 
 PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned class)
+		unsigned usage_hint)
 {
     int	bpp;
     bpp = BitsPerPixel (depth);
@@ -91,7 +93,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
     if (bpp == 32 && depth <= 24)
 	bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
 #endif
-    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, class);
+    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
 }
 
 Bool
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index a167364..81b7115 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -82,7 +82,7 @@ void dmxBECreatePixmap(PixmapPtr pPixmap)
 /** Create a pixmap for \a pScreen with the specified \a width, \a
  *  height, and \a depth. */
 PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned class)
+			  unsigned usage_hint)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
     PixmapPtr      pPixmap;
@@ -104,7 +104,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
 	return NullPixmap;
 
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = class;
+    pPixmap->drawable.class = 0;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -116,6 +116,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
     pPixmap->drawable.height = height;
     pPixmap->devKind = PixmapBytePad(width, bpp);
     pPixmap->refcnt = 1;
+    pPixmap->usage_hint = usage_hint;
 
     pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
     pPixPriv->pixmap = (Pixmap)0;
diff --git a/hw/dmx/dmxpixmap.h b/hw/dmx/dmxpixmap.h
index 4b4a8b2..59da788 100644
--- a/hw/dmx/dmxpixmap.h
+++ b/hw/dmx/dmxpixmap.h
@@ -50,7 +50,7 @@ extern Bool      dmxInitPixmap(ScreenPtr pScreen);
 
 extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen,
 				 int width, int height, int depth,
-				 unsigned class);
+				 unsigned usage_hint);
 extern Bool      dmxDestroyPixmap(PixmapPtr pPixmap);
 extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index c5ebb27..215e845 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -369,13 +369,13 @@ VGAarbiterClearToBackground (
 }
 
 static PixmapPtr
-VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
+VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 {
     PixmapPtr pPix;
 
     SCREEN_PROLOG ( CreatePixmap);
     VGAGet(pScreen);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
     VGAPut();
     SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index e1ac20f..848e45d 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -155,7 +155,7 @@ static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
 static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
     int h, Bool generateExposures);
 static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
-    int depth, unsigned int class);
+    int depth, unsigned int usage_hint);
 static Bool  VGAarbiterCreateGC(GCPtr pGC);
 static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
 static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index dcbd5ab..11443a6 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -34,7 +34,7 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
 static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
 			int *pwidth, int nspans, char *pdstStart);
 static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
-				 unsigned class);
+				 unsigned usage_hint);
 static Bool XAADestroyPixmap(PixmapPtr pPixmap);
 static Bool XAAEnterVT (int index, int flags);
 static void XAALeaveVT (int index, int flags);
@@ -331,7 +331,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen)
 }
 
 static PixmapPtr 
-XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
+XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 {
     XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -346,7 +346,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 	XAAInitializeOffscreenDepths (pScreen);
 
     if(pScrn->vtSema &&
-	(class != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
+	(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
 	(infoRec->offscreenDepths & (1 << (depth - 1))) &&
 	(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
 	(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
@@ -379,7 +379,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 	}
 
 	XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, class);
+	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint);
 	XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
 	if (!pPix) {
@@ -411,7 +411,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
     }
 BAILOUT:
     XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
     XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
     if(pPix) {
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index c901db1..3a92ffd 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -37,7 +37,7 @@ DevPrivateKeyRec xnestPixmapPrivateKeyRec;
 
 PixmapPtr
 xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-		  unsigned class)
+		  unsigned usage_hint)
 {
   PixmapPtr pPixmap;
 
@@ -45,7 +45,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   if (!pPixmap)
     return NullPixmap;
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = class;
+  pPixmap->drawable.class = 0;
   pPixmap->drawable.depth = depth;
   pPixmap->drawable.bitsPerPixel = depth;
   pPixmap->drawable.id = 0;
@@ -57,6 +57,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
   pPixmap->refcnt = 1;
   pPixmap->devKind = PixmapBytePad(width, depth);
+  pPixmap->usage_hint = usage_hint;
   if (width && height)
       xnestPixmapPriv(pPixmap)->pixmap = 
 	  XCreatePixmap(xnestDisplay, 
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index 638a43a..aa671ed 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -30,7 +30,7 @@ typedef struct {
 #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
 
 PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
-			    int depth, unsigned class);
+			    int depth, unsigned usage_hint);
 Bool xnestDestroyPixmap(PixmapPtr pPixmap);
 RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 606645f..3f40fdb 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1069,7 +1069,7 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
 
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned class);
+			  unsigned usage_hint);
 
 Bool
 winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
index 62717f3..8bd8e34 100644
--- a/hw/xwin/winpixmap.c
+++ b/hw/xwin/winpixmap.c
@@ -57,7 +57,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen,
 			  int iWidth, int iHeight,
-			  int iDepth, unsigned class)
+			  int iDepth, unsigned usage_hint)
 {
   winPrivPixmapPtr	pPixmapPriv = NULL;
   PixmapPtr		pPixmap = NULL;
@@ -72,13 +72,13 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
 
 #if CYGDEBUG
   winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
-	  iWidth, iHeight, iDepth, class,
+	  iWidth, iHeight, iDepth, usage_hint,
 	  PixmapBytePad (iWidth, iDepth));
 #endif
 
   /* Setup pixmap values */
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = class;
+  pPixmap->drawable.class = 0;
   pPixmap->drawable.pScreen = pScreen;
   pPixmap->drawable.depth = iDepth;
   pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
@@ -91,6 +91,7 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
   pPixmap->devKind = 0;
   pPixmap->refcnt = 1;
   pPixmap->devPrivate.ptr = NULL;
+  pPixmap->usage_hint = usage_hint;
 
   /* Pixmap privates are allocated by AllocatePixmap */
   pPixmapPriv = winGetPixmapPriv (pPixmap);
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 542c381..702faf0 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -80,6 +80,7 @@ typedef struct _Pixmap {
     short		screen_x;
     short		screen_y;
 #endif
+    unsigned		usage_hint; /* see CREATE_PIXMAP_USAGE_* */
 } PixmapRec;
 
 #endif /* PIXMAPSTRUCT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 302a561..a9357e8 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -208,7 +208,7 @@ typedef    PixmapPtr (* CreatePixmapProcPtr)(
 	int /*width*/,
 	int /*height*/,
 	int /*depth*/,
-	unsigned /*class*/);
+	unsigned /*usage_hint*/);
 
 typedef    Bool (* DestroyPixmapProcPtr)(
 	PixmapPtr /*pPixmap*/);
commit dc9ce695a69ca0787f58f8d160212a7a41acb703
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Wed Mar 9 15:45:40 2011 +0200

    xkb: Initialize pad bytes sent in replies of geometry requests.
    
    Valgrind complains about uninitialized data being written to clients.
    
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 4786489..4044d33 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -4321,7 +4321,7 @@ ProcXkbSetNames(ClientPtr client)
 static char *
 XkbWriteCountedString(char *wire,char *str,Bool swap)
 {
-    CARD16 len,*pLen;
+    CARD16 len,*pLen, paddedLen;
 
     if (!str)
         return wire;
@@ -4333,8 +4333,9 @@ XkbWriteCountedString(char *wire,char *str,Bool swap)
 	register int n;
 	swaps(pLen,n);
     }
-    memcpy(&wire[2],str,len);
-    wire+= ((2+len+3)/4)*4;
+    paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len);
+    strncpy(&wire[sizeof(len)],str,paddedLen);
+    wire+= sizeof(len)+paddedLen;
     return wire;
 }
 
@@ -4445,6 +4446,7 @@ xkbShapeWireDesc *	shapeWire;
 	if (shape->approx!=NULL)
 	     shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx);
 	else shapeWire->approxNdx= XkbNoShape;
+	shapeWire->pad= 0;
 	if (swap) {
 	    register int n;
 	    swapl(&shapeWire->name,n);
@@ -4457,6 +4459,7 @@ xkbShapeWireDesc *	shapeWire;
 	    olWire= (xkbOutlineWireDesc *)wire;
 	    olWire->nPoints= ol->num_points;
 	    olWire->cornerRadius= ol->corner_radius;
+	    olWire->pad= 0;
 	    wire= (char *)&olWire[1];
 	    ptWire= (xkbPointWireDesc *)wire;
 	    for (p=0,pt=ol->points;p<ol->num_points;p++,pt++) {
@@ -4570,6 +4573,8 @@ xkbOverlayWireDesc *	olWire;
    olWire= (xkbOverlayWireDesc *)wire;
    olWire->name= ol->name;
    olWire->nRows= ol->num_rows;
+   olWire->pad1= 0;
+   olWire->pad2= 0;
    if (swap) {
 	register int n;
 	swapl(&olWire->name,n);
@@ -4582,6 +4587,7 @@ xkbOverlayWireDesc *	olWire;
 	rowWire= (xkbOverlayRowWireDesc *)wire;
 	rowWire->rowUnder= row->row_under;
 	rowWire->nKeys= row->num_keys;
+	rowWire->pad1= 0;
 	wire= (char *)&rowWire[1];
 	for (k=0,key=row->keys;k<row->num_keys;k++,key++) {
 	    xkbOverlayKeyWireDesc *	keyWire;
commit ee3a4951a49312a2b68025db00c71472eb84293f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Mar 10 09:30:02 2011 +1000

    xkb: Document XkbWriteCountedString.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index fb44b24..4786489 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -4307,6 +4307,17 @@ ProcXkbSetNames(ClientPtr client)
 
 #define	XkbSizeCountedString(s)  ((s)?((((2+strlen(s))+3)/4)*4):4)
 
+/**
+ * Write the zero-terminated string str into wire as a pascal string with a
+ * 16-bit length field prefixed before the actual string.
+ *
+ * @param wire The destination array, usually the wire struct
+ * @param str The source string as zero-terminated C string
+ * @param swap If TRUE, the length field is swapped.
+ *
+ * @return The input string in the format <string length><string> with a
+ * (swapped) 16 bit string length, non-zero terminated.
+ */
 static char *
 XkbWriteCountedString(char *wire,char *str,Bool swap)
 {
commit 5c47f8beac7f87680c6f7331483b9cf94a1dbc86
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 11 14:30:49 2011 +0200

    xkb: Release XKB component names when compiling keymap.
    
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 422bae0..c6f86f5 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -447,6 +447,11 @@ extern _X_EXPORT void	XkbFreeKeyboard(
 	Bool			/* freeDesc */
 );
 
+extern _X_EXPORT void	XkbFreeComponentNames(
+	XkbComponentNamesPtr	/* names */,
+	Bool			/* freeNames */
+);
+
 extern _X_EXPORT  void XkbSetActionKeyMods(
 	XkbDescPtr		/* xkb */,
 	XkbAction *		/* act */,
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
index bffd60f..b70ac17 100644
--- a/xkb/XKBAlloc.c
+++ b/xkb/XKBAlloc.c
@@ -333,3 +333,22 @@ XkbFreeKeyboard(XkbDescPtr xkb,unsigned which,Bool freeAll)
 	free(xkb);
     return;
 }
+
+
+/***====================================================================***/
+
+void
+XkbFreeComponentNames(XkbComponentNamesPtr names, Bool freeNames)
+{
+    if (names)
+    {
+        free(names->keycodes);
+        free(names->types);
+        free(names->compat);
+        free(names->symbols);
+        free(names->geometry);
+        memset(names, 0, sizeof(XkbComponentNamesRec));
+    }
+    if (freeNames)
+        free(names);
+}
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index dc3c844..e102035 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -447,23 +447,23 @@ XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbComponentNamesPtr kccg
 static XkbDescPtr
 XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, int need)
 {
-    XkbDescPtr xkb;
+    XkbDescPtr xkb = NULL;
     unsigned int provided;
-    XkbComponentNamesRec kccgst;
+    XkbComponentNamesRec kccgst = {0};
     char name[PATH_MAX];
 
-    if (!XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst))
-        return NULL;
-
-    provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need,
-                                       &xkb, name, PATH_MAX);
-    if ((need & provided) != need) {
-        if (xkb) {
-            XkbFreeKeyboard(xkb, 0, TRUE);
-            xkb = NULL;
+    if (XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) {
+        provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need,
+                                           &xkb, name, PATH_MAX);
+        if ((need & provided) != need) {
+            if (xkb) {
+                XkbFreeKeyboard(xkb, 0, TRUE);
+                xkb = NULL;
+            }
         }
     }
 
+    XkbFreeComponentNames(&kccgst, FALSE);
     return xkb;
 }
 
diff --git a/xkb/xkb.c b/xkb/xkb.c
index d701ea1..fb44b24 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -5895,16 +5895,7 @@ ProcXkbGetKbdByName(ClientPtr client)
 	XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE);
 	new= NULL;
     }
-    free(names.keycodes);
-    names.keycodes = NULL;
-    free(names.types);
-    names.types = NULL;
-    free(names.compat);
-    names.compat = NULL;
-    free(names.symbols);
-    names.symbols = NULL;
-    free(names.geometry);
-    names.geometry = NULL;
+    XkbFreeComponentNames(&names, FALSE);
     return Success;
 }
 
commit 6f46ae3c69c48f389560af1491ed1729ba45866f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 15 13:20:03 2011 +1000

    man: list the drivers that are ignored when hotplugging (#35209)
    
    X.Org Bug 35209 <http://bugs.freedesktop.org/show_bug.cgi?id=35209>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Cyril Brulebois <kibi at debian.org>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index e3fd0ea..4bec316 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -814,11 +814,18 @@ Example: the MIT-SHM extension can be disabled with the following entry:
 The config file may have multiple
 .B InputDevice
 sections.
-Recent X servers employ input hotplugging to add input devices, with the HAL
-backend being the default backend for X servers since 1.4. It is usually not
+Recent X servers employ HAL or udev backends for input device enumeration
+and input hotplugging. It is usually not
 necessary to provide
 .B InputDevice
-sections in the xorg.conf if hotplugging is enabled.
+sections in the xorg.conf if hotplugging is in use. If hotplugging is
+enabled,
+.B InputDevice
+sections using the
+.B mouse, kbd
+and
+.B vmmouse
+driver will be ignored.
 .PP
 If hotplugging is disabled, there will normally
 be at least two: one for the core (primary) keyboard
commit 642569591a73806d038f00f2f9a5c8738f764c0b
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Sat Mar 12 07:29:35 2011 -0500

    dmx/doc: remove dead code in the makefile
    
    This was leftover from some older ways of building dmx/scale docbook.
    
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/dmx/doc/Makefile.am b/hw/dmx/doc/Makefile.am
index 8e73602..53fb784 100644
--- a/hw/dmx/doc/Makefile.am
+++ b/hw/dmx/doc/Makefile.am
@@ -30,8 +30,6 @@ DOXYGEN_HEAD=\
 	html/annotated.html
 
 DOXYGEN_REST= \
-	dmx.txt \
-	scaled.txt \
 	html/ChkNotMaskEv_8c.html \
 	html/ChkNotMaskEv_8h.html \
 	html/ChkNotMaskEv_8h_source.html \
@@ -237,7 +235,6 @@ DOXYGEN_REST= \
 DOXYGEN_FILES=$(DOXYGEN_HEAD) $(DOXYGEN_REST)
 
 EXTRA_DIST = \
-	$(XML_FILES) \
 	DMXSpec.txt \
 	DMXSpec-v1.txt \
 	doxygen.conf \
@@ -261,10 +258,10 @@ $(DOXYGEN_HEAD): $(DOXYGEN_SRC)
 $(DOXYGEN_REST): $(DOXYGEN_HEAD)
 
 maintainer-clean-local:
-	rm -rf html/ scaled.txt dmx.txt
+	rm -rf html/
 
 distclean-local:
-	rm -rf html/ scaled.txt dmx.txt
+	rm -rf html/
 
 endif HAVE_DOXYGEN
 endif ENABLE_DEVEL_DOCS
commit 21f70cad19474a6f3ba419e03c0df12881ed1092
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Sat Mar 12 07:29:34 2011 -0500

    man: relocate manual pages in the man subdir outside doc
    
    The convention is to have the manual pages in a man subdir
    which is not under a doc dir. The doc dir contains users docs.
    This will move man pages out of the way for upcoming DocBook patches.
    
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 681f9d9..7eb4151 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2205,7 +2205,6 @@ hw/xfree86/dixmods/Makefile
 hw/xfree86/dixmods/extmod/Makefile
 hw/xfree86/doc/Makefile
 hw/xfree86/doc/devel/Makefile
-hw/xfree86/doc/man/Makefile
 hw/xfree86/doc/sgml/Makefile
 hw/xfree86/dri/Makefile
 hw/xfree86/dri2/Makefile
@@ -2216,6 +2215,7 @@ hw/xfree86/fbdevhw/man/Makefile
 hw/xfree86/i2c/Makefile
 hw/xfree86/int10/Makefile
 hw/xfree86/loader/Makefile
+hw/xfree86/man/Makefile
 hw/xfree86/modes/Makefile
 hw/xfree86/os-support/Makefile
 hw/xfree86/os-support/bsd/Makefile
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index c23b1fd..09d875b 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -27,17 +27,15 @@ if INT10MODULE
 INT10_SUBDIR = int10
 endif
 
-DOC_SUBDIR = doc
-
 SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \
 	  ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \
 	  loader dixmods exa modes \
-	  $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) $(DOC_SUBDIR)
+	  $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man
 
 DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
                parser ramdac shadowfb vbe vgahw xaa \
                loader dixmods dri dri2 exa modes \
-	       utils doc
+	       utils doc man
 
 bin_PROGRAMS = Xorg
 Xorg_SOURCES = xorg.c
diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am
index 8021736..ac316e0 100644
--- a/hw/xfree86/doc/Makefile.am
+++ b/hw/xfree86/doc/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = devel man sgml
+SUBDIRS = devel sgml
 
 EXTRA_DIST = \
 	README.modes
diff --git a/hw/xfree86/doc/man/Makefile.am b/hw/xfree86/doc/man/Makefile.am
deleted file mode 100644
index 80e22cb..0000000
--- a/hw/xfree86/doc/man/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/manpages.am
-appman_PRE = Xorg.man
-fileman_PRE = xorg.conf.man xorg.conf.d.man
diff --git a/hw/xfree86/doc/man/Xorg.man b/hw/xfree86/doc/man/Xorg.man
deleted file mode 100644
index 6fa334c..0000000
--- a/hw/xfree86/doc/man/Xorg.man
+++ /dev/null
@@ -1,689 +0,0 @@
-.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH __xservername__ __appmansuffix__ __vendorversion__
-.SH NAME
-__xservername__ - X11R7 X server
-.SH SYNOPSIS
-.B __xservername__
-.RI [\fB:\fP display ]
-.RI [ option
-.IR ... ]
-.SH DESCRIPTION
-.B __xservername__
-is a full featured X server that was originally designed for UNIX and
-UNIX-like operating systems running on Intel x86 hardware.  It now runs
-on a wider range of hardware and OS platforms.
-.PP
-This work was derived by the X.Org Foundation from the XFree86 Project's
-.I "XFree86\ 4.4rc2"
-release.
-The XFree86 release was originally derived from
-.I "X386\ 1.2"
-by Thomas Roell which was contributed to X11R5 by Snitily Graphics
-Consulting Service.
-.SH PLATFORMS
-.PP
-.B __xservername__
-operates under a wide range of operating systems and hardware platforms.
-The Intel x86 (IA32) architecture is the most widely supported hardware
-platform.  Other hardware platforms include Compaq Alpha, Intel IA64, AMD64,
-SPARC and PowerPC.  The most widely supported operating systems are the
-free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD,
-OpenBSD, and Solaris.  Commercial UNIX operating systems such as
-UnixWare are also supported.  Other supported operating systems include
-GNU Hurd.  Mac OS X is supported with the
-Xquartz(__appmansuffix__) X server.  Win32/Cygwin is supported with the
-XWin(__appmansuffix__) X server.
-.PP
-.SH "NETWORK CONNECTIONS"
-.B __xservername__
-supports connections made using the following reliable
-byte-streams:
-.TP 4
-.I "Local"
-On most platforms, the "Local" connection type is a UNIX-domain socket.
-On some System V platforms, the "local" connection types also include
-STREAMS pipes, named pipes, and some other mechanisms.
-.TP 4
-.I TCP\/IP
-.B __xservername__
-listens on port
-.RI 6000+ n ,
-where
-.I n
-is the display number.  This connection type can be disabled with the
-.B \-nolisten
-option (see the Xserver(1) man page for details).
-.SH "ENVIRONMENT VARIABLES"
-For operating systems that support local connections other than Unix
-Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying
-the order in which local connections should be attempted.  This list
-can be overridden by the
-.I XLOCAL
-environment variable described below.  If the display name indicates a
-best-choice connection should be made (e.g.
-.BR :0.0 ),
-each connection mechanism is tried until a connection succeeds or no
-more mechanisms are available.  Note: for these OSs, the Unix Domain
-socket connection is treated differently from the other local connection
-types.  To use it the connection must be made to
-.BR unix:0.0 .
-.PP
-The
-.I XLOCAL
-environment variable should contain a list of one more
-more of the following:
-.PP
-.RS 8
-.nf
-NAMED
-PTS
-SCO
-ISC
-.fi
-.RE
-.PP
-which represent SVR4 Named Streams pipe, Old-style USL Streams pipe,
-SCO XSight Streams pipe, and ISC Streams pipe, respectively.  You can
-select a single mechanism (e.g.
-.IR XLOCAL=NAMED ),
-or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP).
-his variable overrides the compiled-in defaults.  For SVR4 it is
-recommended that
-.I NAMED
-be the first preference connection.  The default setting is
-.IR PTS:NAMED:ISC:SCO .
-.PP
-To globally override the compiled-in defaults, you should define (and
-export if using
-.B sh
-or
-.BR ksh )
-.I XLOCAL
-globally.  If you use startx(1) or xinit(1), the definition should be
-at the top of your
-.I .xinitrc
-file.  If you use xdm(1), the definitions should be early on in the
-.I __projectroot__/lib/X11/xdm/Xsession
-script.
-.SH OPTIONS
-.B __xservername__
-supports several mechanisms for supplying/obtaining configuration and
-run-time parameters: command line options, environment variables, the
-__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
-can be supplied via all methods.  The available command line options
-and environment variables (and some defaults) are described here and in
-the Xserver(__appmansuffix__) manual page.  Most configuration file
-parameters, with their defaults, are described in the
-__xconfigfile__(__filemansuffix__) manual page.  Driver and module specific
-configuration parameters are described in the relevant driver or module
-manual page.
-.PP
-In addition to the normal server options described in the
-Xserver(__appmansuffix__) manual page,
-.B __xservername__
-accepts the following command line switches:
-.TP 8
-.BI vt XX
-.I XX
-specifies the Virtual Terminal device number which
-.B __xservername__
-will use.  Without this option,
-.B __xservername__
-will pick the first available Virtual Terminal that it can locate.  This
-option applies only to platforms that have virtual terminal support, such
-as Linux, BSD, OpenSolaris, SVR3, and SVR4.
-.TP
-.B \-allowMouseOpenFail
-Allow the server to start up even if the mouse device can't be opened
-or initialised.  This is equivalent to the
-.B AllowMouseOpenFail
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.B \-allowNonLocalXvidtune
-Make the VidMode extension available to remote clients.  This allows
-the xvidtune client to connect from another host.  This is equivalent
-to the
-.B AllowNonLocalXvidtune
-__xconfigfile__(__filemansuffix__) file option.  By default non-local
-connections are not allowed.
-.TP 8
-.BI \-bgamma " value"
-Set the blue gamma correction.
-.I value
-must be between 0.1 and 10.
-The default is 1.0.  Not all drivers support this.  See also the
-.BR \-gamma ,
-.BR \-rgamma ,
-and
-.B \-ggamma
-options.
-.TP 8
-.BI \-bpp " n"
-No longer supported.  Use
-.B \-depth
-to set the color depth, and use
-.B \-fbbpp
-if you really need to force a non-default framebuffer (hardware) pixel
-format.
-.TP 8
-.BI \-config " file"
-Read the server configuration from
-.IR file .
-This option will work for any file when the server is run as root (i.e,
-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__
-server loads all video driver modules, probes for available hardware,
-and writes out an initial __xconfigfile__(__filemansuffix__) file based on
-what was detected.  This option currently has some problems on some
-platforms, but in most cases it is a good way to bootstrap the
-configuration process.  This option is only available when the server
-is run as root (i.e, with real-uid 0).
-.TP 8
-.BI "\-crt /dev/tty" XX
-SCO only.  This is the same as the
-.B vt
-option, and is provided for compatibility with the native SCO X server.
-.TP 8
-.BI \-depth " n"
-Sets the default color depth.  Legal values are 1, 4, 8, 15, 16, and
-24.  Not all drivers support all values.
-.TP 8
-.B \-disableVidMode
-Disable the parts of the VidMode extension (used by the xvidtune
-client) that can be used to change the video modes.  This is equivalent
-to the
-.B DisableVidModeExtension
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.B \-fbbpp \fIn\fP
-Sets the number of framebuffer bits per pixel.  You should only set this
-if you're sure it's necessary; normally the server can deduce the correct
-value from
-.B \-depth
-above.  Useful if you want to run a depth 24 configuration with a 24
-bpp framebuffer rather than the (possibly default) 32 bpp framebuffer
-(or vice versa).  Legal values are 1, 8, 16, 24, 32.  Not all drivers
-support all values.
-.TP 8
-.B \-flipPixels
-Swap the default values for the black and white pixels.
-.TP 8
-.BI \-gamma " value"
-Set the gamma correction.
-.I value
-must be between 0.1 and 10.  The default is 1.0.  This value is applied
-equally to the R, G and B values.  Those values can be set independently
-with the
-.BR \-rgamma ,
-.BR \-bgamma ,
-and
-.B \-ggamma
-options.  Not all drivers support this.
-.TP 8
-.BI \-ggamma " value"
-Set the green gamma correction.
-.I value
-must be between 0.1 and 10.  The default is 1.0.  Not all drivers support
-this.  See also the
-.BR \-gamma ,
-.BR \-rgamma ,
-and
-.B \-bgamma
-options.
-.TP 8
-.B \-ignoreABI
-The
-.B __xservername__
-server checks the ABI revision levels of each module that it loads.  It
-will normally refuse to load modules with ABI revisions that are newer
-than the server's.  This is because such modules might use interfaces
-that the server does not have.  When this option is specified, mismatches
-like this are downgraded from fatal errors to warnings.  This option
-should be used with care.
-.TP 8
-.B \-isolateDevice \fIbus\-id\fP
-Restrict device resets to the device at
-.IR bus\-id .
-The
-.I bus\-id
-string has the form
-.IB bustype : bus : device : function
-(e.g., \(oqPCI:1:0:0\(cq).
-At present, only isolation of PCI devices is supported; i.e., this option
-is ignored if
-.I bustype
-is anything other than \(oqPCI\(cq.
-.TP 8
-.B \-keeptty
-Prevent the server from detaching its initial controlling terminal.
-This option is only useful when debugging the server.  Not all platforms
-support (or can use) this option.
-.TP 8
-.BI \-keyboard " keyboard-name"
-Use the __xconfigfile__(__filemansuffix__) file
-.B InputDevice
-section called
-.I keyboard-name
-as the core keyboard.  This option is ignored when the
-.B Layout
-section specifies a core keyboard.  In the absence of both a Layout
-section and this option, the first relevant
-.B InputDevice
-section is used for the core keyboard.
-.TP 8
-.BI \-layout " layout-name"
-Use the __xconfigfile__(__filemansuffix__) file
-.B Layout
-section called
-.IR layout-name .
-By default the first
-.B Layout
-section is used.
-.TP 8
-.BI \-logfile " filename"
-Use the file called
-.I filename
-as the
-.B __xservername__
-server log file.  The default log file is
-.BI __logdir__/__xservername__. n .log
-on most platforms, where
-.I n
-is the display number of the
-.B __xservername__
-server.  The default may be in a different directory on some platforms.
-This option is only available when the server is run as root (i.e, with
-real-uid 0).
-.TP 8
-.BR \-logverbose " [\fIn\fP]"
-Sets the verbosity level for information printed to the
-.B __xservername__
-server log file.  If the
-.I n
-value isn't supplied, each occurrence of this option increments the log
-file verbosity level.  When the
-.I n
-value is supplied, the log file verbosity level is set to that value.
-The default log file verbosity level is 3.
-.TP 8
-.BI \-modulepath " searchpath"
-Set the module search path to
-.IR searchpath .
-.I searchpath
-is a comma separated list of directories to search for
-.B __xservername__
-server modules.  This option is only available when the server is run
-as root (i.e, with real-uid 0).
-.TP 8
-.B \-nosilk
-Disable Silken Mouse support.
-.TP 8
-.B \-pixmap24
-Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel.
-The default is usually 32 bits per pixel.  There is normally little
-reason to use this option.  Some client applications don't like this
-pixmap format, even though it is a perfectly legal format.  This is
-equivalent to the
-.B Pixmap
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.B \-pixmap32
-Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel.
-This is usually the default.  This is equivalent to the
-.B Pixmap
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.BI \-pointer " pointer-name"
-Use the __xconfigfile__(__filemansuffix__) file
-.B InputDevice
-section called
-.I pointer-name
-as the core pointer.  This option is ignored when the
-.B Layout
-section specifies a core pointer.  In the absence of both a Layout
-section and this option, the first relevant
-.B InputDevice
-section is used for the core pointer.
-.TP 8
-.B \-quiet
-Suppress most informational messages at startup.  The verbosity level
-is set to zero.
-.TP 8
-.BI \-rgamma " value"
-Set the red gamma correction.
-.I value
-must be between 0.1 and 10.  The default is 1.0.  Not all drivers support
-this.  See also the
-.BR \-gamma ,
-.BR \-bgamma ,
-and
-.B \-ggamma
-options.
-.TP 8
-.BI \-screen " screen-name"
-Use the __xconfigfile__(__filemansuffix__) file
-.B Screen
-section called
-.IR screen-name .
-By default the screens referenced by the default
-.B Layout
-section are used, or the first
-.B Screen
-section when there are no
-.B Layout
-sections.
-.TP 8
-.B \-showconfig
-This is the same as the
-.B \-version
-option, and is included for compatibility reasons.  It may be removed
-in a future release, so the
-.B \-version
-option should be used instead.
-.TP 8
-.B \-showDefaultModulePath
-Print out the default module path the server was compiled with.
-.TP 8
-.B \-showDefaultLibPath
-Print out the path libraries should be installed to.
-.TP 8
-.B \-showopts
-For each driver module installed, print out the list of options and their
-argument types.
-.TP 8
-.BI \-weight " nnn"
-Set RGB weighting at 16 bpp.  The default is 565.  This applies only to
-those drivers which support 16 bpp.
-.TP 8
-.BR \-verbose " [\fIn\fP]"
-Sets the verbosity level for information printed on stderr.  If the
-.I n
-value isn't supplied, each occurrence of this option increments the
-verbosity level.  When the
-.I n
-value is supplied, the verbosity level is set to that value.  The default
-verbosity level is 0.
-.TP 8
-.B \-version
-Print out the server version, patchlevel, release date, the operating
-system/platform it was built on, and whether it includes module loader
-support.
-.SH "KEYBOARD"
-.PP
-The
-.B __xservername__
-server is normally configured to recognize various special combinations
-of key presses that instruct the server to perform some action, rather
-than just sending the key press event to a client application. These actions
-depend on the XKB keymap loaded by a particular keyboard device and may or
-may not be available on a given configuration.
-.PP
-The following key combinations are commonly part of the default XKEYBOARD
-keymap.
-.TP 8
-.B Ctrl+Alt+Backspace
-Immediately kills the server -- no questions asked. It can be disabled by
-setting the
-.B DontZap
-__xconfigfile__(__filemansuffix__) file option to a TRUE value.
-.PP
-.RS 8
-It should be noted that zapping is triggered by the
-.B Terminate_Server
-action in the keyboard map. This action is not part of the default keymaps
-but can be enabled with the XKB option
-.B \*qterminate:ctrl_alt_bksp\*q.
-.RE
-.TP 8
-.B Ctrl+Alt+Keypad-Plus
-Change video mode to next one specified in the configuration file.
-This can be disabled with the
-.B DontZoom
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.B Ctrl+Alt+Keypad-Minus
-Change video mode to previous one specified in the configuration file.
-This can be disabled with the
-.B DontZoom
-__xconfigfile__(__filemansuffix__) file option.
-.TP 8
-.B Ctrl+Alt+F1...F12
-For systems with virtual terminal support, these keystroke
-combinations are used to switch to virtual terminals 1 through 12,
-respectively.  This can be disabled with the
-.B DontVTSwitch
-__xconfigfile__(__filemansuffix__) file option.
-.SH CONFIGURATION
-.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.
-.PP
-.B __xservername__
-has a mechanism for automatically generating a built-in configuration
-at run-time when no
-.B __xconfigfile__
-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
-.B __xconfigfile__
-file optional.  This means that information that can be probed or
-reasonably deduced doesn't need to be specified explicitly, greatly
-reducing the amount of built-in configuration information that needs to
-be generated at run-time.
-.PP
-The second is to have "safe" fallbacks for most configuration information.
-This maximises the likelihood that the
-.B __xservername__
-server will start up in some usable configuration even when information
-about the specific hardware is not available.
-.PP
-The automatic configuration support for __xservername__ is work in progress.
-It is currently aimed at the most popular hardware and software platforms
-supported by __xservername__.  Enhancements are planned for future releases.
-.SH FILES
-The
-.B __xservername__
-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
-.B /etc/X11/__xconfigfile__
-Server configuration file.
-.TP 30
-.B /etc/X11/__xconfigfile__-4
-Server configuration file.
-.TP 30
-.B /etc/__xconfigfile__
-Server configuration file.
-.TP 30
-.B __projectroot__/etc/__xconfigfile__
-Server configuration file.
-.TP 30
-.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 .
-.TP 30
-.B __projectroot__/bin/\(**
-Client binaries.
-.TP 30
-.B __projectroot__/include/\(**
-Header files.
-.TP 30
-.B __projectroot__/lib/\(**
-Libraries.
-.TP 30
-.B __datadir__/fonts/X11/\(**
-Fonts.
-.TP 30
-.B __projectroot__/share/X11/XErrorDB
-Client error message database.
-.TP 30
-.B __projectroot__/lib/X11/app-defaults/\(**
-Client resource specifications.
-.TP 30
-.B __mandir__/man?/\(**
-Manual pages.
-.TP 30
-.BI /etc/X n .hosts
-Initial access control list for display
-.IR n .
-.SH "SEE ALSO"
-X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__),
-__xconfigfile__(__filemansuffix__), xvidtune(__appmansuffix__),
-apm(__drivermansuffix__),
-ati(__drivermansuffix__),
-chips(__drivermansuffix__),
-cirrus(__drivermansuffix__),
-cyrix(__drivermansuffix__),
-fbdev(__drivermansuffix__),
-glide(__drivermansuffix__),
-glint(__drivermansuffix__),
-i128(__drivermansuffix__),
-i740(__drivermansuffix__),
-imstt(__drivermansuffix__),
-intel(__drivermansuffix__),
-mga(__drivermansuffix__),
-neomagic(__drivermansuffix__),
-nsc(__drivermansuffix__),
-nv(__drivermansuffix__),
-openchrome (__drivermansuffix__),
-r128(__drivermansuffix__),
-rendition(__drivermansuffix__),
-s3virge(__drivermansuffix__),
-siliconmotion(__drivermansuffix__),
-sis(__drivermansuffix__),
-sunbw2(__drivermansuffix__),
-suncg14(__drivermansuffix__),
-suncg3(__drivermansuffix__),
-suncg6(__drivermansuffix__),
-sunffb(__drivermansuffix__),
-sunleo(__drivermansuffix__),
-suntcx(__drivermansuffix__),
-tdfx(__drivermansuffix__),
-tga(__drivermansuffix__),
-trident(__drivermansuffix__),
-tseng(__drivermansuffix__),
-v4l(__drivermansuffix__),
-vesa(__drivermansuffix__),
-vmware(__drivermansuffix__),
-.br
-Web site
-.IR <http://www.x.org> .
-
-.SH AUTHORS
-__xservername__ has many contributors world wide.  The names of most of them
-can be found in the documentation, ChangeLog files in the source tree,
-and in the actual source code.
-.PP
-__xservername__ was originally based on XFree86 4.4rc2.
-That was originally based on \fIX386 1.2\fP by Thomas Roell, which
-was contributed to the then X Consortium's X11R5 distribution by SGCS.
-.PP
-__xservername__ is released by the X.Org Foundation.
-.PP
-The project that became XFree86 was originally founded in 1992 by
-David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat.
-.PP
-XFree86 was later integrated in the then X Consortium's X11R6 release
-by a group of dedicated XFree86 developers, including the following:
-.PP
-.RS 4
-.nf
-Stuart Anderson    \fIanderson at metrolink.com\fP
-Doug Anson         \fIdanson at lgc.com\fP
-Gertjan Akkerman   \fIakkerman at dutiba.twi.tudelft.nl\fP
-Mike Bernson       \fImike at mbsun.mlb.org\fP
-Robin Cutshaw      \fIrobin at XFree86.org\fP
-David Dawes        \fIdawes at XFree86.org\fP
-Marc Evans         \fImarc at XFree86.org\fP
-Pascal Haible      \fIhaible at izfm.uni-stuttgart.de\fP
-Matthieu Herrb     \fIMatthieu.Herrb at laas.fr\fP
-Dirk Hohndel       \fIhohndel at XFree86.org\fP
-David Holland      \fIdavidh at use.com\fP
-Alan Hourihane     \fIalanh at fairlite.demon.co.uk\fP
-Jeffrey Hsu        \fIhsu at soda.berkeley.edu\fP
-Glenn Lai          \fIglenn at cs.utexas.edu\fP
-Ted Lemon          \fImellon at ncd.com\fP
-Rich Murphey       \fIrich at XFree86.org\fP
-Hans Nasten        \fInasten at everyware.se\fP
-Mark Snitily       \fImark at sgcs.com\fP
-Randy Terbush      \fIrandyt at cse.unl.edu\fP
-Jon Tombs          \fItombs at XFree86.org\fP
-Kees Verstoep      \fIversto at cs.vu.nl\fP
-Paul Vixie         \fIpaul at vix.com\fP
-Mark Weaver        \fIMark_Weaver at brown.edu\fP
-David Wexelblat    \fIdwex at XFree86.org\fP
-Philip Wheatley    \fIPhilip.Wheatley at ColumbiaSC.NCR.COM\fP
-Thomas Wolfram     \fIwolf at prz.tu-berlin.de\fP
-Orest Zborowski    \fIorestz at eskimo.com\fP
-.fi
-.RE
-.PP
-__xservername__ source is available from the FTP server
-\fI<ftp://ftp.x.org/>\fP, and from the X.Org
-server \fI<http://gitweb.freedesktop.org/>\fP.  Documentation and other
-information can be found from the X.Org web site
-\fI<http://www.x.org/>\fP.
-
-.SH LEGAL
-.PP
-.B __xservername__
-is copyright software, provided under licenses that permit modification
-and redistribution in source and binary form without fee.
-.B __xservername__ is copyright by numerous authors and
-contributors from around the world.  Licensing information can be found
-at
-.IR <http://www.x.org> .
-Refer to the source code for specific copyright notices.
-.PP
-.B XFree86(TM)
-is a trademark of The XFree86 Project, Inc.
-.PP
-.B X11(TM)
-and
-.B X Window System(TM)
-are trademarks of The Open Group.
diff --git a/hw/xfree86/doc/man/xorg.conf.d.man b/hw/xfree86/doc/man/xorg.conf.d.man
deleted file mode 100644
index 6b3379e..0000000
--- a/hw/xfree86/doc/man/xorg.conf.d.man
+++ /dev/null
@@ -1 +0,0 @@
-.so man__filemansuffix__/xorg.conf.__filemansuffix__
diff --git a/hw/xfree86/doc/man/xorg.conf.man b/hw/xfree86/doc/man/xorg.conf.man
deleted file mode 100644
index e3fd0ea..0000000
--- a/hw/xfree86/doc/man/xorg.conf.man
+++ /dev/null
@@ -1,2478 +0,0 @@
-.\" shorthand for double quote that works everywhere.
-.ds q \N'34'
-.TH __xconfigfile__ __filemansuffix__ __vendorversion__
-.SH NAME
-__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__ 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.
-The
-.I __xconfigfile__
-configuration file is searched for in the following places when the
-server is started as a normal user:
-.PP
-.RS 4
-.nf
-.IR /etc/X11/ <cmdline>
-.IR __projectroot__/etc/X11/ <cmdline>
-.IB /etc/X11/ $XORGCONFIG
-.IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__
-.I /etc/__xconfigfile__
-.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__
-.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is a relative path (with no \(lq..\(rq components) specified with the
-.B \-config
-command line option,
-.B $XORGCONFIG
-is the relative path (with no \(lq..\(rq components) specified by that
-environment variable, and
-.I <hostname>
-is the machine's hostname as reported by
-.BR gethostname (__libmansuffix__).
-.PP
-When the __xservername__ server is started by the \(lqroot\(rq user, the config file
-search locations are as follows:
-.PP
-.RS 4
-.nf
-<cmdline>
-.IR /etc/X11/ <cmdline>
-.IR __projectroot__/etc/X11/ <cmdline>
-.B $XORGCONFIG
-.IB /etc/X11/ $XORGCONFIG
-.IB __projectroot__/etc/X11/ $XORGCONFIG
-.I /etc/X11/__xconfigfile__
-.I /etc/__xconfigfile__
-.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
-.I __projectroot__/etc/X11/__xconfigfile__
-.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
-.I __projectroot__/lib/X11/__xconfigfile__
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is the path specified with the
-.B \-config
-command line option (which may be absolute or relative),
-.B $XORGCONFIG
-is the path specified by that
-environment variable (absolute or relative),
-.B $HOME
-is the path specified by that environment variable (usually the home
-directory), and
-.I <hostname>
-is the machine's hostname as reported by
-.BR gethostname (__libmansuffix__).
-.PP
-Additional configuration files are searched for in the following
-directories when the server is started as a normal user:
-.PP
-.RS 4
-.nf
-.IR /etc/X11/ <cmdline>
-.IR __sysconfdir__/X11/ <cmdline>
-.I /etc/X11/__xconfigdir__
-.I __sysconfdir__/X11/__xconfigdir__
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is a relative path (with no \(lq..\(rq components) specified with the
-.B \-configdir
-command line option.
-.PP
-When the __xservername__ server is started by the \(lqroot\(rq user, the
-config directory search locations are as follows:
-.PP
-.RS 4
-.nf
-<cmdline>
-.IR /etc/X11/ <cmdline>
-.IR __sysconfdir__/X11/ <cmdline>
-.I /etc/X11/__xconfigdir__
-.I __sysconfdir__/X11/__xconfigdir__
-.fi
-.RE
-.PP
-where
-.I <cmdline>
-is the path specified with the
-.B \-configdir
-command line option (which may be absolute or relative).
-.PP
-Finally, configuration files will also be searched for in directories
-reserved for system use. These are to separate configuration files from
-the vendor or 3rd party packages from those of local administration.
-These files are found in the following directories:
-.PP
-.RS 4
-.nf
-.I /usr/share/X11/__xconfigdir__
-.I __datadir__/X11/__xconfigdir__
-.fi
-.RE
-.PP
-The
-.I __xconfigfile__
-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
-.RS 4
-.nf
-.BI "Section  \*q" SectionName \*q
-.RI "    " SectionEntry
-    ...
-.B EndSection
-.fi
-.RE
-.PP
-The section names are:
-.PP
-.RS 4
-.nf
-.BR "Files          " "File pathnames"
-.BR "ServerFlags    " "Server flags"
-.BR "Module         " "Dynamic module loading"
-.BR "Extensions     " "Extension enabling"
-.BR "InputDevice    " "Input device description"
-.BR "InputClass     " "Input class description"
-.BR "Device         " "Graphics device description"
-.BR "VideoAdaptor   " "Xv video adaptor description"
-.BR "Monitor        " "Monitor description"
-.BR "Modes          " "Video modes descriptions"
-.BR "Screen         " "Screen configuration"
-.BR "ServerLayout   " "Overall layout"
-.BR "DRI            " "DRI\-specific configuration"
-.BR "Vendor         " "Vendor\-specific configuration"
-.fi
-.RE
-.PP
-The following obsolete section names are still recognised for compatibility
-purposes.
-In new config files, the
-.B InputDevice
-section should be used instead.
-.PP
-.RS 4
-.nf
-.BR "Keyboard       " "Keyboard configuration"
-.BR "Pointer        " "Pointer/mouse configuration"
-.fi
-.RE
-.PP
-The old
-.B XInput
-section is no longer recognised.
-.PP
-The
-.B ServerLayout
-sections are at the highest level.
-They bind together the input and output devices that will be used in a session.
-The input devices are described in the
-.B InputDevice
-sections.
-Output devices usually consist of multiple independent components (e.g.,
-a graphics board and a monitor).
-These multiple components are bound together in the
-.B Screen
-sections, and it is these that are referenced by the
-.B ServerLayout
-section.
-Each
-.B Screen
-section binds together a graphics board and a monitor.
-The graphics boards are described in the
-.B Device
-sections, and the monitors are described in the
-.B Monitor
-sections.
-.PP
-Config file keywords are case\-insensitive, and \(lq_\(rq characters are
-ignored.
-Most strings (including
-.B Option
-names) are also case-insensitive, and insensitive to white space and
-\(lq_\(rq characters.
-.PP
-Each config file entry usually takes up a single line in the file.  They
-consist of a keyword, which is possibly followed by one or more arguments,
-with the number and types of the arguments depending on the keyword.
-The argument types are:
-.PP
-.RS 4
-.nf
-.BR "Integer     " "an integer number in decimal, hex or octal"
-.BR "Real        " "a floating point number"
-.BR "String      " "a string enclosed in double quote marks (\*q)"
-.fi
-.RE
-.PP
-Note: hex integer values must be prefixed with \(lq0x\(rq, and octal values
-with \(lq0\(rq.
-.PP
-A special keyword called
-.B Option
-may be used to provide free\-form data to various components of the server.
-The
-.B Option
-keyword takes either one or two string arguments.
-The first is the option name, and the optional second argument is the
-option value.
-Some commonly used option value types include:
-.PP
-.RS 4
-.nf
-.BR "Integer     " "an integer number in decimal, hex or octal"
-.BR "Real        " "a floating point number"
-.BR "String      " "a sequence of characters"
-.BR "Boolean     " "a boolean value (see below)"
-.BR "Frequency   " "a frequency value (see below)"
-.fi
-.RE
-.PP
-Note that
-.I all
-.B Option
-values, not just strings, must be enclosed in quotes.
-.PP
-Boolean options may optionally have a value specified.
-When no value is specified, the option's value is
-.BR TRUE .
-The following boolean option values are recognised as
-.BR TRUE :
-.PP
-.RS 4
-.BR 1 ,
-.BR on ,
-.BR true ,
-.B yes
-.RE
-.PP
-and the following boolean option values are recognised as
-.BR FALSE :
-.PP
-.RS 4
-.BR 0 ,
-.BR off ,
-.BR false ,
-.B no
-.RE
-.PP
-If an option name is prefixed with
-.RB \*q No \*q,
-then the option value is negated.
-.PP
-Example: the following option entries are equivalent:
-.PP
-.RS 4
-.nf
-.B "Option \*qAccel\*q   \*qOff\*q"
-.B "Option \*qNoAccel\*q"
-.B "Option \*qNoAccel\*q \*qOn\*q"
-.B "Option \*qAccel\*q   \*qfalse\*q"
-.B "Option \*qAccel\*q   \*qno\*q"
-.fi
-.RE
-.PP
-Frequency option values consist of a real number that is optionally
-followed by one of the following frequency units:
-.PP
-.RS 4
-.BR Hz ,
-.BR k ,
-.BR kHz ,
-.BR M ,
-.B MHz
-.RE
-.PP
-When the unit name is omitted, the correct units will be determined from
-the value and the expectations of the appropriate range of the value.
-It is recommended that the units always be specified when using frequency
-option values to avoid any errors in determining the value.
-.SH "FILES SECTION"
-The
-.B Files
-section is used to specify some path names required by the server.
-Some of these paths can also be set from the command line (see
-.BR Xserver (__appmansuffix__)
-and
-.BR __xservername__ (__appmansuffix__)).
-The command line settings override the values specified in the config
-file.
-The
-.B Files
-section is optional, as are all of the entries that may appear in it.
-.PP
-The entries that can appear in this section are:
-.TP 7
-.BI "FontPath \*q" path \*q
-sets the search path for fonts.
-This path is a comma separated list of font path elements which the __xservername__
-server searches for font databases.
-Multiple
-.B FontPath
-entries may be specified, and they will be concatenated to build up the
-fontpath used by the server.  Font path elements can be absolute
-directory paths, catalogue directories or a font server identifier. The
-formats of the later two are explained below:
-.PP
-.RS 7
-Catalogue directories:
-.PP
-.RS 4
-Catalogue directories can be specified using the prefix \fBcatalogue:\fR
-before the directory name. The directory can then be populated with
-symlinks pointing to the real font directories, using the following
-syntax in the symlink name:
-.PP
-.RS 4
-.IR <identifier> : [attribute]: pri= <priority>
-.RE
-.PP
-where
-.I <identifier>
-is an alphanumeric identifier,
-.I [attribute]
-is an attribute which will be passed to the underlying FPE and
-.I <priority>
-is a number used to order the fontfile FPEs. Examples:
-.PP
-.RS 4
-.nf
-.I 75dpi:unscaled:pri=20  -> /usr/share/X11/fonts/75dpi
-.I gscript:pri=60 -> /usr/share/fonts/default/ghostscript
-.I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc
-.fi
-.PP
-.RE .RE .RE
-.PP
-.RS 7
-Font server identifiers:
-.PP
-.RS 4
-Font server identifiers have the form:
-.RS 4
-.PP
-.IR <trans> / <hostname> : <port\-number>
-.RE
-.PP
-where
-.I <trans>
-is the transport type to use to connect to the font server (e.g.,
-.B unix
-for UNIX\-domain sockets or
-.B tcp
-for a TCP/IP connection),
-.I <hostname>
-is the hostname of the machine running the font server, and
-.I <port\-number>
-is the port number that the font server is listening on (usually 7100).
-.RE
-.PP
-When this entry is not specified in the config file, the server falls back
-to the compiled\-in default font path, which contains the following
-font path elements (which can be set inside a catalogue directory):
-.PP
-.RS 4
-.nf
-.I __datadir__/fonts/X11/misc/
-.I __datadir__/fonts/X11/TTF/
-.I __datadir__/fonts/X11/OTF/
-.I __datadir__/fonts/X11/Type1/
-.I __datadir__/fonts/X11/100dpi/
-.I __datadir__/fonts/X11/75dpi/
-.fi
-.RE
-.PP
-Font path elements that are found to be invalid are removed from the
-font path when the server starts up.
-.RE
-.TP 7
-.BI "ModulePath \*q" path \*q
-sets the search path for loadable __xservername__ server modules.
-This path is a comma separated list of directories which the __xservername__ server
-searches for loadable modules loading in the order specified.
-Multiple
-.B ModulePath
-entries may be specified, and they will be concatenated to build the
-module search path used by the server.  The default module path is
-.PP
-.RS 11
-__modulepath__
-.RE
-.\" The LogFile keyword is not currently implemented
-.ig
-.TP 7
-.BI "LogFile \*q" path \*q
-sets the name of the __xservername__ server log file.
-The default log file name is
-.PP
-.RS 11
-.RI __logdir__/__xservername__. <n> .log
-.RE
-.PP
-.RS 7
-where
-.I <n>
-is the display number for the __xservername__ server.
-..
-.TP 7
-.BI "XkbDir \*q" path \*q
-sets the base directory for keyboard layout files.  The
-.B \-xkbdir
-command line option can be used to override this.  The default directory is
-.PP
-.RS 11
-__xkbdir__
-.RE
-.SH "SERVERFLAGS SECTION"
-In addition to options specific to this section (described below), the
-.B ServerFlags
-section is used to specify some global
-__xservername__ server options.
-All of the entries in this section are
-.BR Options ,
-although for compatibility purposes some of the old style entries are
-still recognised.
-Those old style entries are not documented here, and using them is
-discouraged.
-The
-.B ServerFlags
-section is optional, as are the entries that may be specified in it.
-.PP
-.B Options
-specified in this section (with the exception of the
-.B \*qDefaultServerLayout\*q
-.BR Option )
-may be overridden by
-.B Options
-specified in the active
-.B ServerLayout
-section.
-Options with command line equivalents are overridden when their command
-line equivalent is used.
-The options recognised by this section are:
-.TP 7
-.BI "Option \*qDefaultServerLayout\*q  \*q" layout\-id \*q
-This specifies the default
-.B ServerLayout
-section to use in the absence of the
-.B \-layout
-command line option.
-.TP 7
-.BI "Option \*qNoTrapSignals\*q  \*q" boolean \*q
-This prevents the __xservername__ server from trapping a range of unexpected fatal
-signals and exiting cleanly.
-Instead, the __xservername__ server will die and drop core where the fault occurred.
-The default behaviour is for the __xservername__ server to exit cleanly, but still drop a
-core file.
-In general you never want to use this option unless you are debugging an __xservername__
-server problem and know how to deal with the consequences.
-.TP 7
-.BI "Option \*qUseSIGIO\*q  \*q" boolean \*q
-This controls whether the __xservername__ server requests that events from
-input devices be reported via a SIGIO signal handler (also known as SIGPOLL
-on some platforms), or only reported via the standard select(3) loop.
-The default behaviour is platform specific.   In general you do not want to
-use this option unless you are debugging the __xservername__ server, or
-working around a specific bug until it is fixed, and understand the
-consequences.
-.TP 7
-.BI "Option \*qDontVTSwitch\*q  \*q" boolean \*q
-This disallows the use of the
-.BI Ctrl+Alt+F n
-sequence (where
-.RI F n
-refers to one of the numbered function keys).
-That sequence is normally used to switch to another \*qvirtual terminal\*q
-on operating systems that have this feature.
-When this option is enabled, that key sequence has no special meaning and
-is passed to clients.
-Default: off.
-.TP 7
-.BI "Option \*qDontZap\*q  \*q" boolean \*q
-This disallows the use of the
-.B Terminate_Server
-XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options).
-This action is normally used to terminate the __xservername__ server.
-When this option is enabled, the action has no effect.
-Default: off.
-.TP 7
-.BI "Option \*qDontZoom\*q  \*q" boolean \*q
-This disallows the use of the
-.B Ctrl+Alt+Keypad\-Plus
-and
-.B Ctrl+Alt+Keypad\-Minus
-sequences.
-These sequences allows you to switch between video modes.
-When this option is enabled, those key sequences have no special meaning
-and are passed to clients.
-Default: off.
-.TP 7
-.BI "Option \*qDisableVidModeExtension\*q  \*q" boolean \*q
-This disables the parts of the VidMode extension used by the xvidtune client
-that can be used to change the video modes.
-Default: the VidMode extension is enabled.
-.TP 7
-.BI "Option \*qAllowNonLocalXvidtune\*q  \*q" boolean \*q
-This allows the xvidtune client (and other clients that use the VidMode
-extension) to connect from another host.
-Default: off.
-.TP 7
-.BI "Option \*qAllowMouseOpenFail\*q  \*q" boolean \*q
-This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__)
-drivers to not report failure if the mouse device can't be opened/initialised.
-It has no effect on the evdev(__drivermansuffix__) or other drivers.
-Default: false.
-.TP 7
-.BI "Option \*qVTSysReq\*q  \*q" boolean \*q
-enables the SYSV\-style VT switch sequence for non\-SYSV systems
-which support VT switching.
-This sequence is
-.B Alt\-SysRq
-followed by a function key
-.RB ( Fn ).
-This prevents the __xservername__ server trapping the
-keys used for the default VT switch sequence, which means that clients can
-access them.
-Default: off.
-.TP 7
-.BI "Option \*qBlankTime\*q  \*q" time \*q
-sets the inactivity timeout for the
-.B blank
-phase of the screensaver.
-.I time
-is in minutes.
-This is equivalent to the __xservername__ server's
-.B \-s
-flag, and the value can be changed at run\-time with
-.BR xset(__appmansuffix__).
-Default: 10 minutes.
-.TP 7
-.BI "Option \*qStandbyTime\*q  \*q" time \*q
-sets the inactivity timeout for the
-.B standby
-phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run\-time with
-.BR xset(__appmansuffix__).
-Default: 10 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers.
-It is only enabled for screens that have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qSuspendTime\*q  \*q" time \*q
-sets the inactivity timeout for the
-.B suspend
-phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run\-time with
-.BR xset(__appmansuffix__).
-Default: 10 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers.
-It is only enabled for screens that have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qOffTime\*q  \*q" time \*q
-sets the inactivity timeout for the
-.B off
-phase of DPMS mode.
-.I time
-is in minutes, and the value can be changed at run\-time with
-.BR xset(__appmansuffix__).
-Default: 10 minutes.
-This is only suitable for VESA DPMS compatible monitors, and may not be
-supported by all video drivers.
-It is only enabled for screens that have the
-.B \*qDPMS\*q
-option set (see the MONITOR section below).
-.TP 7
-.BI "Option \*qPixmap\*q  \*q" bpp \*q
-This sets the pixmap format to use for depth 24.
-Allowed values for
-.I bpp
-are 24 and 32.
-Default: 32 unless driver constraints don't allow this (which is rare).
-Note: some clients don't behave well when this value is set to 24.
-.TP 7
-.BI "Option \*qPC98\*q  \*q" boolean \*q
-Specify that the machine is a Japanese PC\-98 machine.
-This should not be enabled for anything other than the Japanese\-specific
-PC\-98 architecture.
-Default: auto\-detected.
-.TP 7
-.BI "Option \*qNoPM\*q  \*q" boolean \*q
-Disables something to do with power management events.
-Default: PM enabled on platforms that support it.
-.TP 7
-.BI "Option \*qXinerama\*q  \*q" boolean \*q
-enable or disable XINERAMA extension.
-Default is disabled.
-.TP 7
-.BI "Option \*qAIGLX\*q \*q" boolean \*q
-enable or disable AIGLX. AIGLX is enabled by default.
-.TP 7
-.BI "Option \*qDRI2\*q \*q" boolean \*q
-enable or disable DRI2. DRI2 is disabled by default.
-.TP 7
-.BI "Option \*qGlxVisuals\*q \*q" string \*q
-This option controls how many GLX visuals the GLX modules sets up.
-The default value is
-.BR "typical" ,
-which will setup up a typical subset of
-the GLXFBConfigs provided by the driver as GLX visuals.  Other options are
-.BR "minimal" ,
-which will set up the minimal set allowed by the GLX specification and
-.BR "all"
-which will setup GLX visuals for all GLXFBConfigs.
-.TP 7
-.BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q
-Include the default font path even if other paths are specified in
-xorg.conf. If enabled, other font paths are included as well. Enabled by
-default.
-.TP 7
-.BI "Option \*qIgnoreABI\*q \*q" boolean \*q
-Allow modules built for a different, potentially incompatible version of
-the X server to load. Disabled by default.
-.TP 7
-.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
-If this option is disabled, then no devices will be added from HAL events.
-Enabled by default.
-.TP 7
-.BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q
-If this option is disabled, then the devices will be added (and the
-DevicePresenceNotify event sent), but not enabled, thus leaving policy up
-to the client.
-Enabled by default.
-.TP 7
-.BI "Option \*qLog\*q \*q" string \*q
-This option controls whether the log is flushed and/or synced to disk after
-each message.
-Possible values are
-.B flush
-or
-.BR sync .
-Unset by default.
-.SH "MODULE SECTION"
-The
-.B Module
-section is used to specify which __xservername__ server modules should be loaded.
-This section is ignored when the __xservername__ server is built in static form.
-The type of modules normally loaded in this section are __xservername__ server
-extension modules.
-Most other module types are loaded automatically when they are needed via
-other mechanisms.
-The
-.B Module
-section is optional, as are all of the entries that may be specified in
-it.
-.PP
-Entries in this section may be in two forms.
-The first and most commonly used form is an entry that uses the
-.B Load
-keyword, as described here:
-.TP 7
-.BI "Load  \*q" modulename \*q
-This instructs the server to load the module called
-.IR modulename .
-The module name given should be the module's standard name, not the
-module file name.
-The standard name is case\-sensitive, and does not include the \(lqlib\(rq
-prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes.
-.PP
-.RS 7
-Example: the DRI extension module can be loaded with the following entry:
-.PP
-.RS 4
-.B "Load \*qdri\*q"
-.RE
-.RE
-.TP 7
-.BI "Disable  \*q" modulename \*q
-This instructs the server to not load the module called
-.IR modulename .
-Some modules are loaded by default in the server, and this overrides that
-default. If a
-.B Load
-instruction is given for the same module, it overrides the
-.B Disable
-instruction and the module is loaded. The module name given should be the
-module's standard name, not the module file name. As with the
-.B Load
-instruction, the standard name is case-sensitive, and does not include the
-"lib" prefix, or the ".a", ".o", or ".so" suffixes.
-.PP
-The second form of entry is a
-.BR SubSection,
-with the subsection name being the module name, and the contents of the
-.B SubSection
-being
-.B Options
-that are passed to the module when it is loaded.
-.PP
-Example: the extmod module (which contains a miscellaneous group of
-server extensions) can be loaded, with the XFree86\-DGA extension
-disabled by using the following entry:
-.PP
-.RS 4
-.nf
-.B "SubSection \*qextmod\*q"
-.B "   Option  \*qomit XFree86\-DGA\*q"
-.B EndSubSection
-.fi
-.RE
-.PP
-Modules are searched for in each directory specified in the
-.B ModulePath
-search path, and in the drivers, extensions, input, internal, and
-multimedia subdirectories of each of those directories.
-In addition to this, operating system specific subdirectories of all
-the above are searched first if they exist.
-.PP
-To see what extension modules are available, check the extensions
-subdirectory under:
-.PP
-.RS 4
-.nf
-__modulepath__
-.fi
-.RE
-.PP
-The \(lqextmod\(rq, \(lqdbe\(rq, \(lqdri\(rq, \(lqdri2\(rq, \(lqglx\(rq,
-and \(lqrecord\(rq extension modules are loaded automatically, if they
-are present, unless disabled with \*qDisable\*q entries.
-It is recommended
-that at very least the \(lqextmod\(rq extension module be loaded.
-If it isn't, some commonly used server extensions (like the SHAPE
-extension) will not be available.
-.SH "EXTENSIONS SECTION"
-The
-.B Extensions
-section is used to specify which X11 protocol extensions should be enabled
-or disabled.
-The
-.B Extensions
-section is optional, as are all of the entries that may be specified in
-it.
-.PP
-Entries in this section are listed as Option statements with the name of
-the extension as the first argument, and a boolean value as the second.
-The extension name is case\-sensitive, and matches the form shown in the output
-of \*qXorg -extension ?\*q.
-.PP
-.RS 7
-Example: the MIT-SHM extension can be disabled with the following entry:
-.PP
-.RS 4
-.nf
-.B "Section \*qExtensions\*q"
-.B "    Option \*qMIT-SHM\*q \*qDisable\*q"
-.B "EndSection"
-.fi
-.RE
-.RE
-.SH "INPUTDEVICE SECTION"
-The config file may have multiple
-.B InputDevice
-sections.
-Recent X servers employ input hotplugging to add input devices, with the HAL
-backend being the default backend for X servers since 1.4. It is usually not
-necessary to provide
-.B InputDevice
-sections in the xorg.conf if hotplugging is enabled.
-.PP
-If hotplugging is disabled, there will normally
-be at least two: one for the core (primary) keyboard
-and one for the core pointer.
-If either of these two is missing, a default configuration for the missing
-ones will be used. In the absence of an explicitly specified core input
-device, the first
-.B InputDevice
-marked as
-.B CorePointer
-(or
-.BR CoreKeyboard )
-is used.
-If there is no match there, the first
-.B InputDevice
-that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used.
-The final fallback is to use built\-in default configurations.
-Currently the default configuration may not work as expected on all platforms.
-.PP
-.B InputDevice
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qInputDevice\*q"
-.BI "    Identifier \*q" name \*q
-.BI "    Driver     \*q" inputdriver \*q
-.I  "    options"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-and
-.B Driver
-entries are required in all
-.B InputDevice
-sections.
-All other entries are optional.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this input device.
-The
-.B Driver
-entry specifies the name of the driver to use for this input device.
-When using the loadable server, the input driver module
-.RI \*q inputdriver \*q
-will be loaded for each active
-.B InputDevice
-section.
-An
-.B InputDevice
-section is considered active if it is referenced by an active
-.B ServerLayout
-section, if it is referenced by the
-.B \-keyboard
-or
-.B \-pointer
-command line options, or if it is selected implicitly as the core pointer
-or keyboard device in the absence of such explicit references.
-The most commonly used input drivers are
-.BR evdev (__drivermansuffix__)
-on Linux systems, and
-.BR kbd (__drivermansuffix__)
-and
-.BR mousedrv (__drivermansuffix__)
-on other platforms.
-.PP
-.PP
-.B InputDevice
-sections recognise some driver\-independent
-.BR Options ,
-which are described here.
-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, see
-.B Floating
-.TP 7
-.BI "Option \*qCoreKeyboard\*q"
-Deprecated, see
-.B Floating
-.TP 7
-.BI "Option \*qAlwaysCore\*q  \*q" boolean \*q
-Deprecated, see
-.B Floating
-.TP 7
-.BI "Option \*qSendCoreEvents\*q  \*q" boolean \*q
-Deprecated, see
-.B Floating
-
-.TP 7
-.BI "Option \*qFloating\*q  \*q" boolean \*q
-When enabled, the input device is set up floating and does not
-report events through any master device or control a cursor. The device is
-only available to clients using the X Input Extension API. This option is
-disabled by default.
-The options
-.B CorePointer,
-.B CoreKeyboard,
-.B AlwaysCore,
-and
-.B SendCoreEvents,
-are the inverse of option
-.B Floating
-(i.e.
-.B SendCoreEvents \*qon\*q
-is equivalent to
-.B Floating \*qoff\*q
-).
-
-This option controls the startup behavior only, a device
-may be reattached or set floating at runtime.
-.PP
-For pointing devices, the following options control how the pointer
-is accelerated or decelerated with respect to physical device motion. Most of
-these can be adjusted at runtime, see the xinput(1) man page for details. Only
-the most important acceleration options are discussed here.
-.TP 7
-.BI "Option \*qAccelerationProfile\*q  \*q" integer \*q
-Select the profile. In layman's terms, the profile constitutes the "feeling" of
-the acceleration. More formally, it defines how the transfer function (actual
-acceleration as a function of current device velocity and acceleration controls)
-is constructed. This is mainly a matter of personal preference.
-.PP
-.RS 6
-.nf
-.B  " 0      classic (mostly compatible)"
-.B  "-1      none (only constant deceleration is applied)"
-.B  " 1      device-dependent"
-.B  " 2      polynomial (polynomial function)"
-.B  " 3      smooth linear (soft knee, then linear)"
-.B  " 4      simple (normal when slow, otherwise accelerated)"
-.B  " 5      power (power function)"
-.B  " 6      linear (more speed, more acceleration)"
-.B  " 7      limited (like linear, but maxes out at threshold)"
-.fi
-.RE
-.TP 7
-.BI "Option \*qConstantDeceleration\*q  \*q" real \*q
-Makes the pointer go
-.B deceleration
-times slower than normal. Most useful for high-resolution devices.
-.TP 7
-.BI "Option \*qAdaptiveDeceleration\*q  \*q" real \*q
-Allows to actually decelerate the pointer when going slow. At most, it will be
-.B adaptive deceleration
-times slower. Enables precise pointer placement without sacrificing speed.
-.TP 7
-.BI "Option \*qAccelerationScheme\*q  \*q" string \*q
-Selects the scheme, which is the underlying algorithm.
-.PP
-.RS 7
-.nf
-.B  "predictable   default algorithm (behaving more predictable)"
-.B  "lightweight   old acceleration code (as specified in the X protocol spec)"
-.B  "none          no acceleration or deceleration"
-.fi
-.RE
-.TP 7
-.BI "Option \*qAccelerationNumerator\*q  \*q" integer \*q
-.TP 7
-.BI "Option \*qAccelerationDenominator\*q  \*q" integer \*q
-Set numerator and denominator of the acceleration factor. The acceleration
-factor is a rational which, together with threshold, can be used to tweak
-profiles to suit the users needs. The
-.B simple
-and
-.B limited
-profiles use it directly (i.e. they accelerate by the factor), for other
-profiles it should hold that a higher acceleration factor leads to a faster
-pointer. Typically, 1 is unaccelerated and values up to 5 are sensible.
-.TP 7
-.BI "Option \*qAccelerationThreshold\*q  \*q" integer \*q
-Set the threshold, which is roughly the velocity (usually device units per 10
-ms) required for acceleration to become effective. The precise effect varies
-with the profile however.
-
-.SH "INPUTCLASS SECTION"
-The config file may have multiple
-.B InputClass
-sections.
-These sections are optional and are used to provide configuration for a
-class of input devices as they are automatically added. An input device can
-match more than one
-.B InputClass
-section. Each class can override settings from a previous class, so it is
-best to arrange the sections with the most generic matches first.
-.PP
-.B InputClass
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qInputClass\*q"
-.BI "    Identifier  \*q" name \*q
-.I  "    entries"
-.I  "    ..."
-.I  "    options"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry is required in all
-.B InputClass
-sections.
-All other entries are optional.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this input class.
-The
-.B Driver
-entry specifies the name of the driver to use for this input device.
-After all classes have been examined, the
-.RI \*q inputdriver \*q
-module from the first
-.B Driver
-entry will be enabled when using the loadable server.
-.PP
-When an input device is automatically added, its characteristics are
-checked against all
-.B InputClass
-sections. Each section can contain optional entries to narrow the match
-of the class. If none of the optional entries appear, the
-.B InputClass
-section is generic and will match any input device. If more than one of
-these entries appear, they all must match for the configuration to apply.
-.PP
-There are two types of match entries used in
-.B InputClass
-sections. The first allows various tokens to be matched against attributes
-of the device. An entry can be constructed to match attributes from different
-devices by separating arguments with a '|' character. Multiple entries of the
-same type may be supplied to add multiple matching conditions on the same
-attribute. For example:
-.PP
-.RS 4
-.nf
-.B  "Section \*qInputClass\*q"
-.B  "    Identifier   \*qMy Class\*q"
-.B  "    # product string must contain example and
-.B  "    # either gizmo or gadget
-.B  "    MatchProduct \*qexample\*q
-.B  "    MatchProduct \*qgizmo|gadget\*q
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.TP 7
-.BI "MatchProduct  \*q" matchproduct \*q
-This entry can be used to check if the substring
-.RI \*q matchproduct \*q
-occurs in the device's product name.
-.TP 7
-.BI "MatchVendor  \*q" matchvendor \*q
-This entry can be used to check if the substring
-.RI \*q matchvendor \*q
-occurs in the device's vendor name.
-.TP 7
-.BI "MatchDevicePath \*q" matchdevice \*q
-This entry can be used to check if the device file matches the
-.RI \*q matchdevice \*q
-pathname pattern.
-.TP 7
-.BI "MatchOS \*q" matchos \*q
-This entry can be used to check if the operating system matches the
-case-insensitive
-.RI \*q matchos \*q
-string. This entry is only supported on platforms providing the
-.BR uname (2)
-system call.
-.TP 7
-.BI "MatchPnPID \*q" matchpnp \*q
-The device's Plug and Play (PnP) ID can be checked against the
-.RI \*q matchpnp \*q
-shell wildcard pattern.
-.TP 7
-.BI "MatchUSBID \*q" matchusb \*q
-The device's USB ID can be checked against the
-.RI \*q matchusb \*q
-shell wildcard pattern. The ID is constructed as lowercase hexadecimal numbers
-separated by a ':'. This is the same format as the
-.BR lsusb (8)
-program.
-.TP 7
-.BI "MatchDriver \*q" matchdriver \*q
-Check the case-sensitive string
-.RI \*q matchdriver \*q
-against the currently configured driver of the device. Ordering of sections
-using this entry is important since it will not match unless the driver has
-been set by the config backend or a previous
-.B InputClass
-section.
-.TP 7
-.BI "MatchTag \*q" matchtag \*q
-This entry can be used to check if tags assigned by the config backend
-matches the
-.RI \*q matchtag \*q
-pattern. A match is found if at least one of the tags given in
-.RI \*q matchtag \*q
-matches at least one of the tags assigned by the backend.
-.PP
-The second type of entry is used to match device types. These entries take a
-boolean argument similar to
-.B Option
-entries.
-.TP 7
-.BI "MatchIsKeyboard     \*q" bool \*q
-.TP 7
-.BI "MatchIsPointer      \*q" bool \*q
-.TP 7
-.BI "MatchIsJoystick     \*q" bool \*q
-.TP 7
-.BI "MatchIsTablet       \*q" bool \*q
-.TP 7
-.BI "MatchIsTouchpad     \*q" bool \*q
-.TP 7
-.BI "MatchIsTouchscreen  \*q" bool \*q
-.PP
-When an input device has been matched to the
-.B InputClass
-section, any
-.B Option
-entries are applied to the device. One
-.B InputClass
-specific
-.B Option
-is recognized. See the
-.B InputDevice
-section above for a description of the remaining
-.B Option
-entries.
-.TP 7
-.BI "Option \*qIgnore\*q \*q" boolean \*q
-This optional entry specifies that the device should be ignored entirely,
-and not added to the server. This can be useful when the device is handled
-by another program and no X events should be generated.
-.SH "DEVICE SECTION"
-The config file may have multiple
-.B Device
-sections.
-There must be at least one, for the video card being used.
-.PP
-.B Device
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qDevice\*q"
-.BI "    Identifier \*q" name \*q
-.BI "    Driver     \*q" driver \*q
-.I  "    entries"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-and
-.B Driver
-entries are required in all
-.B Device
-sections.  All other entries are optional.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this graphics device.
-The
-.B Driver
-entry specifies the name of the driver to use for this graphics device.
-When using the loadable server, the driver module
-.RI \*q driver \*q
-will be loaded for each active
-.B Device
-section.
-A
-.B Device
-section is considered active if it is referenced by an active
-.B Screen
-section.
-.PP
-.B Device
-sections recognise some driver\-independent entries and
-.BR Options ,
-which are described here.
-Not all drivers make use of these
-driver\-independent entries, and many of those that do don't require them
-to be specified because the information is auto\-detected.
-See the individual graphics driver manual pages for further information
-about this, and for a description of the device\-specific options.
-Note that most of the
-.B Options
-listed here (but not the other entries) may be specified in the
-.B Screen
-section instead of here in the
-.B Device
-section.
-.TP 7
-.BI "BusID  \*q" bus\-id \*q
-This specifies the bus location of the graphics card.
-For PCI/AGP cards,
-the
-.I bus\-id
-string has the form
-.BI PCI: bus : device : function
-(e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card).
-This field is usually optional in single-head configurations when using
-the primary graphics card.
-In multi-head configurations, or when using a secondary graphics card in a
-single-head configuration, this entry is mandatory.
-Its main purpose is to make an unambiguous connection between the device
-section and the hardware it is representing.
-This information can usually be found by running the pciaccess tool
-scanpci.
-.TP 7
-.BI "Screen  " number
-This option is mandatory for cards where a single PCI entity can drive more
-than one display (i.e., multiple CRTCs sharing a single graphics accelerator
-and video memory).
-One
-.B Device
-section is required for each head, and this
-parameter determines which head each of the
-.B Device
-sections applies to.
-The legal values of
-.I number
-range from 0 to one less than the total number of heads per entity.
-Most drivers require that the primary screen (0) be present.
-.TP 7
-.BI "Chipset  \*q" chipset \*q
-This usually optional entry specifies the chipset used on the graphics
-board.
-In most cases this entry is not required because the drivers will probe the
-hardware to determine the chipset type.
-Don't specify it unless the driver-specific documentation recommends that you
-do.
-.TP 7
-.BI "Ramdac  \*q" ramdac\-type \*q
-This optional entry specifies the type of RAMDAC used on the graphics
-board.
-This is only used by a few of the drivers, and in most cases it is not
-required because the drivers will probe the hardware to determine the
-RAMDAC type where possible.
-Don't specify it unless the driver-specific documentation recommends that you
-do.
-.TP 7
-.BI "DacSpeed  " speed
-.TP 7
-.BI "DacSpeed  " "speed\-8 speed\-16 speed\-24 speed\-32"
-This optional entry specifies the RAMDAC speed rating (which is usually
-printed on the RAMDAC chip).
-The speed is in MHz.
-When one value is given, it applies to all framebuffer pixel sizes.
-When multiple values are given, they apply to the framebuffer pixel sizes
-8, 16, 24 and 32 respectively.
-This is not used by many drivers, and only needs to be specified when the
-speed rating of the RAMDAC is different from the defaults built in to
-driver, or when the driver can't auto-detect the correct defaults.
-Don't specify it unless the driver-specific documentation recommends that you
-do.
-.TP 7
-.BI "Clocks  " "clock ..."
-specifies the pixel that are on your graphics board.
-The clocks are in MHz, and may be specified as a floating point number.
-The value is stored internally to the nearest kHz.
-The ordering of the clocks is important.
-It must match the order in which they are selected on the graphics board.
-Multiple
-.B Clocks
-lines may be specified, and each is concatenated to form the list.
-Most drivers do not use this entry, and it is only required for some older
-boards with non-programmable clocks.
-Don't specify this entry unless the driver-specific documentation explicitly
-recommends that you do.
-.TP
-.BI "ClockChip  \*q" clockchip\-type \*q
-This optional entry is used to specify the clock chip type on graphics
-boards which have a programmable clock generator.
-Only a few __xservername__ drivers support programmable clock chips.
-For details, see the appropriate driver manual page.
-.TP 7
-.BI "VideoRam  " "mem"
-This optional entry specifies the amount of video ram that is installed
-on the graphics board.
-This is measured in kBytes.
-In most cases this is not required because the __xservername__ server probes
-the graphics board to determine this quantity.
-The driver-specific documentation should indicate when it might be needed.
-.TP 7
-.BI "BiosBase  " "baseaddress"
-This optional entry specifies the base address of the video BIOS for
-the VGA board.
-This address is normally auto-detected, and should only be specified if the
-driver-specific documentation recommends it.
-.TP 7
-.BI "MemBase  " "baseaddress"
-This optional entry specifies the memory base address of a graphics
-board's linear frame buffer.
-This entry is not used by many drivers, and it should only be specified if
-the driver-specific documentation recommends it.
-.TP 7
-.BI "IOBase  " "baseaddress"
-This optional entry specifies the IO base address.
-This entry is not used by many drivers, and it should only be specified if
-the driver-specific documentation recommends it.
-.TP 7
-.BI "ChipID  " "id"
-This optional entry specifies a numerical ID representing the chip type.
-For PCI cards, it is usually the device ID.
-This can be used to override the auto-detection, but that should only be done
-when the driver-specific documentation recommends it.
-.TP 7
-.BI "ChipRev  " "rev"
-This optional entry specifies the chip revision number.
-This can be used to override the auto-detection, but that should only be done
-when the driver-specific documentation recommends it.
-.TP 7
-.BI "TextClockFreq  " "freq"
-This optional entry specifies the pixel clock frequency that is used
-for the regular text mode.
-The frequency is specified in MHz.
-This is rarely used.
-.TP 7
-.BI "Option \*qModeDebug\*q \*q" boolean \*q
-Enable printing of additional debugging information about modesetting to
-the server log.
-.ig
-.TP 7
-This optional entry allows an IRQ number to be specified.
-..
-.TP 7
-.B Options
-Option flags may be specified in the
-.B Device
-sections.
-These include driver\-specific options and driver\-independent options.
-The former are described in the driver\-specific documentation.
-Some of the latter are described below in the section about the
-.B Screen
-section, and they may also be included here.
-
-.SH "VIDEOADAPTOR SECTION"
-Nobody wants to say how this works.
-Maybe nobody knows ...
-
-.SH "MONITOR SECTION"
-The config file may have multiple
-.B Monitor
-sections.
-There should normally be at least one, for the monitor being used,
-but a default configuration will be created when one isn't specified.
-.PP
-.B Monitor
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qMonitor\*q"
-.BI "    Identifier \*q" name \*q
-.I  "    entries"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The only mandatory entry in a
-.B Monitor
-section is the
-.B Identifier
-entry.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this monitor.
-The
-.B Monitor
-section may be used to provide information about the specifications of the
-monitor, monitor-specific
-.BR Options ,
-and information about the video modes to use with the monitor.
-.PP
-With RandR 1.2-enabled drivers, monitor sections may be tied to specific
-outputs of the video card.  Using the name of the output defined by the video
-driver plus the identifier of a monitor section, one associates a monitor
-section with an output by adding an option to the Device section in the
-following format:
-
-.B Option \*qMonitor-outputname\*q \*qmonitorsection\*q
-
-(for example,
-.B Option \*qMonitor-VGA\*q \*qVGA monitor\*q
-for a VGA output)
-.PP
-In the absence of specific association of monitor sections to outputs, if a
-monitor section is present the server will associate it with an output to
-preserve compatibility for previous single-head configurations.
-.PP
-Specifying video modes is optional because the server will use the DDC or other
-information provided by the monitor to automatically configure the list of
-modes available.
-When modes are specified explicitly in the
-.B Monitor
-section (with the
-.BR Modes ,
-.BR ModeLine ,
-or
-.B UseModes
-keywords), built-in modes with the same names are not included.
-Built-in modes with different names are, however, still implicitly included,
-when they meet the requirements of the monitor.
-.PP
-The entries that may be used in
-.B Monitor
-sections are described below.
-.TP 7
-.BI "VendorName  \*q" vendor \*q
-This optional entry specifies the monitor's manufacturer.
-.TP 7
-.BI "ModelName  \*q" model \*q
-This optional entry specifies the monitor's model.
-.TP 7
-.BI "HorizSync  " "horizsync\-range"
-gives the range(s) of horizontal sync frequencies supported by the
-monitor.
-.I horizsync\-range
-may be a comma separated list of either discrete values or ranges of
-values.
-A range of values is two values separated by a dash.
-By default the values are in units of kHz.
-They may be specified in MHz or Hz
-if
-.B MHz
-or
-.B Hz
-is added to the end of the line.
-The data given here is used by the __xservername__ server to determine if video
-modes are within the specifications of the monitor.
-This information should be available in the monitor's handbook.
-If this entry is omitted, a default range of 28\-33kHz is used.
-.TP 7
-.BI "VertRefresh  " "vertrefresh\-range"
-gives the range(s) of vertical refresh frequencies supported by the
-monitor.
-.I vertrefresh\-range
-may be a comma separated list of either discrete values or ranges of
-values.
-A range of values is two values separated by a dash.
-By default the values are in units of Hz.
-They may be specified in MHz or kHz
-if
-.B MHz
-or
-.B kHz
-is added to the end of the line.
-The data given here is used by the __xservername__ server to determine if video
-modes are within the specifications of the monitor.
-This information should be available in the monitor's handbook.
-If this entry is omitted, a default range of 43\-72Hz is used.
-.TP 7
-.BI "DisplaySize  " "width height"
-This optional entry gives the width and height, in millimetres, of the
-picture area of the monitor.
-If given this is used to calculate the horizontal and vertical pitch (DPI) of
-the screen.
-.TP 7
-.BI "Gamma  " "gamma\-value"
-.TP 7
-.BI "Gamma  " "red\-gamma green\-gamma blue\-gamma"
-This is an optional entry that can be used to specify the gamma correction
-for the monitor.
-It may be specified as either a single value or as three separate RGB values.
-The values should be in the range 0.1 to 10.0, and the default is 1.0.
-Not all drivers are capable of using this information.
-.TP 7
-.BI "UseModes  \*q" modesection\-id \*q
-Include the set of modes listed in the
-.B Modes
-section called
-.IR modesection\-id.
-This makes all of the modes defined in that section available for use by
-this monitor.
-.TP 7
-.BI "Mode  \*q" name \*q
-This is an optional multi-line entry that can be used to provide
-definitions for video modes for the monitor.
-In most cases this isn't necessary because the built-in set of VESA standard
-modes will be sufficient.
-The
-.B Mode
-keyword indicates the start of a multi-line video mode description.
-The mode description is terminated with the
-.B EndMode
-keyword.
-The mode description consists of the following entries:
-.RS 7
-.TP 4
-.BI "DotClock  " clock
-is the dot (pixel) clock rate to be used for the mode.
-.TP 4
-.BI "HTimings  " "hdisp hsyncstart hsyncend htotal"
-specifies the horizontal timings for the mode.
-.TP 4
-.BI "VTimings  " "vdisp vsyncstart vsyncend vtotal"
-specifies the vertical timings for the mode.
-.TP 4
-.BI "Flags  \*q" flag \*q " ..."
-specifies an optional set of mode flags, each of which is a separate
-string in double quotes.
-.B \*qInterlace\*q
-indicates that the mode is interlaced.
-.B \*qDoubleScan\*q
-indicates a mode where each scanline is doubled.
-.B \*q+HSync\*q
-and
-.B \*q\-HSync\*q
-can be used to select the polarity of the HSync signal.
-.B \*q+VSync\*q
-and
-.B \*q\-VSync\*q
-can be used to select the polarity of the VSync signal.
-.B \*qComposite\*q
-can be used to specify composite sync on hardware where this is supported.
-Additionally, on some hardware,
-.B \*q+CSync\*q
-and
-.B \*q\-CSync\*q
-may be used to select the composite sync polarity.
-.TP 4
-.BI "HSkew  " hskew
-specifies the number of pixels (towards the right edge of the screen) by
-which the display enable signal is to be skewed.
-Not all drivers use this information.
-This option might become necessary to override the default value supplied
-by the server (if any).
-\(lqRoving\(rq horizontal lines indicate this value needs to be increased.
-If the last few pixels on a scan line appear on the left of the screen,
-this value should be decreased.
-.TP 4
-.BI "VScan  " vscan
-specifies the number of times each scanline is painted on the screen.
-Not all drivers use this information.
-Values less than 1 are treated as 1, which is the default.
-Generally, the
-.B \*qDoubleScan\*q
-.B Flag
-mentioned above doubles this value.
-.RE
-.TP 7
-.BI "ModeLine  \*q" name \*q " mode\-description"
-This entry is a more compact version of the
-.B Mode
-entry, and it also can be used to specify video modes for the monitor.
-is a single line format for specifying video modes.
-In most cases this isn't necessary because the built\-in set of VESA
-standard modes will be sufficient.
-.PP
-.RS 7
-The
-.I mode\-description
-is in four sections, the first three of which are mandatory.
-The first is the dot (pixel) clock.
-This is a single number specifying the pixel clock rate for the mode in
-MHz.
-The second section is a list of four numbers specifying the horizontal
-timings.
-These numbers are the
-.IR hdisp ,
-.IR hsyncstart ,
-.IR hsyncend ,
-and
-.I htotal
-values.
-The third section is a list of four numbers specifying the vertical
-timings.
-These numbers are the
-.IR vdisp ,
-.IR vsyncstart ,
-.IR vsyncend ,
-and
-.I vtotal
-values.
-The final section is a list of flags specifying other characteristics of
-the mode.
-.B Interlace
-indicates that the mode is interlaced.
-.B DoubleScan
-indicates a mode where each scanline is doubled.
-.B +HSync
-and
-.B \-HSync
-can be used to select the polarity of the HSync signal.
-.B +VSync
-and
-.B \-VSync
-can be used to select the polarity of the VSync signal.
-.B Composite
-can be used to specify composite sync on hardware where this is supported.
-Additionally, on some hardware,
-.B +CSync
-and
-.B \-CSync
-may be used to select the composite sync polarity.
-The
-.B HSkew
-and
-.B VScan
-options mentioned above in the
-.B Modes
-entry description can also be used here.
-.RE
-.TP 7
-.BI "Option " "\*qDPMS\*q  " \*qbool\*q
-This option controls whether the server should enable the DPMS extension
-for power management for this screen.  The default is to enable the
-extension.
-.TP 7
-.BI "Option " "\*qSyncOnGreen\*q  " \*qbool\*q
-This option controls whether the video card should drive the sync signal
-on the green color pin.  Not all cards support this option, and most
-monitors do not require it.  The default is off.
-.TP 7
-.BI "Option " "\*qPrimary\*q  " \*qbool\*q
-This optional entry specifies that the monitor should be treated as the primary
-monitor. (RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qPreferredMode\*q  " \*qstring\*q
-This optional entry specifies a mode to be marked as the preferred initial mode
-of the monitor.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qPosition\*q  " "\*qx y\*q"
-This optional entry specifies the position of the monitor within the X
-screen.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qLeftOf\*q  " \*qoutput\*q
-This optional entry specifies that the monitor should be positioned to the
-left of the output (not monitor) of the given name.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qRightOf\*q  " \*qoutput\*q
-This optional entry specifies that the monitor should be positioned to the
-right of the output (not monitor) of the given name.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qAbove\*q  " \*qoutput\*q
-This optional entry specifies that the monitor should be positioned above the
-output (not monitor) of the given name.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qBelow\*q  " \*qoutput\*q
-This optional entry specifies that the monitor should be positioned below the
-output (not monitor) of the given name.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qEnable\*q  " \*qbool\*q
-This optional entry specifies whether the monitor should be turned on
-at startup.  By default, the server will attempt to enable all connected
-monitors.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qDefaultModes\*q  " \*qbool\*q
-This optional entry specifies whether the server should add supported default
-modes to the list of modes offered on this monitor. By default, the server
-will add default modes; you should only disable this if you can guarantee
-that EDID will be available at all times, or if you have added custom modelines
-which the server can use.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qMinClock\*q  " \*qfrequency\*q
-This optional entry specifies the minimum dot clock, in kHz, that is supported
-by the monitor.
-.TP 7
-.BI "Option " "\*qMaxClock\*q  " \*qfrequency\*q
-This optional entry specifies the maximum dot clock, in kHz, that is supported
-by the monitor.
-.TP 7
-.BI "Option " "\*qIgnore\*q  " \*qbool\*q
-This optional entry specifies that the monitor should be ignored entirely,
-and not reported through RandR.  This is useful if the hardware reports the
-presence of outputs that don't exist.
-(RandR 1.2-supporting drivers only)
-.TP 7
-.BI "Option " "\*qRotate\*q  " \*qrotation\*q
-This optional entry specifies the initial rotation of the given monitor.
-Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and
-\*qinverted\*q.
-(RandR 1.2-supporting drivers only)
-
-.SH "MODES SECTION"
-The config file may have multiple
-.B Modes
-sections, or none.
-These sections provide a way of defining sets of video modes independently
-of the
-.B Monitor
-sections.
-.B Monitor
-sections may include the definitions provided in these sections by
-using the
-.B UseModes
-keyword.
-In most cases the
-.B Modes
-sections are not necessary because the built\-in set of VESA standard modes
-will be sufficient.
-.PP
-.B Modes
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qModes\*q"
-.BI "    Identifier \*q" name \*q
-.I  "    entries"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-entry specifies the unique name for this set of mode descriptions.
-The other entries permitted in
-.B Modes
-sections are the
-.B Mode
-and
-.B ModeLine
-entries that are described above in the
-.B Monitor
-section.
-.SH "SCREEN SECTION"
-The config file may have multiple
-.B Screen
-sections.
-There must be at least one, for the \(lqscreen\(rq being used.
-A \(lqscreen\(rq represents the binding of a graphics device
-.RB ( Device
-section) and a monitor
-.RB ( Monitor
-section).
-A
-.B Screen
-section is considered \(lqactive\(rq if it is referenced by an active
-.B ServerLayout
-section or by the
-.B \-screen
-command line option.
-If neither of those is present, the first
-.B Screen
-section found in the config file is considered the active one.
-.PP
-.B Screen
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qScreen\*q"
-.BI "    Identifier \*q" name \*q
-.BI "    Device     \*q" devid \*q
-.BI "    Monitor    \*q" monid \*q
-.I  "    entries"
-.I  "    ..."
-.BI "    SubSection \*qDisplay\*q"
-.I  "       entries"
-.I  "       ...
-.B  "    EndSubSection"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-The
-.B Identifier
-and
-.B Device
-entries are mandatory.
-All others are optional.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this screen.
-The
-.B Screen
-section provides information specific to the whole screen, including
-screen\-specific
-.BR Options .
-In multi\-head configurations, there will be multiple active
-.B Screen
-sections, one for each head.
-The entries available
-for this section are:
-.TP 7
-.BI "Device  \*q" device\-id \*q
-This mandatory entry specifies the
-.B Device
-section to be used for this screen.
-This is what ties a specific graphics card to a screen.
-The
-.I device\-id
-must match the
-.B Identifier
-of a
-.B Device
-section in the config file.
-.TP 7
-.BI "Monitor  \*q" monitor\-id \*q
-specifies which monitor description is to be used for this screen.
-If a
-.B Monitor
-name is not specified, a default configuration is used.
-Currently the default configuration may not function as expected on all
-platforms.
-.TP 7
-.BI "VideoAdaptor  \*q" xv\-id \*q
-specifies an optional Xv video adaptor description to be used with this
-screen.
-.TP 7
-.BI "DefaultDepth  " depth
-specifies which color depth the server should use by default.
-The
-.B \-depth
-command line option can be used to override this.
-If neither is specified, the default depth is driver\-specific, but in most
-cases is 8.
-.TP 7
-.BI "DefaultFbBpp  " bpp
-specifies which framebuffer layout to use by default.
-The
-.B \-fbbpp
-command line option can be used to override this.
-In most cases the driver will chose the best default value for this.
-The only case where there is even a choice in this value is for depth 24,
-where some hardware supports both a packed 24 bit framebuffer layout and a
-sparse 32 bit framebuffer layout.
-.TP 7
-.B Options
-Various
-.B Option
-flags may be specified in the
-.B Screen
-section.
-Some are driver\-specific and are described in the driver documentation.
-Others are driver\-independent, and will eventually be described here.
-.\" XXX These should really be in an xaa man page.
-.TP 7
-.BI "Option \*qAccel\*q"
-Enables XAA (X Acceleration Architecture), a mechanism that makes video cards'
-2D hardware acceleration available to the  __xservername__ server.
-This option is on by default, but it may be necessary to turn it off if
-there are bugs in the driver.
-There are many options to disable specific accelerated operations, listed
-below.
-Note that disabling an operation will have no effect if the operation is
-not accelerated (whether due to lack of support in the hardware or in the
-driver).
-.TP 7
-.BI "Option \*qInitPrimary\*q \*q" boolean \*q
-Use the Int10 module to initialize the primary graphics card.
-Normally, only secondary cards are soft-booted using the Int10 module, as the
-primary card has already been initialized by the BIOS at boot time.
-Default: false.
-.TP 7
-.BI "Option \*qNoInt10\*q \*q" boolean \*q
-Disables the Int10 module, a module that uses the int10 call to the BIOS
-of the graphics card to initialize it.
-Default: false.
-.TP 7
-.BI "Option \*qNoMTRR\*q"
-Disables MTRR (Memory Type Range Register) support, a feature of modern
-processors which can improve video performance by a factor of up to 2.5.
-Some hardware has buggy MTRR support, and some video drivers have been
-known to exhibit problems when MTRR's are used.
-.TP 7
-.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in system memory (using a memory\-mapped aperture).
-.TP 7
-.BI "Option \*qXaaNoColor8x8PatternFillRect\*q"
-Disables accelerated fills of a rectangular region with a full\-color
-pattern.
-.TP 7
-.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q"
-Disables accelerated fills of a trapezoidal region with a full\-color
-pattern.
-.TP 7
-.BI "Option \*qXaaNoDashedBresenhamLine\*q"
-Disables accelerated dashed Bresenham line draws.
-.TP 7
-.BI "Option \*qXaaNoDashedTwoPointLine\*q"
-Disables accelerated dashed line draws between two arbitrary points.
-.TP 7
-.BI "Option \*qXaaNoImageWriteRect\*q"
-Disables accelerated transfers of full\-color rectangular patterns from
-system memory to video memory (using a memory\-mapped aperture).
-.TP 7
-.BI "Option \*qXaaNoMono8x8PatternFillRect\*q"
-Disables accelerated fills of a rectangular region with a monochrome
-pattern.
-.TP 7
-.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q"
-Disables accelerated fills of a trapezoidal region with a monochrome
-pattern.
-.TP 7
-.BI "Option \*qXaaNoOffscreenPixmaps\*q"
-Disables accelerated draws into pixmaps stored in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoPixmapCache\*q"
-Disables caching of patterns in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in system memory (one scan line at a time).
-.TP 7
-.BI "Option \*qXaaNoScanlineImageWriteRect\*q"
-Disables accelerated transfers of full\-color rectangular patterns from
-system memory to video memory (one scan line at a time).
-.TP 7
-.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q"
-Disables accelerated rectangular expansion blits from source patterns
-stored in offscreen video memory.
-.TP 7
-.BI "Option \*qXaaNoScreenToScreenCopy\*q"
-Disables accelerated copies of rectangular regions from one part of
-video memory to another part of video memory.
-.TP 7
-.BI "Option \*qXaaNoSolidBresenhamLine\*q"
-Disables accelerated solid Bresenham line draws.
-.TP 7
-.BI "Option \*qXaaNoSolidFillRect\*q"
-Disables accelerated solid\-color fills of rectangles.
-.TP 7
-.BI "Option \*qXaaNoSolidFillTrap\*q"
-Disables accelerated solid\-color fills of Bresenham trapezoids.
-.TP 7
-.BI "Option \*qXaaNoSolidHorVertLine\*q"
-Disables accelerated solid horizontal and vertical line draws.
-.TP 7
-.BI "Option \*qXaaNoSolidTwoPointLine\*q"
-Disables accelerated solid line draws between two arbitrary points.
-.PP
-Each
-.B Screen
-section may optionally contain one or more
-.B Display
-subsections.
-Those subsections provide depth/fbbpp specific configuration information,
-and the one chosen depends on the depth and/or fbbpp that is being used for
-the screen.
-The
-.B Display
-subsection format is described in the section below.
-
-.SH "DISPLAY SUBSECTION"
-Each
-.B Screen
-section may have multiple
-.B Display
-subsections.
-The \(lqactive\(rq
-.B Display
-subsection is the first that matches the depth and/or fbbpp values being
-used, or failing that, the first that has neither a depth or fbbpp value
-specified.
-The
-.B Display
-subsections are optional.
-When there isn't one that matches the depth and/or fbbpp values being used,
-all the parameters that can be specified here fall back to their defaults.
-.PP
-.B Display
-subsections have the following format:
-.PP
-.RS 4
-.nf
-.B  "    SubSection \*qDisplay\*q"
-.BI "        Depth  " depth
-.I  "        entries"
-.I  "        ..."
-.B  "    EndSubSection"
-.fi
-.RE
-.TP 7
-.BI "Depth  " depth
-This entry specifies what colour depth the
-.B Display
-subsection is to be used for.
-This entry is usually specified, but it may be omitted to create a match\-all
-.B Display
-subsection or when wishing to match only against the
-.B FbBpp
-parameter.
-The range of
-.I depth
-values that are allowed depends on the driver.
-Most drivers support 8, 15, 16 and 24.
-Some also support 1 and/or 4, and some may support other values (like 30).
-Note:
-.I depth
-means the number of bits in a pixel that are actually used to determine
-the pixel colour.
-32 is not a valid
-.I depth
-value.
-Most hardware that uses 32 bits per pixel only uses 24 of them to hold the
-colour information, which means that the colour depth is 24, not 32.
-.TP 7
-.BI "FbBpp  " bpp
-This entry specifies the framebuffer format this
-.B Display
-subsection is to be used for.
-This entry is only needed when providing depth 24 configurations that allow
-a choice between a 24 bpp packed framebuffer format and a 32bpp sparse
-framebuffer format.
-In most cases this entry should not be used.
-.TP 7
-.BI "Weight  " "red\-weight green\-weight blue\-weight"
-This optional entry specifies the relative RGB weighting to be used
-for a screen is being used at depth 16 for drivers that allow multiple
-formats.
-This may also be specified from the command line with the
-.B \-weight
-option (see
-.BR __xservername__(__appmansuffix__)).
-.TP 7
-.BI "Virtual  " "xdim ydim"
-This optional entry specifies the virtual screen resolution to be used.
-.I xdim
-must be a multiple of either 8 or 16 for most drivers, and a multiple
-of 32 when running in monochrome mode.
-The given value will be rounded down if this is not the case.
-Video modes which are too large for the specified virtual size will be
-rejected.
-If this entry is not present, the virtual screen resolution will be set to
-accommodate all the valid video modes given in the
-.B Modes
-entry.
-Some drivers/hardware combinations do not support virtual screens.
-Refer to the appropriate driver\-specific documentation for details.
-.TP 7
-.BI "ViewPort  " "x0 y0"
-This optional entry sets the upper left corner of the initial display.
-This is only relevant when the virtual screen resolution is different
-from the resolution of the initial video mode.
-If this entry is not given, then the initial display will be centered in
-the virtual display area.
-.TP 7
-.BI "Modes  \*q" mode\-name \*q " ..."
-This optional entry specifies the list of video modes to use.
-Each
-.I mode\-name
-specified must be in double quotes.
-They must correspond to those specified or referenced in the appropriate
-.B Monitor
-section (including implicitly referenced built\-in VESA standard modes).
-The server will delete modes from this list which don't satisfy various
-requirements.
-The first valid mode in this list will be the default display mode for
-startup.
-The list of valid modes is converted internally into a circular list.
-It is possible to switch to the next mode with
-.B Ctrl+Alt+Keypad\-Plus
-and to the previous mode with
-.BR Ctrl+Alt+Keypad\-Minus .
-When this entry is omitted, the valid modes referenced by the appropriate
-.B Monitor
-section will be used.  If the
-.B Monitor
-section contains no modes, then the selection will be taken from the
-built-in VESA standard modes.
-.TP 7
-.BI "Visual  \*q" visual\-name \*q
-This optional entry sets the default root visual type.
-This may also be specified from the command line (see the
-.BR Xserver(__appmansuffix__)
-man page).
-The visual types available for depth 8 are (default is
-.BR PseudoColor ):
-.PP
-.RS 11
-.nf
-.B StaticGray
-.B GrayScale
-.B StaticColor
-.B PseudoColor
-.B TrueColor
-.B DirectColor
-.fi
-.RE
-.PP
-.RS 7
-The visual type available for the depths 15, 16 and 24 are (default is
-.BR TrueColor ):
-.PP
-.RS 4
-.nf
-.B TrueColor
-.B DirectColor
-.fi
-.RE
-.PP
-Not all drivers support
-.B DirectColor
-at these depths.
-.PP
-The visual types available for the depth 4 are (default is
-.BR StaticColor ):
-.PP
-.RS 4
-.nf
-.B StaticGray
-.B GrayScale
-.B StaticColor
-.B PseudoColor
-.fi
-.RE
-.PP
-The visual type available for the depth 1 (monochrome) is
-.BR StaticGray .
-.RE
-.TP 7
-.BI "Black  " "red green blue"
-This optional entry allows the \(lqblack\(rq colour to be specified.
-This is only supported at depth 1.
-The default is black.
-.TP 7
-.BI "White  " "red green blue"
-This optional entry allows the \(lqwhite\(rq colour to be specified.
-This is only supported at depth 1.
-The default is white.
-.TP 7
-.B Options
-Option flags may be specified in the
-.B Display
-subsections.
-These may include driver\-specific options and driver\-independent options.
-The former are described in the driver\-specific documentation.
-Some of the latter are described above in the section about the
-.B Screen
-section, and they may also be included here.
-.SH "SERVERLAYOUT SECTION"
-The config file may have multiple
-.B ServerLayout
-sections.
-A \(lqserver layout\(rq represents the binding of one or more screens
-.RB ( Screen
-sections) and one or more input devices
-.RB ( InputDevice
-sections) to form a complete configuration.
-In multi\-head configurations, it also specifies the relative layout of the
-heads.
-A
-.B ServerLayout
-section is considered \(lqactive\(rq if it is referenced by the
-.B \-layout
-command line option or by an
-.B "Option \*qDefaultServerLayout\*q"
-entry in the
-.B ServerFlags
-section (the former takes precedence over the latter).
-If those options are not used, the first
-.B ServerLayout
-section found in the config file is considered the active one.
-If no
-.B ServerLayout
-sections are present, the single active screen and two active (core)
-input devices are selected as described in the relevant sections above.
-.PP
-.B ServerLayout
-sections have the following format:
-.PP
-.RS 4
-.nf
-.B  "Section \*qServerLayout\*q"
-.BI "    Identifier   \*q" name \*q
-.BI "    Screen       \*q" screen\-id \*q
-.I  "    ..."
-.BI "    InputDevice  \*q" idev\-id \*q
-.I  "    ..."
-.I  "    options"
-.I  "    ..."
-.B  "EndSection"
-.fi
-.RE
-.PP
-Each
-.B ServerLayout
-section must have an
-.B Identifier
-entry and at least one
-.B Screen
-entry.
-.PP
-The
-.B Identifier
-entry specifies the unique name for this server layout.
-The
-.B ServerLayout
-section provides information specific to the whole session, including
-session\-specific
-.BR Options .
-The
-.B ServerFlags
-options (described above) may be specified here, and ones given here
-override those given in the
-.B ServerFlags
-section.
-.PP
-The entries that may be used in this section are described here.
-.TP 7
-.BI "Screen  " "screen\-num" " \*qscreen\-id\*q " "position\-information"
-One of these entries must be given for each screen being used in
-a session.
-The
-.I screen\-id
-field is mandatory, and specifies the
-.B Screen
-section being referenced.
-The
-.I screen\-num
-field is optional, and may be used to specify the screen number
-in multi\-head configurations.
-When this field is omitted, the screens will be numbered in the order that
-they are listed in.
-The numbering starts from 0, and must be consecutive.
-The
-.I position\-information
-field describes the way multiple screens are positioned.
-There are a number of different ways that this information can be provided:
-.RS 7
-.TP 4
-.I  "x y"
-.TP 4
-.BI "Absolute  " "x y"
-These both specify that the upper left corner's coordinates are
-.RI ( x , y ).
-The
-.B Absolute
-keyword is optional.
-Some older versions of XFree86 (4.2 and earlier) don't recognise the
-.B Absolute
-keyword, so it's safest to just specify the coordinates without it.
-.TP 4
-.BI "RightOf   \*q" screen\-id \*q
-.TP 4
-.BI "LeftOf    \*q" screen\-id \*q
-.TP 4
-.BI "Above     \*q" screen\-id \*q
-.TP 4
-.BI "Below     \*q" screen\-id \*q
-.TP 4
-.BI "Relative  \*q" screen\-id \*q " x y"
-These give the screen's location relative to another screen.
-The first four position the screen immediately to the right, left, above or
-below the other screen.
-When positioning to the right or left, the top edges are aligned.
-When positioning above or below, the left edges are aligned.
-The
-.B Relative
-form specifies the offset of the screen's origin (upper left corner)
-relative to the origin of another screen.
-.RE
-.TP 7
-.BI "InputDevice  \*q" idev\-id "\*q \*q" option \*q " ..."
-One of these entries should be given for each input device being used in
-a session.
-Normally at least two are required, one each for the core pointer and
-keyboard devices.
-If either of those is missing, suitable
-.B InputDevice
-entries are searched for using the method described above in the
-.B INPUTDEVICE
-section.  The
-.I idev\-id
-field is mandatory, and specifies the name of the
-.B InputDevice
-section being referenced.
-Multiple
-.I option
-fields may be specified, each in double quotes.
-The options permitted here are any that may also be given in the
-.B InputDevice
-sections.
-Normally only session\-specific input device options would be used here.
-The most commonly used options are:
-.PP
-.RS 11
-.nf
-.B \*qCorePointer\*q
-.B \*qCoreKeyboard\*q
-.B \*qSendCoreEvents\*q
-.fi
-.RE
-.PP
-.RS 7
-and the first two should normally be used to indicate the core pointer
-and core keyboard devices respectively.
-.RE
-.TP 7
-.B Options
-In addition to the following, any option permitted in the
-.B ServerFlags
-section may also be specified here.
-When the same option appears in both places, the value given here overrides
-the one given in the
-.B ServerFlags
-section.
-.TP 7
-.BI "Option \*qIsolateDevice\*q  \*q" bus\-id \*q
-Restrict device resets to the specified
-.IR bus\-id .
-See the
-.B BusID
-option (described in
-.BR "DEVICE SECTION" ,
-above) for the format of the
-.I bus\-id
-parameter.
-This option overrides
-.BR SingleCard ,
-if specified.
-At present, only PCI devices can be isolated in this manner.
-.TP 7
-.BI "Option \*qSingleCard\*q  \*q" boolean \*q
-As
-.BR IsolateDevice ,
-except that the bus ID of the first device in the layout is used.
-.PP
-Here is an example of a
-.B ServerLayout
-section for a dual headed configuration with two mice:
-.PP
-.RS 4
-.nf
-.B "Section \*qServerLayout\*q"
-.B "    Identifier  \*qLayout 1\*q"
-.B "    Screen      \*qMGA 1\*q"
-.B "    Screen      \*qMGA 2\*q RightOf \*qMGA 1\*q"
-.B "    InputDevice \*qKeyboard 1\*q \*qCoreKeyboard\*q"
-.B "    InputDevice \*qMouse 1\*q    \*qCorePointer\*q"
-.B "    InputDevice \*qMouse 2\*q    \*qSendCoreEvents\*q"
-.B "    Option      \*qBlankTime\*q  \*q5\*q"
-.B "EndSection"
-.fi
-.RE
-.SH "DRI SECTION"
-This optional section is used to provide some information for the
-Direct Rendering Infrastructure.
-Details about the format of this section can be found on-line at
-.IR <http://dri.freedesktop.org/> .
-.SH "VENDOR SECTION"
-The optional
-.B Vendor
-section may be used to provide vendor\-specific configuration information.
-Multiple
-.B Vendor
-sections may be present, and they may contain an
-.B Identifier
-entry and multiple
-.B Option
-flags.
-The data therein is not used in this release.
-.PP
-.SH "SEE ALSO"
-General:
-.BR X (__miscmansuffix__),
-.BR Xserver (__appmansuffix__),
-.BR __xservername__ (__appmansuffix__),
-.BR cvt (__appmansuffix__),
-.BR gtf (__appmansuffix__).
-.PP
-.B "Not all modules or interfaces are available on all platforms."
-.PP
-Display drivers:
-.BR apm (__drivermansuffix__),
-.BR ati (__drivermansuffix__),
-.BR chips (__drivermansuffix__),
-.BR cirrus (__drivermansuffix__),
-.BR cyrix (__drivermansuffix__),
-.BR fbdev (__drivermansuffix__),
-.BR glide (__drivermansuffix__),
-.BR glint (__drivermansuffix__),
-.BR i128 (__drivermansuffix__),
-.BR i740 (__drivermansuffix__),
-.BR imstt (__drivermansuffix__),
-.BR intel (__drivermansuffix__),
-.BR mga (__drivermansuffix__),
-.BR neomagic (__drivermansuffix__),
-.BR nv (__drivermansuffix__),
-.BR openchrome (__drivermansuffix__),
-.BR r128 (__drivermansuffix__),
-.BR radeon (__drivermansuffix__),
-.BR rendition (__drivermansuffix__),
-.BR savage (__drivermansuffix__),
-.BR s3virge (__drivermansuffix__),
-.BR siliconmotion (__drivermansuffix__),
-.BR sis (__drivermansuffix__),
-.BR sisusb (__drivermansuffix__),
-.BR sunbw2 (__drivermansuffix__),
-.BR suncg14 (__drivermansuffix__),
-.BR suncg3 (__drivermansuffix__),
-.BR suncg6 (__drivermansuffix__),
-.BR sunffb (__drivermansuffix__),
-.BR sunleo (__drivermansuffix__),
-.BR suntcx (__drivermansuffix__),
-.BR tdfx (__drivermansuffix__),
-.\" .BR tga (__drivermansuffix__),
-.BR trident (__drivermansuffix__),
-.BR tseng (__drivermansuffix__),
-.BR vesa (__drivermansuffix__),
-.BR vmware (__drivermansuffix__),
-.BR voodoo (__drivermansuffix__),
-.BR wsfb (__drivermansuffix__),
-.BR xgi (__drivermansuffix__),
-.BR xgixp (__drivermansuffix__).
-.PP
-Input drivers:
-.BR acecad (__drivermansuffix__),
-.BR citron (__drivermansuffix__),
-.BR elographics (__drivermansuffix__),
-.BR evdev (__drivermansuffix__),
-.BR fpit (__drivermansuffix__),
-.BR joystick (__drivermansuffix__),
-.BR kbd (__drivermansuffix__),
-.BR mousedrv (__drivermansuffix__),
-.BR mutouch (__drivermansuffix__),
-.BR penmount (__drivermansuffix__),
-.BR synaptics (__drivermansuffix__),
-.BR vmmouse (__drivermansuffix__),
-.BR void (__drivermansuffix__),
-.BR wacom (__drivermansuffix__).
-.PP
-Other modules and interfaces:
-.BR exa (__drivermansuffix__),
-.BR fbdevhw (__drivermansuffix__),
-.\" .BR shadowfb (__drivermansuffix__),
-.BR v4l (__drivermansuffix__).
-.br
-.SH AUTHORS
-This manual page was largely rewritten by David Dawes
-.IR <dawes at xfree86.org> .
diff --git a/hw/xfree86/man/Makefile.am b/hw/xfree86/man/Makefile.am
new file mode 100644
index 0000000..80e22cb
--- /dev/null
+++ b/hw/xfree86/man/Makefile.am
@@ -0,0 +1,3 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xorg.man
+fileman_PRE = xorg.conf.man xorg.conf.d.man
diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
new file mode 100644
index 0000000..6fa334c
--- /dev/null
+++ b/hw/xfree86/man/Xorg.man
@@ -0,0 +1,689 @@
+.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH __xservername__ __appmansuffix__ __vendorversion__
+.SH NAME
+__xservername__ - X11R7 X server
+.SH SYNOPSIS
+.B __xservername__
+.RI [\fB:\fP display ]
+.RI [ option
+.IR ... ]
+.SH DESCRIPTION
+.B __xservername__
+is a full featured X server that was originally designed for UNIX and
+UNIX-like operating systems running on Intel x86 hardware.  It now runs
+on a wider range of hardware and OS platforms.
+.PP
+This work was derived by the X.Org Foundation from the XFree86 Project's
+.I "XFree86\ 4.4rc2"
+release.
+The XFree86 release was originally derived from
+.I "X386\ 1.2"
+by Thomas Roell which was contributed to X11R5 by Snitily Graphics
+Consulting Service.
+.SH PLATFORMS
+.PP
+.B __xservername__
+operates under a wide range of operating systems and hardware platforms.
+The Intel x86 (IA32) architecture is the most widely supported hardware
+platform.  Other hardware platforms include Compaq Alpha, Intel IA64, AMD64,
+SPARC and PowerPC.  The most widely supported operating systems are the
+free/OpenSource UNIX-like systems such as Linux, FreeBSD, NetBSD,
+OpenBSD, and Solaris.  Commercial UNIX operating systems such as
+UnixWare are also supported.  Other supported operating systems include
+GNU Hurd.  Mac OS X is supported with the
+Xquartz(__appmansuffix__) X server.  Win32/Cygwin is supported with the
+XWin(__appmansuffix__) X server.
+.PP
+.SH "NETWORK CONNECTIONS"
+.B __xservername__
+supports connections made using the following reliable
+byte-streams:
+.TP 4
+.I "Local"
+On most platforms, the "Local" connection type is a UNIX-domain socket.
+On some System V platforms, the "local" connection types also include
+STREAMS pipes, named pipes, and some other mechanisms.
+.TP 4
+.I TCP\/IP
+.B __xservername__
+listens on port
+.RI 6000+ n ,
+where
+.I n
+is the display number.  This connection type can be disabled with the
+.B \-nolisten
+option (see the Xserver(1) man page for details).
+.SH "ENVIRONMENT VARIABLES"
+For operating systems that support local connections other than Unix
+Domain sockets (SVR3 and SVR4), there is a compiled-in list specifying
+the order in which local connections should be attempted.  This list
+can be overridden by the
+.I XLOCAL
+environment variable described below.  If the display name indicates a
+best-choice connection should be made (e.g.
+.BR :0.0 ),
+each connection mechanism is tried until a connection succeeds or no
+more mechanisms are available.  Note: for these OSs, the Unix Domain
+socket connection is treated differently from the other local connection
+types.  To use it the connection must be made to
+.BR unix:0.0 .
+.PP
+The
+.I XLOCAL
+environment variable should contain a list of one more
+more of the following:
+.PP
+.RS 8
+.nf
+NAMED
+PTS
+SCO
+ISC
+.fi
+.RE
+.PP
+which represent SVR4 Named Streams pipe, Old-style USL Streams pipe,
+SCO XSight Streams pipe, and ISC Streams pipe, respectively.  You can
+select a single mechanism (e.g.
+.IR XLOCAL=NAMED ),
+or an ordered list (e.g. \fIXLOCAL="NAMED:PTS:SCO"\fP).
+his variable overrides the compiled-in defaults.  For SVR4 it is
+recommended that
+.I NAMED
+be the first preference connection.  The default setting is
+.IR PTS:NAMED:ISC:SCO .
+.PP
+To globally override the compiled-in defaults, you should define (and
+export if using
+.B sh
+or
+.BR ksh )
+.I XLOCAL
+globally.  If you use startx(1) or xinit(1), the definition should be
+at the top of your
+.I .xinitrc
+file.  If you use xdm(1), the definitions should be early on in the
+.I __projectroot__/lib/X11/xdm/Xsession
+script.
+.SH OPTIONS
+.B __xservername__
+supports several mechanisms for supplying/obtaining configuration and
+run-time parameters: command line options, environment variables, the
+__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
+can be supplied via all methods.  The available command line options
+and environment variables (and some defaults) are described here and in
+the Xserver(__appmansuffix__) manual page.  Most configuration file
+parameters, with their defaults, are described in the
+__xconfigfile__(__filemansuffix__) manual page.  Driver and module specific
+configuration parameters are described in the relevant driver or module
+manual page.
+.PP
+In addition to the normal server options described in the
+Xserver(__appmansuffix__) manual page,
+.B __xservername__
+accepts the following command line switches:
+.TP 8
+.BI vt XX
+.I XX
+specifies the Virtual Terminal device number which
+.B __xservername__
+will use.  Without this option,
+.B __xservername__
+will pick the first available Virtual Terminal that it can locate.  This
+option applies only to platforms that have virtual terminal support, such
+as Linux, BSD, OpenSolaris, SVR3, and SVR4.
+.TP
+.B \-allowMouseOpenFail
+Allow the server to start up even if the mouse device can't be opened
+or initialised.  This is equivalent to the
+.B AllowMouseOpenFail
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.B \-allowNonLocalXvidtune
+Make the VidMode extension available to remote clients.  This allows
+the xvidtune client to connect from another host.  This is equivalent
+to the
+.B AllowNonLocalXvidtune
+__xconfigfile__(__filemansuffix__) file option.  By default non-local
+connections are not allowed.
+.TP 8
+.BI \-bgamma " value"
+Set the blue gamma correction.
+.I value
+must be between 0.1 and 10.
+The default is 1.0.  Not all drivers support this.  See also the
+.BR \-gamma ,
+.BR \-rgamma ,
+and
+.B \-ggamma
+options.
+.TP 8
+.BI \-bpp " n"
+No longer supported.  Use
+.B \-depth
+to set the color depth, and use
+.B \-fbbpp
+if you really need to force a non-default framebuffer (hardware) pixel
+format.
+.TP 8
+.BI \-config " file"
+Read the server configuration from
+.IR file .
+This option will work for any file when the server is run as root (i.e,
+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__
+server loads all video driver modules, probes for available hardware,
+and writes out an initial __xconfigfile__(__filemansuffix__) file based on
+what was detected.  This option currently has some problems on some
+platforms, but in most cases it is a good way to bootstrap the
+configuration process.  This option is only available when the server
+is run as root (i.e, with real-uid 0).
+.TP 8
+.BI "\-crt /dev/tty" XX
+SCO only.  This is the same as the
+.B vt
+option, and is provided for compatibility with the native SCO X server.
+.TP 8
+.BI \-depth " n"
+Sets the default color depth.  Legal values are 1, 4, 8, 15, 16, and
+24.  Not all drivers support all values.
+.TP 8
+.B \-disableVidMode
+Disable the parts of the VidMode extension (used by the xvidtune
+client) that can be used to change the video modes.  This is equivalent
+to the
+.B DisableVidModeExtension
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.B \-fbbpp \fIn\fP
+Sets the number of framebuffer bits per pixel.  You should only set this
+if you're sure it's necessary; normally the server can deduce the correct
+value from
+.B \-depth
+above.  Useful if you want to run a depth 24 configuration with a 24
+bpp framebuffer rather than the (possibly default) 32 bpp framebuffer
+(or vice versa).  Legal values are 1, 8, 16, 24, 32.  Not all drivers
+support all values.
+.TP 8
+.B \-flipPixels
+Swap the default values for the black and white pixels.
+.TP 8
+.BI \-gamma " value"
+Set the gamma correction.
+.I value
+must be between 0.1 and 10.  The default is 1.0.  This value is applied
+equally to the R, G and B values.  Those values can be set independently
+with the
+.BR \-rgamma ,
+.BR \-bgamma ,
+and
+.B \-ggamma
+options.  Not all drivers support this.
+.TP 8
+.BI \-ggamma " value"
+Set the green gamma correction.
+.I value
+must be between 0.1 and 10.  The default is 1.0.  Not all drivers support
+this.  See also the
+.BR \-gamma ,
+.BR \-rgamma ,
+and
+.B \-bgamma
+options.
+.TP 8
+.B \-ignoreABI
+The
+.B __xservername__
+server checks the ABI revision levels of each module that it loads.  It
+will normally refuse to load modules with ABI revisions that are newer
+than the server's.  This is because such modules might use interfaces
+that the server does not have.  When this option is specified, mismatches
+like this are downgraded from fatal errors to warnings.  This option
+should be used with care.
+.TP 8
+.B \-isolateDevice \fIbus\-id\fP
+Restrict device resets to the device at
+.IR bus\-id .
+The
+.I bus\-id
+string has the form
+.IB bustype : bus : device : function
+(e.g., \(oqPCI:1:0:0\(cq).
+At present, only isolation of PCI devices is supported; i.e., this option
+is ignored if
+.I bustype
+is anything other than \(oqPCI\(cq.
+.TP 8
+.B \-keeptty
+Prevent the server from detaching its initial controlling terminal.
+This option is only useful when debugging the server.  Not all platforms
+support (or can use) this option.
+.TP 8
+.BI \-keyboard " keyboard-name"
+Use the __xconfigfile__(__filemansuffix__) file
+.B InputDevice
+section called
+.I keyboard-name
+as the core keyboard.  This option is ignored when the
+.B Layout
+section specifies a core keyboard.  In the absence of both a Layout
+section and this option, the first relevant
+.B InputDevice
+section is used for the core keyboard.
+.TP 8
+.BI \-layout " layout-name"
+Use the __xconfigfile__(__filemansuffix__) file
+.B Layout
+section called
+.IR layout-name .
+By default the first
+.B Layout
+section is used.
+.TP 8
+.BI \-logfile " filename"
+Use the file called
+.I filename
+as the
+.B __xservername__
+server log file.  The default log file is
+.BI __logdir__/__xservername__. n .log
+on most platforms, where
+.I n
+is the display number of the
+.B __xservername__
+server.  The default may be in a different directory on some platforms.
+This option is only available when the server is run as root (i.e, with
+real-uid 0).
+.TP 8
+.BR \-logverbose " [\fIn\fP]"
+Sets the verbosity level for information printed to the
+.B __xservername__
+server log file.  If the
+.I n
+value isn't supplied, each occurrence of this option increments the log
+file verbosity level.  When the
+.I n
+value is supplied, the log file verbosity level is set to that value.
+The default log file verbosity level is 3.
+.TP 8
+.BI \-modulepath " searchpath"
+Set the module search path to
+.IR searchpath .
+.I searchpath
+is a comma separated list of directories to search for
+.B __xservername__
+server modules.  This option is only available when the server is run
+as root (i.e, with real-uid 0).
+.TP 8
+.B \-nosilk
+Disable Silken Mouse support.
+.TP 8
+.B \-pixmap24
+Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel.
+The default is usually 32 bits per pixel.  There is normally little
+reason to use this option.  Some client applications don't like this
+pixmap format, even though it is a perfectly legal format.  This is
+equivalent to the
+.B Pixmap
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.B \-pixmap32
+Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel.
+This is usually the default.  This is equivalent to the
+.B Pixmap
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.BI \-pointer " pointer-name"
+Use the __xconfigfile__(__filemansuffix__) file
+.B InputDevice
+section called
+.I pointer-name
+as the core pointer.  This option is ignored when the
+.B Layout
+section specifies a core pointer.  In the absence of both a Layout
+section and this option, the first relevant
+.B InputDevice
+section is used for the core pointer.
+.TP 8
+.B \-quiet
+Suppress most informational messages at startup.  The verbosity level
+is set to zero.
+.TP 8
+.BI \-rgamma " value"
+Set the red gamma correction.
+.I value
+must be between 0.1 and 10.  The default is 1.0.  Not all drivers support
+this.  See also the
+.BR \-gamma ,
+.BR \-bgamma ,
+and
+.B \-ggamma
+options.
+.TP 8
+.BI \-screen " screen-name"
+Use the __xconfigfile__(__filemansuffix__) file
+.B Screen
+section called
+.IR screen-name .
+By default the screens referenced by the default
+.B Layout
+section are used, or the first
+.B Screen
+section when there are no
+.B Layout
+sections.
+.TP 8
+.B \-showconfig
+This is the same as the
+.B \-version
+option, and is included for compatibility reasons.  It may be removed
+in a future release, so the
+.B \-version
+option should be used instead.
+.TP 8
+.B \-showDefaultModulePath
+Print out the default module path the server was compiled with.
+.TP 8
+.B \-showDefaultLibPath
+Print out the path libraries should be installed to.
+.TP 8
+.B \-showopts
+For each driver module installed, print out the list of options and their
+argument types.
+.TP 8
+.BI \-weight " nnn"
+Set RGB weighting at 16 bpp.  The default is 565.  This applies only to
+those drivers which support 16 bpp.
+.TP 8
+.BR \-verbose " [\fIn\fP]"
+Sets the verbosity level for information printed on stderr.  If the
+.I n
+value isn't supplied, each occurrence of this option increments the
+verbosity level.  When the
+.I n
+value is supplied, the verbosity level is set to that value.  The default
+verbosity level is 0.
+.TP 8
+.B \-version
+Print out the server version, patchlevel, release date, the operating
+system/platform it was built on, and whether it includes module loader
+support.
+.SH "KEYBOARD"
+.PP
+The
+.B __xservername__
+server is normally configured to recognize various special combinations
+of key presses that instruct the server to perform some action, rather
+than just sending the key press event to a client application. These actions
+depend on the XKB keymap loaded by a particular keyboard device and may or
+may not be available on a given configuration.
+.PP
+The following key combinations are commonly part of the default XKEYBOARD
+keymap.
+.TP 8
+.B Ctrl+Alt+Backspace
+Immediately kills the server -- no questions asked. It can be disabled by
+setting the
+.B DontZap
+__xconfigfile__(__filemansuffix__) file option to a TRUE value.
+.PP
+.RS 8
+It should be noted that zapping is triggered by the
+.B Terminate_Server
+action in the keyboard map. This action is not part of the default keymaps
+but can be enabled with the XKB option
+.B \*qterminate:ctrl_alt_bksp\*q.
+.RE
+.TP 8
+.B Ctrl+Alt+Keypad-Plus
+Change video mode to next one specified in the configuration file.
+This can be disabled with the
+.B DontZoom
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.B Ctrl+Alt+Keypad-Minus
+Change video mode to previous one specified in the configuration file.
+This can be disabled with the
+.B DontZoom
+__xconfigfile__(__filemansuffix__) file option.
+.TP 8
+.B Ctrl+Alt+F1...F12
+For systems with virtual terminal support, these keystroke
+combinations are used to switch to virtual terminals 1 through 12,
+respectively.  This can be disabled with the
+.B DontVTSwitch
+__xconfigfile__(__filemansuffix__) file option.
+.SH CONFIGURATION
+.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.
+.PP
+.B __xservername__
+has a mechanism for automatically generating a built-in configuration
+at run-time when no
+.B __xconfigfile__
+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
+.B __xconfigfile__
+file optional.  This means that information that can be probed or
+reasonably deduced doesn't need to be specified explicitly, greatly
+reducing the amount of built-in configuration information that needs to
+be generated at run-time.
+.PP
+The second is to have "safe" fallbacks for most configuration information.
+This maximises the likelihood that the
+.B __xservername__
+server will start up in some usable configuration even when information
+about the specific hardware is not available.
+.PP
+The automatic configuration support for __xservername__ is work in progress.
+It is currently aimed at the most popular hardware and software platforms
+supported by __xservername__.  Enhancements are planned for future releases.
+.SH FILES
+The
+.B __xservername__
+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
+.B /etc/X11/__xconfigfile__
+Server configuration file.
+.TP 30
+.B /etc/X11/__xconfigfile__-4
+Server configuration file.
+.TP 30
+.B /etc/__xconfigfile__
+Server configuration file.
+.TP 30
+.B __projectroot__/etc/__xconfigfile__
+Server configuration file.
+.TP 30
+.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 .
+.TP 30
+.B __projectroot__/bin/\(**
+Client binaries.
+.TP 30
+.B __projectroot__/include/\(**
+Header files.
+.TP 30
+.B __projectroot__/lib/\(**
+Libraries.
+.TP 30
+.B __datadir__/fonts/X11/\(**
+Fonts.
+.TP 30
+.B __projectroot__/share/X11/XErrorDB
+Client error message database.
+.TP 30
+.B __projectroot__/lib/X11/app-defaults/\(**
+Client resource specifications.
+.TP 30
+.B __mandir__/man?/\(**
+Manual pages.
+.TP 30
+.BI /etc/X n .hosts
+Initial access control list for display
+.IR n .
+.SH "SEE ALSO"
+X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__),
+__xconfigfile__(__filemansuffix__), xvidtune(__appmansuffix__),
+apm(__drivermansuffix__),
+ati(__drivermansuffix__),
+chips(__drivermansuffix__),
+cirrus(__drivermansuffix__),
+cyrix(__drivermansuffix__),
+fbdev(__drivermansuffix__),
+glide(__drivermansuffix__),
+glint(__drivermansuffix__),
+i128(__drivermansuffix__),
+i740(__drivermansuffix__),
+imstt(__drivermansuffix__),
+intel(__drivermansuffix__),
+mga(__drivermansuffix__),
+neomagic(__drivermansuffix__),
+nsc(__drivermansuffix__),
+nv(__drivermansuffix__),
+openchrome (__drivermansuffix__),
+r128(__drivermansuffix__),
+rendition(__drivermansuffix__),
+s3virge(__drivermansuffix__),
+siliconmotion(__drivermansuffix__),
+sis(__drivermansuffix__),
+sunbw2(__drivermansuffix__),
+suncg14(__drivermansuffix__),
+suncg3(__drivermansuffix__),
+suncg6(__drivermansuffix__),
+sunffb(__drivermansuffix__),
+sunleo(__drivermansuffix__),
+suntcx(__drivermansuffix__),
+tdfx(__drivermansuffix__),
+tga(__drivermansuffix__),
+trident(__drivermansuffix__),
+tseng(__drivermansuffix__),
+v4l(__drivermansuffix__),
+vesa(__drivermansuffix__),
+vmware(__drivermansuffix__),
+.br
+Web site
+.IR <http://www.x.org> .
+
+.SH AUTHORS
+__xservername__ has many contributors world wide.  The names of most of them
+can be found in the documentation, ChangeLog files in the source tree,
+and in the actual source code.
+.PP
+__xservername__ was originally based on XFree86 4.4rc2.
+That was originally based on \fIX386 1.2\fP by Thomas Roell, which
+was contributed to the then X Consortium's X11R5 distribution by SGCS.
+.PP
+__xservername__ is released by the X.Org Foundation.
+.PP
+The project that became XFree86 was originally founded in 1992 by
+David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat.
+.PP
+XFree86 was later integrated in the then X Consortium's X11R6 release
+by a group of dedicated XFree86 developers, including the following:
+.PP
+.RS 4
+.nf
+Stuart Anderson    \fIanderson at metrolink.com\fP
+Doug Anson         \fIdanson at lgc.com\fP
+Gertjan Akkerman   \fIakkerman at dutiba.twi.tudelft.nl\fP
+Mike Bernson       \fImike at mbsun.mlb.org\fP
+Robin Cutshaw      \fIrobin at XFree86.org\fP
+David Dawes        \fIdawes at XFree86.org\fP
+Marc Evans         \fImarc at XFree86.org\fP
+Pascal Haible      \fIhaible at izfm.uni-stuttgart.de\fP
+Matthieu Herrb     \fIMatthieu.Herrb at laas.fr\fP
+Dirk Hohndel       \fIhohndel at XFree86.org\fP
+David Holland      \fIdavidh at use.com\fP
+Alan Hourihane     \fIalanh at fairlite.demon.co.uk\fP
+Jeffrey Hsu        \fIhsu at soda.berkeley.edu\fP
+Glenn Lai          \fIglenn at cs.utexas.edu\fP
+Ted Lemon          \fImellon at ncd.com\fP
+Rich Murphey       \fIrich at XFree86.org\fP
+Hans Nasten        \fInasten at everyware.se\fP
+Mark Snitily       \fImark at sgcs.com\fP
+Randy Terbush      \fIrandyt at cse.unl.edu\fP
+Jon Tombs          \fItombs at XFree86.org\fP
+Kees Verstoep      \fIversto at cs.vu.nl\fP
+Paul Vixie         \fIpaul at vix.com\fP
+Mark Weaver        \fIMark_Weaver at brown.edu\fP
+David Wexelblat    \fIdwex at XFree86.org\fP
+Philip Wheatley    \fIPhilip.Wheatley at ColumbiaSC.NCR.COM\fP
+Thomas Wolfram     \fIwolf at prz.tu-berlin.de\fP
+Orest Zborowski    \fIorestz at eskimo.com\fP
+.fi
+.RE
+.PP
+__xservername__ source is available from the FTP server
+\fI<ftp://ftp.x.org/>\fP, and from the X.Org
+server \fI<http://gitweb.freedesktop.org/>\fP.  Documentation and other
+information can be found from the X.Org web site
+\fI<http://www.x.org/>\fP.
+
+.SH LEGAL
+.PP
+.B __xservername__
+is copyright software, provided under licenses that permit modification
+and redistribution in source and binary form without fee.
+.B __xservername__ is copyright by numerous authors and
+contributors from around the world.  Licensing information can be found
+at
+.IR <http://www.x.org> .
+Refer to the source code for specific copyright notices.
+.PP
+.B XFree86(TM)
+is a trademark of The XFree86 Project, Inc.
+.PP
+.B X11(TM)
+and
+.B X Window System(TM)
+are trademarks of The Open Group.
diff --git a/hw/xfree86/man/xorg.conf.d.man b/hw/xfree86/man/xorg.conf.d.man
new file mode 100644
index 0000000..6b3379e
--- /dev/null
+++ b/hw/xfree86/man/xorg.conf.d.man
@@ -0,0 +1 @@
+.so man__filemansuffix__/xorg.conf.__filemansuffix__
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
new file mode 100644
index 0000000..e3fd0ea
--- /dev/null
+++ b/hw/xfree86/man/xorg.conf.man
@@ -0,0 +1,2478 @@
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH __xconfigfile__ __filemansuffix__ __vendorversion__
+.SH NAME
+__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__ 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.
+The
+.I __xconfigfile__
+configuration file is searched for in the following places when the
+server is started as a normal user:
+.PP
+.RS 4
+.nf
+.IR /etc/X11/ <cmdline>
+.IR __projectroot__/etc/X11/ <cmdline>
+.IB /etc/X11/ $XORGCONFIG
+.IB __projectroot__/etc/X11/ $XORGCONFIG
+.I /etc/X11/__xconfigfile__
+.I /etc/__xconfigfile__
+.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
+.I __projectroot__/etc/X11/__xconfigfile__
+.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
+.I __projectroot__/lib/X11/__xconfigfile__
+.fi
+.RE
+.PP
+where
+.I <cmdline>
+is a relative path (with no \(lq..\(rq components) specified with the
+.B \-config
+command line option,
+.B $XORGCONFIG
+is the relative path (with no \(lq..\(rq components) specified by that
+environment variable, and
+.I <hostname>
+is the machine's hostname as reported by
+.BR gethostname (__libmansuffix__).
+.PP
+When the __xservername__ server is started by the \(lqroot\(rq user, the config file
+search locations are as follows:
+.PP
+.RS 4
+.nf
+<cmdline>
+.IR /etc/X11/ <cmdline>
+.IR __projectroot__/etc/X11/ <cmdline>
+.B $XORGCONFIG
+.IB /etc/X11/ $XORGCONFIG
+.IB __projectroot__/etc/X11/ $XORGCONFIG
+.I /etc/X11/__xconfigfile__
+.I /etc/__xconfigfile__
+.IR __projectroot__/etc/X11/__xconfigfile__. <hostname>
+.I __projectroot__/etc/X11/__xconfigfile__
+.IR __projectroot__/lib/X11/__xconfigfile__. <hostname>
+.I __projectroot__/lib/X11/__xconfigfile__
+.fi
+.RE
+.PP
+where
+.I <cmdline>
+is the path specified with the
+.B \-config
+command line option (which may be absolute or relative),
+.B $XORGCONFIG
+is the path specified by that
+environment variable (absolute or relative),
+.B $HOME
+is the path specified by that environment variable (usually the home
+directory), and
+.I <hostname>
+is the machine's hostname as reported by
+.BR gethostname (__libmansuffix__).
+.PP
+Additional configuration files are searched for in the following
+directories when the server is started as a normal user:
+.PP
+.RS 4
+.nf
+.IR /etc/X11/ <cmdline>
+.IR __sysconfdir__/X11/ <cmdline>
+.I /etc/X11/__xconfigdir__
+.I __sysconfdir__/X11/__xconfigdir__
+.fi
+.RE
+.PP
+where
+.I <cmdline>
+is a relative path (with no \(lq..\(rq components) specified with the
+.B \-configdir
+command line option.
+.PP
+When the __xservername__ server is started by the \(lqroot\(rq user, the
+config directory search locations are as follows:
+.PP
+.RS 4
+.nf
+<cmdline>
+.IR /etc/X11/ <cmdline>
+.IR __sysconfdir__/X11/ <cmdline>
+.I /etc/X11/__xconfigdir__
+.I __sysconfdir__/X11/__xconfigdir__
+.fi
+.RE
+.PP
+where
+.I <cmdline>
+is the path specified with the
+.B \-configdir
+command line option (which may be absolute or relative).
+.PP
+Finally, configuration files will also be searched for in directories
+reserved for system use. These are to separate configuration files from
+the vendor or 3rd party packages from those of local administration.
+These files are found in the following directories:
+.PP
+.RS 4
+.nf
+.I /usr/share/X11/__xconfigdir__
+.I __datadir__/X11/__xconfigdir__
+.fi
+.RE
+.PP
+The
+.I __xconfigfile__
+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
+.RS 4
+.nf
+.BI "Section  \*q" SectionName \*q
+.RI "    " SectionEntry
+    ...
+.B EndSection
+.fi
+.RE
+.PP
+The section names are:
+.PP
+.RS 4
+.nf
+.BR "Files          " "File pathnames"
+.BR "ServerFlags    " "Server flags"
+.BR "Module         " "Dynamic module loading"
+.BR "Extensions     " "Extension enabling"
+.BR "InputDevice    " "Input device description"
+.BR "InputClass     " "Input class description"
+.BR "Device         " "Graphics device description"
+.BR "VideoAdaptor   " "Xv video adaptor description"
+.BR "Monitor        " "Monitor description"
+.BR "Modes          " "Video modes descriptions"
+.BR "Screen         " "Screen configuration"
+.BR "ServerLayout   " "Overall layout"
+.BR "DRI            " "DRI\-specific configuration"
+.BR "Vendor         " "Vendor\-specific configuration"
+.fi
+.RE
+.PP
+The following obsolete section names are still recognised for compatibility
+purposes.
+In new config files, the
+.B InputDevice
+section should be used instead.
+.PP
+.RS 4
+.nf
+.BR "Keyboard       " "Keyboard configuration"
+.BR "Pointer        " "Pointer/mouse configuration"
+.fi
+.RE
+.PP
+The old
+.B XInput
+section is no longer recognised.
+.PP
+The
+.B ServerLayout
+sections are at the highest level.
+They bind together the input and output devices that will be used in a session.
+The input devices are described in the
+.B InputDevice
+sections.
+Output devices usually consist of multiple independent components (e.g.,
+a graphics board and a monitor).
+These multiple components are bound together in the
+.B Screen
+sections, and it is these that are referenced by the
+.B ServerLayout
+section.
+Each
+.B Screen
+section binds together a graphics board and a monitor.
+The graphics boards are described in the
+.B Device
+sections, and the monitors are described in the
+.B Monitor
+sections.
+.PP
+Config file keywords are case\-insensitive, and \(lq_\(rq characters are
+ignored.
+Most strings (including
+.B Option
+names) are also case-insensitive, and insensitive to white space and
+\(lq_\(rq characters.
+.PP
+Each config file entry usually takes up a single line in the file.  They
+consist of a keyword, which is possibly followed by one or more arguments,
+with the number and types of the arguments depending on the keyword.
+The argument types are:
+.PP
+.RS 4
+.nf
+.BR "Integer     " "an integer number in decimal, hex or octal"
+.BR "Real        " "a floating point number"
+.BR "String      " "a string enclosed in double quote marks (\*q)"
+.fi
+.RE
+.PP
+Note: hex integer values must be prefixed with \(lq0x\(rq, and octal values
+with \(lq0\(rq.
+.PP
+A special keyword called
+.B Option
+may be used to provide free\-form data to various components of the server.
+The
+.B Option
+keyword takes either one or two string arguments.
+The first is the option name, and the optional second argument is the
+option value.
+Some commonly used option value types include:
+.PP
+.RS 4
+.nf
+.BR "Integer     " "an integer number in decimal, hex or octal"
+.BR "Real        " "a floating point number"
+.BR "String      " "a sequence of characters"
+.BR "Boolean     " "a boolean value (see below)"
+.BR "Frequency   " "a frequency value (see below)"
+.fi
+.RE
+.PP
+Note that
+.I all
+.B Option
+values, not just strings, must be enclosed in quotes.
+.PP
+Boolean options may optionally have a value specified.
+When no value is specified, the option's value is
+.BR TRUE .
+The following boolean option values are recognised as
+.BR TRUE :
+.PP
+.RS 4
+.BR 1 ,
+.BR on ,
+.BR true ,
+.B yes
+.RE
+.PP
+and the following boolean option values are recognised as
+.BR FALSE :
+.PP
+.RS 4
+.BR 0 ,
+.BR off ,
+.BR false ,
+.B no
+.RE
+.PP
+If an option name is prefixed with
+.RB \*q No \*q,
+then the option value is negated.
+.PP
+Example: the following option entries are equivalent:
+.PP
+.RS 4
+.nf
+.B "Option \*qAccel\*q   \*qOff\*q"
+.B "Option \*qNoAccel\*q"
+.B "Option \*qNoAccel\*q \*qOn\*q"
+.B "Option \*qAccel\*q   \*qfalse\*q"
+.B "Option \*qAccel\*q   \*qno\*q"
+.fi
+.RE
+.PP
+Frequency option values consist of a real number that is optionally
+followed by one of the following frequency units:
+.PP
+.RS 4
+.BR Hz ,
+.BR k ,
+.BR kHz ,
+.BR M ,
+.B MHz
+.RE
+.PP
+When the unit name is omitted, the correct units will be determined from
+the value and the expectations of the appropriate range of the value.
+It is recommended that the units always be specified when using frequency
+option values to avoid any errors in determining the value.
+.SH "FILES SECTION"
+The
+.B Files
+section is used to specify some path names required by the server.
+Some of these paths can also be set from the command line (see
+.BR Xserver (__appmansuffix__)
+and
+.BR __xservername__ (__appmansuffix__)).
+The command line settings override the values specified in the config
+file.
+The
+.B Files
+section is optional, as are all of the entries that may appear in it.
+.PP
+The entries that can appear in this section are:
+.TP 7
+.BI "FontPath \*q" path \*q
+sets the search path for fonts.
+This path is a comma separated list of font path elements which the __xservername__
+server searches for font databases.
+Multiple
+.B FontPath
+entries may be specified, and they will be concatenated to build up the
+fontpath used by the server.  Font path elements can be absolute
+directory paths, catalogue directories or a font server identifier. The
+formats of the later two are explained below:
+.PP
+.RS 7
+Catalogue directories:
+.PP
+.RS 4
+Catalogue directories can be specified using the prefix \fBcatalogue:\fR
+before the directory name. The directory can then be populated with
+symlinks pointing to the real font directories, using the following
+syntax in the symlink name:
+.PP
+.RS 4
+.IR <identifier> : [attribute]: pri= <priority>
+.RE
+.PP
+where
+.I <identifier>
+is an alphanumeric identifier,
+.I [attribute]
+is an attribute which will be passed to the underlying FPE and
+.I <priority>
+is a number used to order the fontfile FPEs. Examples:
+.PP
+.RS 4
+.nf
+.I 75dpi:unscaled:pri=20  -> /usr/share/X11/fonts/75dpi
+.I gscript:pri=60 -> /usr/share/fonts/default/ghostscript
+.I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc
+.fi
+.PP
+.RE .RE .RE
+.PP
+.RS 7
+Font server identifiers:
+.PP
+.RS 4
+Font server identifiers have the form:
+.RS 4
+.PP
+.IR <trans> / <hostname> : <port\-number>
+.RE
+.PP
+where
+.I <trans>
+is the transport type to use to connect to the font server (e.g.,
+.B unix
+for UNIX\-domain sockets or
+.B tcp
+for a TCP/IP connection),
+.I <hostname>
+is the hostname of the machine running the font server, and
+.I <port\-number>
+is the port number that the font server is listening on (usually 7100).
+.RE
+.PP
+When this entry is not specified in the config file, the server falls back
+to the compiled\-in default font path, which contains the following
+font path elements (which can be set inside a catalogue directory):
+.PP
+.RS 4
+.nf
+.I __datadir__/fonts/X11/misc/
+.I __datadir__/fonts/X11/TTF/
+.I __datadir__/fonts/X11/OTF/
+.I __datadir__/fonts/X11/Type1/
+.I __datadir__/fonts/X11/100dpi/
+.I __datadir__/fonts/X11/75dpi/
+.fi
+.RE
+.PP
+Font path elements that are found to be invalid are removed from the
+font path when the server starts up.
+.RE
+.TP 7
+.BI "ModulePath \*q" path \*q
+sets the search path for loadable __xservername__ server modules.
+This path is a comma separated list of directories which the __xservername__ server
+searches for loadable modules loading in the order specified.
+Multiple
+.B ModulePath
+entries may be specified, and they will be concatenated to build the
+module search path used by the server.  The default module path is
+.PP
+.RS 11
+__modulepath__
+.RE
+.\" The LogFile keyword is not currently implemented
+.ig
+.TP 7
+.BI "LogFile \*q" path \*q
+sets the name of the __xservername__ server log file.
+The default log file name is
+.PP
+.RS 11
+.RI __logdir__/__xservername__. <n> .log
+.RE
+.PP
+.RS 7
+where
+.I <n>
+is the display number for the __xservername__ server.
+..
+.TP 7
+.BI "XkbDir \*q" path \*q
+sets the base directory for keyboard layout files.  The
+.B \-xkbdir
+command line option can be used to override this.  The default directory is
+.PP
+.RS 11
+__xkbdir__
+.RE
+.SH "SERVERFLAGS SECTION"
+In addition to options specific to this section (described below), the
+.B ServerFlags
+section is used to specify some global
+__xservername__ server options.
+All of the entries in this section are
+.BR Options ,
+although for compatibility purposes some of the old style entries are
+still recognised.
+Those old style entries are not documented here, and using them is
+discouraged.
+The
+.B ServerFlags
+section is optional, as are the entries that may be specified in it.
+.PP
+.B Options
+specified in this section (with the exception of the
+.B \*qDefaultServerLayout\*q
+.BR Option )
+may be overridden by
+.B Options
+specified in the active
+.B ServerLayout
+section.
+Options with command line equivalents are overridden when their command
+line equivalent is used.
+The options recognised by this section are:
+.TP 7
+.BI "Option \*qDefaultServerLayout\*q  \*q" layout\-id \*q
+This specifies the default
+.B ServerLayout
+section to use in the absence of the
+.B \-layout
+command line option.
+.TP 7
+.BI "Option \*qNoTrapSignals\*q  \*q" boolean \*q
+This prevents the __xservername__ server from trapping a range of unexpected fatal
+signals and exiting cleanly.
+Instead, the __xservername__ server will die and drop core where the fault occurred.
+The default behaviour is for the __xservername__ server to exit cleanly, but still drop a
+core file.
+In general you never want to use this option unless you are debugging an __xservername__
+server problem and know how to deal with the consequences.
+.TP 7
+.BI "Option \*qUseSIGIO\*q  \*q" boolean \*q
+This controls whether the __xservername__ server requests that events from
+input devices be reported via a SIGIO signal handler (also known as SIGPOLL
+on some platforms), or only reported via the standard select(3) loop.
+The default behaviour is platform specific.   In general you do not want to
+use this option unless you are debugging the __xservername__ server, or
+working around a specific bug until it is fixed, and understand the
+consequences.
+.TP 7
+.BI "Option \*qDontVTSwitch\*q  \*q" boolean \*q
+This disallows the use of the
+.BI Ctrl+Alt+F n
+sequence (where
+.RI F n
+refers to one of the numbered function keys).
+That sequence is normally used to switch to another \*qvirtual terminal\*q
+on operating systems that have this feature.
+When this option is enabled, that key sequence has no special meaning and
+is passed to clients.
+Default: off.
+.TP 7
+.BI "Option \*qDontZap\*q  \*q" boolean \*q
+This disallows the use of the
+.B Terminate_Server
+XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options).
+This action is normally used to terminate the __xservername__ server.
+When this option is enabled, the action has no effect.
+Default: off.
+.TP 7
+.BI "Option \*qDontZoom\*q  \*q" boolean \*q
+This disallows the use of the
+.B Ctrl+Alt+Keypad\-Plus
+and
+.B Ctrl+Alt+Keypad\-Minus
+sequences.
+These sequences allows you to switch between video modes.
+When this option is enabled, those key sequences have no special meaning
+and are passed to clients.
+Default: off.
+.TP 7
+.BI "Option \*qDisableVidModeExtension\*q  \*q" boolean \*q
+This disables the parts of the VidMode extension used by the xvidtune client
+that can be used to change the video modes.
+Default: the VidMode extension is enabled.
+.TP 7
+.BI "Option \*qAllowNonLocalXvidtune\*q  \*q" boolean \*q
+This allows the xvidtune client (and other clients that use the VidMode
+extension) to connect from another host.
+Default: off.
+.TP 7
+.BI "Option \*qAllowMouseOpenFail\*q  \*q" boolean \*q
+This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__)
+drivers to not report failure if the mouse device can't be opened/initialised.
+It has no effect on the evdev(__drivermansuffix__) or other drivers.
+Default: false.
+.TP 7
+.BI "Option \*qVTSysReq\*q  \*q" boolean \*q
+enables the SYSV\-style VT switch sequence for non\-SYSV systems
+which support VT switching.
+This sequence is
+.B Alt\-SysRq
+followed by a function key
+.RB ( Fn ).
+This prevents the __xservername__ server trapping the
+keys used for the default VT switch sequence, which means that clients can
+access them.
+Default: off.
+.TP 7
+.BI "Option \*qBlankTime\*q  \*q" time \*q
+sets the inactivity timeout for the
+.B blank
+phase of the screensaver.
+.I time
+is in minutes.
+This is equivalent to the __xservername__ server's
+.B \-s
+flag, and the value can be changed at run\-time with
+.BR xset(__appmansuffix__).
+Default: 10 minutes.
+.TP 7
+.BI "Option \*qStandbyTime\*q  \*q" time \*q
+sets the inactivity timeout for the
+.B standby
+phase of DPMS mode.
+.I time
+is in minutes, and the value can be changed at run\-time with
+.BR xset(__appmansuffix__).
+Default: 10 minutes.
+This is only suitable for VESA DPMS compatible monitors, and may not be
+supported by all video drivers.
+It is only enabled for screens that have the
+.B \*qDPMS\*q
+option set (see the MONITOR section below).
+.TP 7
+.BI "Option \*qSuspendTime\*q  \*q" time \*q
+sets the inactivity timeout for the
+.B suspend
+phase of DPMS mode.
+.I time
+is in minutes, and the value can be changed at run\-time with
+.BR xset(__appmansuffix__).
+Default: 10 minutes.
+This is only suitable for VESA DPMS compatible monitors, and may not be
+supported by all video drivers.
+It is only enabled for screens that have the
+.B \*qDPMS\*q
+option set (see the MONITOR section below).
+.TP 7
+.BI "Option \*qOffTime\*q  \*q" time \*q
+sets the inactivity timeout for the
+.B off
+phase of DPMS mode.
+.I time
+is in minutes, and the value can be changed at run\-time with
+.BR xset(__appmansuffix__).
+Default: 10 minutes.
+This is only suitable for VESA DPMS compatible monitors, and may not be
+supported by all video drivers.
+It is only enabled for screens that have the
+.B \*qDPMS\*q
+option set (see the MONITOR section below).
+.TP 7
+.BI "Option \*qPixmap\*q  \*q" bpp \*q
+This sets the pixmap format to use for depth 24.
+Allowed values for
+.I bpp
+are 24 and 32.
+Default: 32 unless driver constraints don't allow this (which is rare).
+Note: some clients don't behave well when this value is set to 24.
+.TP 7
+.BI "Option \*qPC98\*q  \*q" boolean \*q
+Specify that the machine is a Japanese PC\-98 machine.
+This should not be enabled for anything other than the Japanese\-specific
+PC\-98 architecture.
+Default: auto\-detected.
+.TP 7
+.BI "Option \*qNoPM\*q  \*q" boolean \*q
+Disables something to do with power management events.
+Default: PM enabled on platforms that support it.
+.TP 7
+.BI "Option \*qXinerama\*q  \*q" boolean \*q
+enable or disable XINERAMA extension.
+Default is disabled.
+.TP 7
+.BI "Option \*qAIGLX\*q \*q" boolean \*q
+enable or disable AIGLX. AIGLX is enabled by default.
+.TP 7
+.BI "Option \*qDRI2\*q \*q" boolean \*q
+enable or disable DRI2. DRI2 is disabled by default.
+.TP 7
+.BI "Option \*qGlxVisuals\*q \*q" string \*q
+This option controls how many GLX visuals the GLX modules sets up.
+The default value is
+.BR "typical" ,
+which will setup up a typical subset of
+the GLXFBConfigs provided by the driver as GLX visuals.  Other options are
+.BR "minimal" ,
+which will set up the minimal set allowed by the GLX specification and
+.BR "all"
+which will setup GLX visuals for all GLXFBConfigs.
+.TP 7
+.BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q
+Include the default font path even if other paths are specified in
+xorg.conf. If enabled, other font paths are included as well. Enabled by
+default.
+.TP 7
+.BI "Option \*qIgnoreABI\*q \*q" boolean \*q
+Allow modules built for a different, potentially incompatible version of
+the X server to load. Disabled by default.
+.TP 7
+.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
+If this option is disabled, then no devices will be added from HAL events.
+Enabled by default.
+.TP 7
+.BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q
+If this option is disabled, then the devices will be added (and the
+DevicePresenceNotify event sent), but not enabled, thus leaving policy up
+to the client.
+Enabled by default.
+.TP 7
+.BI "Option \*qLog\*q \*q" string \*q
+This option controls whether the log is flushed and/or synced to disk after
+each message.
+Possible values are
+.B flush
+or
+.BR sync .
+Unset by default.
+.SH "MODULE SECTION"
+The
+.B Module
+section is used to specify which __xservername__ server modules should be loaded.
+This section is ignored when the __xservername__ server is built in static form.
+The type of modules normally loaded in this section are __xservername__ server
+extension modules.
+Most other module types are loaded automatically when they are needed via
+other mechanisms.
+The
+.B Module
+section is optional, as are all of the entries that may be specified in
+it.
+.PP
+Entries in this section may be in two forms.
+The first and most commonly used form is an entry that uses the
+.B Load
+keyword, as described here:
+.TP 7
+.BI "Load  \*q" modulename \*q
+This instructs the server to load the module called
+.IR modulename .
+The module name given should be the module's standard name, not the
+module file name.
+The standard name is case\-sensitive, and does not include the \(lqlib\(rq
+prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes.
+.PP
+.RS 7
+Example: the DRI extension module can be loaded with the following entry:
+.PP
+.RS 4
+.B "Load \*qdri\*q"
+.RE
+.RE
+.TP 7
+.BI "Disable  \*q" modulename \*q
+This instructs the server to not load the module called
+.IR modulename .
+Some modules are loaded by default in the server, and this overrides that
+default. If a
+.B Load
+instruction is given for the same module, it overrides the
+.B Disable
+instruction and the module is loaded. The module name given should be the
+module's standard name, not the module file name. As with the
+.B Load
+instruction, the standard name is case-sensitive, and does not include the
+"lib" prefix, or the ".a", ".o", or ".so" suffixes.
+.PP
+The second form of entry is a
+.BR SubSection,
+with the subsection name being the module name, and the contents of the
+.B SubSection
+being
+.B Options
+that are passed to the module when it is loaded.
+.PP
+Example: the extmod module (which contains a miscellaneous group of
+server extensions) can be loaded, with the XFree86\-DGA extension
+disabled by using the following entry:
+.PP
+.RS 4
+.nf
+.B "SubSection \*qextmod\*q"
+.B "   Option  \*qomit XFree86\-DGA\*q"
+.B EndSubSection
+.fi
+.RE
+.PP
+Modules are searched for in each directory specified in the
+.B ModulePath
+search path, and in the drivers, extensions, input, internal, and
+multimedia subdirectories of each of those directories.
+In addition to this, operating system specific subdirectories of all
+the above are searched first if they exist.
+.PP
+To see what extension modules are available, check the extensions
+subdirectory under:
+.PP
+.RS 4
+.nf
+__modulepath__
+.fi
+.RE
+.PP
+The \(lqextmod\(rq, \(lqdbe\(rq, \(lqdri\(rq, \(lqdri2\(rq, \(lqglx\(rq,
+and \(lqrecord\(rq extension modules are loaded automatically, if they
+are present, unless disabled with \*qDisable\*q entries.
+It is recommended
+that at very least the \(lqextmod\(rq extension module be loaded.
+If it isn't, some commonly used server extensions (like the SHAPE
+extension) will not be available.
+.SH "EXTENSIONS SECTION"
+The
+.B Extensions
+section is used to specify which X11 protocol extensions should be enabled
+or disabled.
+The
+.B Extensions
+section is optional, as are all of the entries that may be specified in
+it.
+.PP
+Entries in this section are listed as Option statements with the name of
+the extension as the first argument, and a boolean value as the second.
+The extension name is case\-sensitive, and matches the form shown in the output
+of \*qXorg -extension ?\*q.
+.PP
+.RS 7
+Example: the MIT-SHM extension can be disabled with the following entry:
+.PP
+.RS 4
+.nf
+.B "Section \*qExtensions\*q"
+.B "    Option \*qMIT-SHM\*q \*qDisable\*q"
+.B "EndSection"
+.fi
+.RE
+.RE
+.SH "INPUTDEVICE SECTION"
+The config file may have multiple
+.B InputDevice
+sections.
+Recent X servers employ input hotplugging to add input devices, with the HAL
+backend being the default backend for X servers since 1.4. It is usually not
+necessary to provide
+.B InputDevice
+sections in the xorg.conf if hotplugging is enabled.
+.PP
+If hotplugging is disabled, there will normally
+be at least two: one for the core (primary) keyboard
+and one for the core pointer.
+If either of these two is missing, a default configuration for the missing
+ones will be used. In the absence of an explicitly specified core input
+device, the first
+.B InputDevice
+marked as
+.B CorePointer
+(or
+.BR CoreKeyboard )
+is used.
+If there is no match there, the first
+.B InputDevice
+that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used.
+The final fallback is to use built\-in default configurations.
+Currently the default configuration may not work as expected on all platforms.
+.PP
+.B InputDevice
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qInputDevice\*q"
+.BI "    Identifier \*q" name \*q
+.BI "    Driver     \*q" inputdriver \*q
+.I  "    options"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The
+.B Identifier
+and
+.B Driver
+entries are required in all
+.B InputDevice
+sections.
+All other entries are optional.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this input device.
+The
+.B Driver
+entry specifies the name of the driver to use for this input device.
+When using the loadable server, the input driver module
+.RI \*q inputdriver \*q
+will be loaded for each active
+.B InputDevice
+section.
+An
+.B InputDevice
+section is considered active if it is referenced by an active
+.B ServerLayout
+section, if it is referenced by the
+.B \-keyboard
+or
+.B \-pointer
+command line options, or if it is selected implicitly as the core pointer
+or keyboard device in the absence of such explicit references.
+The most commonly used input drivers are
+.BR evdev (__drivermansuffix__)
+on Linux systems, and
+.BR kbd (__drivermansuffix__)
+and
+.BR mousedrv (__drivermansuffix__)
+on other platforms.
+.PP
+.PP
+.B InputDevice
+sections recognise some driver\-independent
+.BR Options ,
+which are described here.
+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, see
+.B Floating
+.TP 7
+.BI "Option \*qCoreKeyboard\*q"
+Deprecated, see
+.B Floating
+.TP 7
+.BI "Option \*qAlwaysCore\*q  \*q" boolean \*q
+Deprecated, see
+.B Floating
+.TP 7
+.BI "Option \*qSendCoreEvents\*q  \*q" boolean \*q
+Deprecated, see
+.B Floating
+
+.TP 7
+.BI "Option \*qFloating\*q  \*q" boolean \*q
+When enabled, the input device is set up floating and does not
+report events through any master device or control a cursor. The device is
+only available to clients using the X Input Extension API. This option is
+disabled by default.
+The options
+.B CorePointer,
+.B CoreKeyboard,
+.B AlwaysCore,
+and
+.B SendCoreEvents,
+are the inverse of option
+.B Floating
+(i.e.
+.B SendCoreEvents \*qon\*q
+is equivalent to
+.B Floating \*qoff\*q
+).
+
+This option controls the startup behavior only, a device
+may be reattached or set floating at runtime.
+.PP
+For pointing devices, the following options control how the pointer
+is accelerated or decelerated with respect to physical device motion. Most of
+these can be adjusted at runtime, see the xinput(1) man page for details. Only
+the most important acceleration options are discussed here.
+.TP 7
+.BI "Option \*qAccelerationProfile\*q  \*q" integer \*q
+Select the profile. In layman's terms, the profile constitutes the "feeling" of
+the acceleration. More formally, it defines how the transfer function (actual
+acceleration as a function of current device velocity and acceleration controls)
+is constructed. This is mainly a matter of personal preference.
+.PP
+.RS 6
+.nf
+.B  " 0      classic (mostly compatible)"
+.B  "-1      none (only constant deceleration is applied)"
+.B  " 1      device-dependent"
+.B  " 2      polynomial (polynomial function)"
+.B  " 3      smooth linear (soft knee, then linear)"
+.B  " 4      simple (normal when slow, otherwise accelerated)"
+.B  " 5      power (power function)"
+.B  " 6      linear (more speed, more acceleration)"
+.B  " 7      limited (like linear, but maxes out at threshold)"
+.fi
+.RE
+.TP 7
+.BI "Option \*qConstantDeceleration\*q  \*q" real \*q
+Makes the pointer go
+.B deceleration
+times slower than normal. Most useful for high-resolution devices.
+.TP 7
+.BI "Option \*qAdaptiveDeceleration\*q  \*q" real \*q
+Allows to actually decelerate the pointer when going slow. At most, it will be
+.B adaptive deceleration
+times slower. Enables precise pointer placement without sacrificing speed.
+.TP 7
+.BI "Option \*qAccelerationScheme\*q  \*q" string \*q
+Selects the scheme, which is the underlying algorithm.
+.PP
+.RS 7
+.nf
+.B  "predictable   default algorithm (behaving more predictable)"
+.B  "lightweight   old acceleration code (as specified in the X protocol spec)"
+.B  "none          no acceleration or deceleration"
+.fi
+.RE
+.TP 7
+.BI "Option \*qAccelerationNumerator\*q  \*q" integer \*q
+.TP 7
+.BI "Option \*qAccelerationDenominator\*q  \*q" integer \*q
+Set numerator and denominator of the acceleration factor. The acceleration
+factor is a rational which, together with threshold, can be used to tweak
+profiles to suit the users needs. The
+.B simple
+and
+.B limited
+profiles use it directly (i.e. they accelerate by the factor), for other
+profiles it should hold that a higher acceleration factor leads to a faster
+pointer. Typically, 1 is unaccelerated and values up to 5 are sensible.
+.TP 7
+.BI "Option \*qAccelerationThreshold\*q  \*q" integer \*q
+Set the threshold, which is roughly the velocity (usually device units per 10
+ms) required for acceleration to become effective. The precise effect varies
+with the profile however.
+
+.SH "INPUTCLASS SECTION"
+The config file may have multiple
+.B InputClass
+sections.
+These sections are optional and are used to provide configuration for a
+class of input devices as they are automatically added. An input device can
+match more than one
+.B InputClass
+section. Each class can override settings from a previous class, so it is
+best to arrange the sections with the most generic matches first.
+.PP
+.B InputClass
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qInputClass\*q"
+.BI "    Identifier  \*q" name \*q
+.I  "    entries"
+.I  "    ..."
+.I  "    options"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The
+.B Identifier
+entry is required in all
+.B InputClass
+sections.
+All other entries are optional.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this input class.
+The
+.B Driver
+entry specifies the name of the driver to use for this input device.
+After all classes have been examined, the
+.RI \*q inputdriver \*q
+module from the first
+.B Driver
+entry will be enabled when using the loadable server.
+.PP
+When an input device is automatically added, its characteristics are
+checked against all
+.B InputClass
+sections. Each section can contain optional entries to narrow the match
+of the class. If none of the optional entries appear, the
+.B InputClass
+section is generic and will match any input device. If more than one of
+these entries appear, they all must match for the configuration to apply.
+.PP
+There are two types of match entries used in
+.B InputClass
+sections. The first allows various tokens to be matched against attributes
+of the device. An entry can be constructed to match attributes from different
+devices by separating arguments with a '|' character. Multiple entries of the
+same type may be supplied to add multiple matching conditions on the same
+attribute. For example:
+.PP
+.RS 4
+.nf
+.B  "Section \*qInputClass\*q"
+.B  "    Identifier   \*qMy Class\*q"
+.B  "    # product string must contain example and
+.B  "    # either gizmo or gadget
+.B  "    MatchProduct \*qexample\*q
+.B  "    MatchProduct \*qgizmo|gadget\*q
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.TP 7
+.BI "MatchProduct  \*q" matchproduct \*q
+This entry can be used to check if the substring
+.RI \*q matchproduct \*q
+occurs in the device's product name.
+.TP 7
+.BI "MatchVendor  \*q" matchvendor \*q
+This entry can be used to check if the substring
+.RI \*q matchvendor \*q
+occurs in the device's vendor name.
+.TP 7
+.BI "MatchDevicePath \*q" matchdevice \*q
+This entry can be used to check if the device file matches the
+.RI \*q matchdevice \*q
+pathname pattern.
+.TP 7
+.BI "MatchOS \*q" matchos \*q
+This entry can be used to check if the operating system matches the
+case-insensitive
+.RI \*q matchos \*q
+string. This entry is only supported on platforms providing the
+.BR uname (2)
+system call.
+.TP 7
+.BI "MatchPnPID \*q" matchpnp \*q
+The device's Plug and Play (PnP) ID can be checked against the
+.RI \*q matchpnp \*q
+shell wildcard pattern.
+.TP 7
+.BI "MatchUSBID \*q" matchusb \*q
+The device's USB ID can be checked against the
+.RI \*q matchusb \*q
+shell wildcard pattern. The ID is constructed as lowercase hexadecimal numbers
+separated by a ':'. This is the same format as the
+.BR lsusb (8)
+program.
+.TP 7
+.BI "MatchDriver \*q" matchdriver \*q
+Check the case-sensitive string
+.RI \*q matchdriver \*q
+against the currently configured driver of the device. Ordering of sections
+using this entry is important since it will not match unless the driver has
+been set by the config backend or a previous
+.B InputClass
+section.
+.TP 7
+.BI "MatchTag \*q" matchtag \*q
+This entry can be used to check if tags assigned by the config backend
+matches the
+.RI \*q matchtag \*q
+pattern. A match is found if at least one of the tags given in
+.RI \*q matchtag \*q
+matches at least one of the tags assigned by the backend.
+.PP
+The second type of entry is used to match device types. These entries take a
+boolean argument similar to
+.B Option
+entries.
+.TP 7
+.BI "MatchIsKeyboard     \*q" bool \*q
+.TP 7
+.BI "MatchIsPointer      \*q" bool \*q
+.TP 7
+.BI "MatchIsJoystick     \*q" bool \*q
+.TP 7
+.BI "MatchIsTablet       \*q" bool \*q
+.TP 7
+.BI "MatchIsTouchpad     \*q" bool \*q
+.TP 7
+.BI "MatchIsTouchscreen  \*q" bool \*q
+.PP
+When an input device has been matched to the
+.B InputClass
+section, any
+.B Option
+entries are applied to the device. One
+.B InputClass
+specific
+.B Option
+is recognized. See the
+.B InputDevice
+section above for a description of the remaining
+.B Option
+entries.
+.TP 7
+.BI "Option \*qIgnore\*q \*q" boolean \*q
+This optional entry specifies that the device should be ignored entirely,
+and not added to the server. This can be useful when the device is handled
+by another program and no X events should be generated.
+.SH "DEVICE SECTION"
+The config file may have multiple
+.B Device
+sections.
+There must be at least one, for the video card being used.
+.PP
+.B Device
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qDevice\*q"
+.BI "    Identifier \*q" name \*q
+.BI "    Driver     \*q" driver \*q
+.I  "    entries"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The
+.B Identifier
+and
+.B Driver
+entries are required in all
+.B Device
+sections.  All other entries are optional.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this graphics device.
+The
+.B Driver
+entry specifies the name of the driver to use for this graphics device.
+When using the loadable server, the driver module
+.RI \*q driver \*q
+will be loaded for each active
+.B Device
+section.
+A
+.B Device
+section is considered active if it is referenced by an active
+.B Screen
+section.
+.PP
+.B Device
+sections recognise some driver\-independent entries and
+.BR Options ,
+which are described here.
+Not all drivers make use of these
+driver\-independent entries, and many of those that do don't require them
+to be specified because the information is auto\-detected.
+See the individual graphics driver manual pages for further information
+about this, and for a description of the device\-specific options.
+Note that most of the
+.B Options
+listed here (but not the other entries) may be specified in the
+.B Screen
+section instead of here in the
+.B Device
+section.
+.TP 7
+.BI "BusID  \*q" bus\-id \*q
+This specifies the bus location of the graphics card.
+For PCI/AGP cards,
+the
+.I bus\-id
+string has the form
+.BI PCI: bus : device : function
+(e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card).
+This field is usually optional in single-head configurations when using
+the primary graphics card.
+In multi-head configurations, or when using a secondary graphics card in a
+single-head configuration, this entry is mandatory.
+Its main purpose is to make an unambiguous connection between the device
+section and the hardware it is representing.
+This information can usually be found by running the pciaccess tool
+scanpci.
+.TP 7
+.BI "Screen  " number
+This option is mandatory for cards where a single PCI entity can drive more
+than one display (i.e., multiple CRTCs sharing a single graphics accelerator
+and video memory).
+One
+.B Device
+section is required for each head, and this
+parameter determines which head each of the
+.B Device
+sections applies to.
+The legal values of
+.I number
+range from 0 to one less than the total number of heads per entity.
+Most drivers require that the primary screen (0) be present.
+.TP 7
+.BI "Chipset  \*q" chipset \*q
+This usually optional entry specifies the chipset used on the graphics
+board.
+In most cases this entry is not required because the drivers will probe the
+hardware to determine the chipset type.
+Don't specify it unless the driver-specific documentation recommends that you
+do.
+.TP 7
+.BI "Ramdac  \*q" ramdac\-type \*q
+This optional entry specifies the type of RAMDAC used on the graphics
+board.
+This is only used by a few of the drivers, and in most cases it is not
+required because the drivers will probe the hardware to determine the
+RAMDAC type where possible.
+Don't specify it unless the driver-specific documentation recommends that you
+do.
+.TP 7
+.BI "DacSpeed  " speed
+.TP 7
+.BI "DacSpeed  " "speed\-8 speed\-16 speed\-24 speed\-32"
+This optional entry specifies the RAMDAC speed rating (which is usually
+printed on the RAMDAC chip).
+The speed is in MHz.
+When one value is given, it applies to all framebuffer pixel sizes.
+When multiple values are given, they apply to the framebuffer pixel sizes
+8, 16, 24 and 32 respectively.
+This is not used by many drivers, and only needs to be specified when the
+speed rating of the RAMDAC is different from the defaults built in to
+driver, or when the driver can't auto-detect the correct defaults.
+Don't specify it unless the driver-specific documentation recommends that you
+do.
+.TP 7
+.BI "Clocks  " "clock ..."
+specifies the pixel that are on your graphics board.
+The clocks are in MHz, and may be specified as a floating point number.
+The value is stored internally to the nearest kHz.
+The ordering of the clocks is important.
+It must match the order in which they are selected on the graphics board.
+Multiple
+.B Clocks
+lines may be specified, and each is concatenated to form the list.
+Most drivers do not use this entry, and it is only required for some older
+boards with non-programmable clocks.
+Don't specify this entry unless the driver-specific documentation explicitly
+recommends that you do.
+.TP
+.BI "ClockChip  \*q" clockchip\-type \*q
+This optional entry is used to specify the clock chip type on graphics
+boards which have a programmable clock generator.
+Only a few __xservername__ drivers support programmable clock chips.
+For details, see the appropriate driver manual page.
+.TP 7
+.BI "VideoRam  " "mem"
+This optional entry specifies the amount of video ram that is installed
+on the graphics board.
+This is measured in kBytes.
+In most cases this is not required because the __xservername__ server probes
+the graphics board to determine this quantity.
+The driver-specific documentation should indicate when it might be needed.
+.TP 7
+.BI "BiosBase  " "baseaddress"
+This optional entry specifies the base address of the video BIOS for
+the VGA board.
+This address is normally auto-detected, and should only be specified if the
+driver-specific documentation recommends it.
+.TP 7
+.BI "MemBase  " "baseaddress"
+This optional entry specifies the memory base address of a graphics
+board's linear frame buffer.
+This entry is not used by many drivers, and it should only be specified if
+the driver-specific documentation recommends it.
+.TP 7
+.BI "IOBase  " "baseaddress"
+This optional entry specifies the IO base address.
+This entry is not used by many drivers, and it should only be specified if
+the driver-specific documentation recommends it.
+.TP 7
+.BI "ChipID  " "id"
+This optional entry specifies a numerical ID representing the chip type.
+For PCI cards, it is usually the device ID.
+This can be used to override the auto-detection, but that should only be done
+when the driver-specific documentation recommends it.
+.TP 7
+.BI "ChipRev  " "rev"
+This optional entry specifies the chip revision number.
+This can be used to override the auto-detection, but that should only be done
+when the driver-specific documentation recommends it.
+.TP 7
+.BI "TextClockFreq  " "freq"
+This optional entry specifies the pixel clock frequency that is used
+for the regular text mode.
+The frequency is specified in MHz.
+This is rarely used.
+.TP 7
+.BI "Option \*qModeDebug\*q \*q" boolean \*q
+Enable printing of additional debugging information about modesetting to
+the server log.
+.ig
+.TP 7
+This optional entry allows an IRQ number to be specified.
+..
+.TP 7
+.B Options
+Option flags may be specified in the
+.B Device
+sections.
+These include driver\-specific options and driver\-independent options.
+The former are described in the driver\-specific documentation.
+Some of the latter are described below in the section about the
+.B Screen
+section, and they may also be included here.
+
+.SH "VIDEOADAPTOR SECTION"
+Nobody wants to say how this works.
+Maybe nobody knows ...
+
+.SH "MONITOR SECTION"
+The config file may have multiple
+.B Monitor
+sections.
+There should normally be at least one, for the monitor being used,
+but a default configuration will be created when one isn't specified.
+.PP
+.B Monitor
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qMonitor\*q"
+.BI "    Identifier \*q" name \*q
+.I  "    entries"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The only mandatory entry in a
+.B Monitor
+section is the
+.B Identifier
+entry.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this monitor.
+The
+.B Monitor
+section may be used to provide information about the specifications of the
+monitor, monitor-specific
+.BR Options ,
+and information about the video modes to use with the monitor.
+.PP
+With RandR 1.2-enabled drivers, monitor sections may be tied to specific
+outputs of the video card.  Using the name of the output defined by the video
+driver plus the identifier of a monitor section, one associates a monitor
+section with an output by adding an option to the Device section in the
+following format:
+
+.B Option \*qMonitor-outputname\*q \*qmonitorsection\*q
+
+(for example,
+.B Option \*qMonitor-VGA\*q \*qVGA monitor\*q
+for a VGA output)
+.PP
+In the absence of specific association of monitor sections to outputs, if a
+monitor section is present the server will associate it with an output to
+preserve compatibility for previous single-head configurations.
+.PP
+Specifying video modes is optional because the server will use the DDC or other
+information provided by the monitor to automatically configure the list of
+modes available.
+When modes are specified explicitly in the
+.B Monitor
+section (with the
+.BR Modes ,
+.BR ModeLine ,
+or
+.B UseModes
+keywords), built-in modes with the same names are not included.
+Built-in modes with different names are, however, still implicitly included,
+when they meet the requirements of the monitor.
+.PP
+The entries that may be used in
+.B Monitor
+sections are described below.
+.TP 7
+.BI "VendorName  \*q" vendor \*q
+This optional entry specifies the monitor's manufacturer.
+.TP 7
+.BI "ModelName  \*q" model \*q
+This optional entry specifies the monitor's model.
+.TP 7
+.BI "HorizSync  " "horizsync\-range"
+gives the range(s) of horizontal sync frequencies supported by the
+monitor.
+.I horizsync\-range
+may be a comma separated list of either discrete values or ranges of
+values.
+A range of values is two values separated by a dash.
+By default the values are in units of kHz.
+They may be specified in MHz or Hz
+if
+.B MHz
+or
+.B Hz
+is added to the end of the line.
+The data given here is used by the __xservername__ server to determine if video
+modes are within the specifications of the monitor.
+This information should be available in the monitor's handbook.
+If this entry is omitted, a default range of 28\-33kHz is used.
+.TP 7
+.BI "VertRefresh  " "vertrefresh\-range"
+gives the range(s) of vertical refresh frequencies supported by the
+monitor.
+.I vertrefresh\-range
+may be a comma separated list of either discrete values or ranges of
+values.
+A range of values is two values separated by a dash.
+By default the values are in units of Hz.
+They may be specified in MHz or kHz
+if
+.B MHz
+or
+.B kHz
+is added to the end of the line.
+The data given here is used by the __xservername__ server to determine if video
+modes are within the specifications of the monitor.
+This information should be available in the monitor's handbook.
+If this entry is omitted, a default range of 43\-72Hz is used.
+.TP 7
+.BI "DisplaySize  " "width height"
+This optional entry gives the width and height, in millimetres, of the
+picture area of the monitor.
+If given this is used to calculate the horizontal and vertical pitch (DPI) of
+the screen.
+.TP 7
+.BI "Gamma  " "gamma\-value"
+.TP 7
+.BI "Gamma  " "red\-gamma green\-gamma blue\-gamma"
+This is an optional entry that can be used to specify the gamma correction
+for the monitor.
+It may be specified as either a single value or as three separate RGB values.
+The values should be in the range 0.1 to 10.0, and the default is 1.0.
+Not all drivers are capable of using this information.
+.TP 7
+.BI "UseModes  \*q" modesection\-id \*q
+Include the set of modes listed in the
+.B Modes
+section called
+.IR modesection\-id.
+This makes all of the modes defined in that section available for use by
+this monitor.
+.TP 7
+.BI "Mode  \*q" name \*q
+This is an optional multi-line entry that can be used to provide
+definitions for video modes for the monitor.
+In most cases this isn't necessary because the built-in set of VESA standard
+modes will be sufficient.
+The
+.B Mode
+keyword indicates the start of a multi-line video mode description.
+The mode description is terminated with the
+.B EndMode
+keyword.
+The mode description consists of the following entries:
+.RS 7
+.TP 4
+.BI "DotClock  " clock
+is the dot (pixel) clock rate to be used for the mode.
+.TP 4
+.BI "HTimings  " "hdisp hsyncstart hsyncend htotal"
+specifies the horizontal timings for the mode.
+.TP 4
+.BI "VTimings  " "vdisp vsyncstart vsyncend vtotal"
+specifies the vertical timings for the mode.
+.TP 4
+.BI "Flags  \*q" flag \*q " ..."
+specifies an optional set of mode flags, each of which is a separate
+string in double quotes.
+.B \*qInterlace\*q
+indicates that the mode is interlaced.
+.B \*qDoubleScan\*q
+indicates a mode where each scanline is doubled.
+.B \*q+HSync\*q
+and
+.B \*q\-HSync\*q
+can be used to select the polarity of the HSync signal.
+.B \*q+VSync\*q
+and
+.B \*q\-VSync\*q
+can be used to select the polarity of the VSync signal.
+.B \*qComposite\*q
+can be used to specify composite sync on hardware where this is supported.
+Additionally, on some hardware,
+.B \*q+CSync\*q
+and
+.B \*q\-CSync\*q
+may be used to select the composite sync polarity.
+.TP 4
+.BI "HSkew  " hskew
+specifies the number of pixels (towards the right edge of the screen) by
+which the display enable signal is to be skewed.
+Not all drivers use this information.
+This option might become necessary to override the default value supplied
+by the server (if any).
+\(lqRoving\(rq horizontal lines indicate this value needs to be increased.
+If the last few pixels on a scan line appear on the left of the screen,
+this value should be decreased.
+.TP 4
+.BI "VScan  " vscan
+specifies the number of times each scanline is painted on the screen.
+Not all drivers use this information.
+Values less than 1 are treated as 1, which is the default.
+Generally, the
+.B \*qDoubleScan\*q
+.B Flag
+mentioned above doubles this value.
+.RE
+.TP 7
+.BI "ModeLine  \*q" name \*q " mode\-description"
+This entry is a more compact version of the
+.B Mode
+entry, and it also can be used to specify video modes for the monitor.
+is a single line format for specifying video modes.
+In most cases this isn't necessary because the built\-in set of VESA
+standard modes will be sufficient.
+.PP
+.RS 7
+The
+.I mode\-description
+is in four sections, the first three of which are mandatory.
+The first is the dot (pixel) clock.
+This is a single number specifying the pixel clock rate for the mode in
+MHz.
+The second section is a list of four numbers specifying the horizontal
+timings.
+These numbers are the
+.IR hdisp ,
+.IR hsyncstart ,
+.IR hsyncend ,
+and
+.I htotal
+values.
+The third section is a list of four numbers specifying the vertical
+timings.
+These numbers are the
+.IR vdisp ,
+.IR vsyncstart ,
+.IR vsyncend ,
+and
+.I vtotal
+values.
+The final section is a list of flags specifying other characteristics of
+the mode.
+.B Interlace
+indicates that the mode is interlaced.
+.B DoubleScan
+indicates a mode where each scanline is doubled.
+.B +HSync
+and
+.B \-HSync
+can be used to select the polarity of the HSync signal.
+.B +VSync
+and
+.B \-VSync
+can be used to select the polarity of the VSync signal.
+.B Composite
+can be used to specify composite sync on hardware where this is supported.
+Additionally, on some hardware,
+.B +CSync
+and
+.B \-CSync
+may be used to select the composite sync polarity.
+The
+.B HSkew
+and
+.B VScan
+options mentioned above in the
+.B Modes
+entry description can also be used here.
+.RE
+.TP 7
+.BI "Option " "\*qDPMS\*q  " \*qbool\*q
+This option controls whether the server should enable the DPMS extension
+for power management for this screen.  The default is to enable the
+extension.
+.TP 7
+.BI "Option " "\*qSyncOnGreen\*q  " \*qbool\*q
+This option controls whether the video card should drive the sync signal
+on the green color pin.  Not all cards support this option, and most
+monitors do not require it.  The default is off.
+.TP 7
+.BI "Option " "\*qPrimary\*q  " \*qbool\*q
+This optional entry specifies that the monitor should be treated as the primary
+monitor. (RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qPreferredMode\*q  " \*qstring\*q
+This optional entry specifies a mode to be marked as the preferred initial mode
+of the monitor.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qPosition\*q  " "\*qx y\*q"
+This optional entry specifies the position of the monitor within the X
+screen.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qLeftOf\*q  " \*qoutput\*q
+This optional entry specifies that the monitor should be positioned to the
+left of the output (not monitor) of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRightOf\*q  " \*qoutput\*q
+This optional entry specifies that the monitor should be positioned to the
+right of the output (not monitor) of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qAbove\*q  " \*qoutput\*q
+This optional entry specifies that the monitor should be positioned above the
+output (not monitor) of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qBelow\*q  " \*qoutput\*q
+This optional entry specifies that the monitor should be positioned below the
+output (not monitor) of the given name.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qEnable\*q  " \*qbool\*q
+This optional entry specifies whether the monitor should be turned on
+at startup.  By default, the server will attempt to enable all connected
+monitors.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qDefaultModes\*q  " \*qbool\*q
+This optional entry specifies whether the server should add supported default
+modes to the list of modes offered on this monitor. By default, the server
+will add default modes; you should only disable this if you can guarantee
+that EDID will be available at all times, or if you have added custom modelines
+which the server can use.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qMinClock\*q  " \*qfrequency\*q
+This optional entry specifies the minimum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qMaxClock\*q  " \*qfrequency\*q
+This optional entry specifies the maximum dot clock, in kHz, that is supported
+by the monitor.
+.TP 7
+.BI "Option " "\*qIgnore\*q  " \*qbool\*q
+This optional entry specifies that the monitor should be ignored entirely,
+and not reported through RandR.  This is useful if the hardware reports the
+presence of outputs that don't exist.
+(RandR 1.2-supporting drivers only)
+.TP 7
+.BI "Option " "\*qRotate\*q  " \*qrotation\*q
+This optional entry specifies the initial rotation of the given monitor.
+Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and
+\*qinverted\*q.
+(RandR 1.2-supporting drivers only)
+
+.SH "MODES SECTION"
+The config file may have multiple
+.B Modes
+sections, or none.
+These sections provide a way of defining sets of video modes independently
+of the
+.B Monitor
+sections.
+.B Monitor
+sections may include the definitions provided in these sections by
+using the
+.B UseModes
+keyword.
+In most cases the
+.B Modes
+sections are not necessary because the built\-in set of VESA standard modes
+will be sufficient.
+.PP
+.B Modes
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qModes\*q"
+.BI "    Identifier \*q" name \*q
+.I  "    entries"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The
+.B Identifier
+entry specifies the unique name for this set of mode descriptions.
+The other entries permitted in
+.B Modes
+sections are the
+.B Mode
+and
+.B ModeLine
+entries that are described above in the
+.B Monitor
+section.
+.SH "SCREEN SECTION"
+The config file may have multiple
+.B Screen
+sections.
+There must be at least one, for the \(lqscreen\(rq being used.
+A \(lqscreen\(rq represents the binding of a graphics device
+.RB ( Device
+section) and a monitor
+.RB ( Monitor
+section).
+A
+.B Screen
+section is considered \(lqactive\(rq if it is referenced by an active
+.B ServerLayout
+section or by the
+.B \-screen
+command line option.
+If neither of those is present, the first
+.B Screen
+section found in the config file is considered the active one.
+.PP
+.B Screen
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qScreen\*q"
+.BI "    Identifier \*q" name \*q
+.BI "    Device     \*q" devid \*q
+.BI "    Monitor    \*q" monid \*q
+.I  "    entries"
+.I  "    ..."
+.BI "    SubSection \*qDisplay\*q"
+.I  "       entries"
+.I  "       ...
+.B  "    EndSubSection"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+The
+.B Identifier
+and
+.B Device
+entries are mandatory.
+All others are optional.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this screen.
+The
+.B Screen
+section provides information specific to the whole screen, including
+screen\-specific
+.BR Options .
+In multi\-head configurations, there will be multiple active
+.B Screen
+sections, one for each head.
+The entries available
+for this section are:
+.TP 7
+.BI "Device  \*q" device\-id \*q
+This mandatory entry specifies the
+.B Device
+section to be used for this screen.
+This is what ties a specific graphics card to a screen.
+The
+.I device\-id
+must match the
+.B Identifier
+of a
+.B Device
+section in the config file.
+.TP 7
+.BI "Monitor  \*q" monitor\-id \*q
+specifies which monitor description is to be used for this screen.
+If a
+.B Monitor
+name is not specified, a default configuration is used.
+Currently the default configuration may not function as expected on all
+platforms.
+.TP 7
+.BI "VideoAdaptor  \*q" xv\-id \*q
+specifies an optional Xv video adaptor description to be used with this
+screen.
+.TP 7
+.BI "DefaultDepth  " depth
+specifies which color depth the server should use by default.
+The
+.B \-depth
+command line option can be used to override this.
+If neither is specified, the default depth is driver\-specific, but in most
+cases is 8.
+.TP 7
+.BI "DefaultFbBpp  " bpp
+specifies which framebuffer layout to use by default.
+The
+.B \-fbbpp
+command line option can be used to override this.
+In most cases the driver will chose the best default value for this.
+The only case where there is even a choice in this value is for depth 24,
+where some hardware supports both a packed 24 bit framebuffer layout and a
+sparse 32 bit framebuffer layout.
+.TP 7
+.B Options
+Various
+.B Option
+flags may be specified in the
+.B Screen
+section.
+Some are driver\-specific and are described in the driver documentation.
+Others are driver\-independent, and will eventually be described here.
+.\" XXX These should really be in an xaa man page.
+.TP 7
+.BI "Option \*qAccel\*q"
+Enables XAA (X Acceleration Architecture), a mechanism that makes video cards'
+2D hardware acceleration available to the  __xservername__ server.
+This option is on by default, but it may be necessary to turn it off if
+there are bugs in the driver.
+There are many options to disable specific accelerated operations, listed
+below.
+Note that disabling an operation will have no effect if the operation is
+not accelerated (whether due to lack of support in the hardware or in the
+driver).
+.TP 7
+.BI "Option \*qInitPrimary\*q \*q" boolean \*q
+Use the Int10 module to initialize the primary graphics card.
+Normally, only secondary cards are soft-booted using the Int10 module, as the
+primary card has already been initialized by the BIOS at boot time.
+Default: false.
+.TP 7
+.BI "Option \*qNoInt10\*q \*q" boolean \*q
+Disables the Int10 module, a module that uses the int10 call to the BIOS
+of the graphics card to initialize it.
+Default: false.
+.TP 7
+.BI "Option \*qNoMTRR\*q"
+Disables MTRR (Memory Type Range Register) support, a feature of modern
+processors which can improve video performance by a factor of up to 2.5.
+Some hardware has buggy MTRR support, and some video drivers have been
+known to exhibit problems when MTRR's are used.
+.TP 7
+.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in system memory (using a memory\-mapped aperture).
+.TP 7
+.BI "Option \*qXaaNoColor8x8PatternFillRect\*q"
+Disables accelerated fills of a rectangular region with a full\-color
+pattern.
+.TP 7
+.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q"
+Disables accelerated fills of a trapezoidal region with a full\-color
+pattern.
+.TP 7
+.BI "Option \*qXaaNoDashedBresenhamLine\*q"
+Disables accelerated dashed Bresenham line draws.
+.TP 7
+.BI "Option \*qXaaNoDashedTwoPointLine\*q"
+Disables accelerated dashed line draws between two arbitrary points.
+.TP 7
+.BI "Option \*qXaaNoImageWriteRect\*q"
+Disables accelerated transfers of full\-color rectangular patterns from
+system memory to video memory (using a memory\-mapped aperture).
+.TP 7
+.BI "Option \*qXaaNoMono8x8PatternFillRect\*q"
+Disables accelerated fills of a rectangular region with a monochrome
+pattern.
+.TP 7
+.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q"
+Disables accelerated fills of a trapezoidal region with a monochrome
+pattern.
+.TP 7
+.BI "Option \*qXaaNoOffscreenPixmaps\*q"
+Disables accelerated draws into pixmaps stored in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoPixmapCache\*q"
+Disables caching of patterns in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in system memory (one scan line at a time).
+.TP 7
+.BI "Option \*qXaaNoScanlineImageWriteRect\*q"
+Disables accelerated transfers of full\-color rectangular patterns from
+system memory to video memory (one scan line at a time).
+.TP 7
+.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q"
+Disables accelerated rectangular expansion blits from source patterns
+stored in offscreen video memory.
+.TP 7
+.BI "Option \*qXaaNoScreenToScreenCopy\*q"
+Disables accelerated copies of rectangular regions from one part of
+video memory to another part of video memory.
+.TP 7
+.BI "Option \*qXaaNoSolidBresenhamLine\*q"
+Disables accelerated solid Bresenham line draws.
+.TP 7
+.BI "Option \*qXaaNoSolidFillRect\*q"
+Disables accelerated solid\-color fills of rectangles.
+.TP 7
+.BI "Option \*qXaaNoSolidFillTrap\*q"
+Disables accelerated solid\-color fills of Bresenham trapezoids.
+.TP 7
+.BI "Option \*qXaaNoSolidHorVertLine\*q"
+Disables accelerated solid horizontal and vertical line draws.
+.TP 7
+.BI "Option \*qXaaNoSolidTwoPointLine\*q"
+Disables accelerated solid line draws between two arbitrary points.
+.PP
+Each
+.B Screen
+section may optionally contain one or more
+.B Display
+subsections.
+Those subsections provide depth/fbbpp specific configuration information,
+and the one chosen depends on the depth and/or fbbpp that is being used for
+the screen.
+The
+.B Display
+subsection format is described in the section below.
+
+.SH "DISPLAY SUBSECTION"
+Each
+.B Screen
+section may have multiple
+.B Display
+subsections.
+The \(lqactive\(rq
+.B Display
+subsection is the first that matches the depth and/or fbbpp values being
+used, or failing that, the first that has neither a depth or fbbpp value
+specified.
+The
+.B Display
+subsections are optional.
+When there isn't one that matches the depth and/or fbbpp values being used,
+all the parameters that can be specified here fall back to their defaults.
+.PP
+.B Display
+subsections have the following format:
+.PP
+.RS 4
+.nf
+.B  "    SubSection \*qDisplay\*q"
+.BI "        Depth  " depth
+.I  "        entries"
+.I  "        ..."
+.B  "    EndSubSection"
+.fi
+.RE
+.TP 7
+.BI "Depth  " depth
+This entry specifies what colour depth the
+.B Display
+subsection is to be used for.
+This entry is usually specified, but it may be omitted to create a match\-all
+.B Display
+subsection or when wishing to match only against the
+.B FbBpp
+parameter.
+The range of
+.I depth
+values that are allowed depends on the driver.
+Most drivers support 8, 15, 16 and 24.
+Some also support 1 and/or 4, and some may support other values (like 30).
+Note:
+.I depth
+means the number of bits in a pixel that are actually used to determine
+the pixel colour.
+32 is not a valid
+.I depth
+value.
+Most hardware that uses 32 bits per pixel only uses 24 of them to hold the
+colour information, which means that the colour depth is 24, not 32.
+.TP 7
+.BI "FbBpp  " bpp
+This entry specifies the framebuffer format this
+.B Display
+subsection is to be used for.
+This entry is only needed when providing depth 24 configurations that allow
+a choice between a 24 bpp packed framebuffer format and a 32bpp sparse
+framebuffer format.
+In most cases this entry should not be used.
+.TP 7
+.BI "Weight  " "red\-weight green\-weight blue\-weight"
+This optional entry specifies the relative RGB weighting to be used
+for a screen is being used at depth 16 for drivers that allow multiple
+formats.
+This may also be specified from the command line with the
+.B \-weight
+option (see
+.BR __xservername__(__appmansuffix__)).
+.TP 7
+.BI "Virtual  " "xdim ydim"
+This optional entry specifies the virtual screen resolution to be used.
+.I xdim
+must be a multiple of either 8 or 16 for most drivers, and a multiple
+of 32 when running in monochrome mode.
+The given value will be rounded down if this is not the case.
+Video modes which are too large for the specified virtual size will be
+rejected.
+If this entry is not present, the virtual screen resolution will be set to
+accommodate all the valid video modes given in the
+.B Modes
+entry.
+Some drivers/hardware combinations do not support virtual screens.
+Refer to the appropriate driver\-specific documentation for details.
+.TP 7
+.BI "ViewPort  " "x0 y0"
+This optional entry sets the upper left corner of the initial display.
+This is only relevant when the virtual screen resolution is different
+from the resolution of the initial video mode.
+If this entry is not given, then the initial display will be centered in
+the virtual display area.
+.TP 7
+.BI "Modes  \*q" mode\-name \*q " ..."
+This optional entry specifies the list of video modes to use.
+Each
+.I mode\-name
+specified must be in double quotes.
+They must correspond to those specified or referenced in the appropriate
+.B Monitor
+section (including implicitly referenced built\-in VESA standard modes).
+The server will delete modes from this list which don't satisfy various
+requirements.
+The first valid mode in this list will be the default display mode for
+startup.
+The list of valid modes is converted internally into a circular list.
+It is possible to switch to the next mode with
+.B Ctrl+Alt+Keypad\-Plus
+and to the previous mode with
+.BR Ctrl+Alt+Keypad\-Minus .
+When this entry is omitted, the valid modes referenced by the appropriate
+.B Monitor
+section will be used.  If the
+.B Monitor
+section contains no modes, then the selection will be taken from the
+built-in VESA standard modes.
+.TP 7
+.BI "Visual  \*q" visual\-name \*q
+This optional entry sets the default root visual type.
+This may also be specified from the command line (see the
+.BR Xserver(__appmansuffix__)
+man page).
+The visual types available for depth 8 are (default is
+.BR PseudoColor ):
+.PP
+.RS 11
+.nf
+.B StaticGray
+.B GrayScale
+.B StaticColor
+.B PseudoColor
+.B TrueColor
+.B DirectColor
+.fi
+.RE
+.PP
+.RS 7
+The visual type available for the depths 15, 16 and 24 are (default is
+.BR TrueColor ):
+.PP
+.RS 4
+.nf
+.B TrueColor
+.B DirectColor
+.fi
+.RE
+.PP
+Not all drivers support
+.B DirectColor
+at these depths.
+.PP
+The visual types available for the depth 4 are (default is
+.BR StaticColor ):
+.PP
+.RS 4
+.nf
+.B StaticGray
+.B GrayScale
+.B StaticColor
+.B PseudoColor
+.fi
+.RE
+.PP
+The visual type available for the depth 1 (monochrome) is
+.BR StaticGray .
+.RE
+.TP 7
+.BI "Black  " "red green blue"
+This optional entry allows the \(lqblack\(rq colour to be specified.
+This is only supported at depth 1.
+The default is black.
+.TP 7
+.BI "White  " "red green blue"
+This optional entry allows the \(lqwhite\(rq colour to be specified.
+This is only supported at depth 1.
+The default is white.
+.TP 7
+.B Options
+Option flags may be specified in the
+.B Display
+subsections.
+These may include driver\-specific options and driver\-independent options.
+The former are described in the driver\-specific documentation.
+Some of the latter are described above in the section about the
+.B Screen
+section, and they may also be included here.
+.SH "SERVERLAYOUT SECTION"
+The config file may have multiple
+.B ServerLayout
+sections.
+A \(lqserver layout\(rq represents the binding of one or more screens
+.RB ( Screen
+sections) and one or more input devices
+.RB ( InputDevice
+sections) to form a complete configuration.
+In multi\-head configurations, it also specifies the relative layout of the
+heads.
+A
+.B ServerLayout
+section is considered \(lqactive\(rq if it is referenced by the
+.B \-layout
+command line option or by an
+.B "Option \*qDefaultServerLayout\*q"
+entry in the
+.B ServerFlags
+section (the former takes precedence over the latter).
+If those options are not used, the first
+.B ServerLayout
+section found in the config file is considered the active one.
+If no
+.B ServerLayout
+sections are present, the single active screen and two active (core)
+input devices are selected as described in the relevant sections above.
+.PP
+.B ServerLayout
+sections have the following format:
+.PP
+.RS 4
+.nf
+.B  "Section \*qServerLayout\*q"
+.BI "    Identifier   \*q" name \*q
+.BI "    Screen       \*q" screen\-id \*q
+.I  "    ..."
+.BI "    InputDevice  \*q" idev\-id \*q
+.I  "    ..."
+.I  "    options"
+.I  "    ..."
+.B  "EndSection"
+.fi
+.RE
+.PP
+Each
+.B ServerLayout
+section must have an
+.B Identifier
+entry and at least one
+.B Screen
+entry.
+.PP
+The
+.B Identifier
+entry specifies the unique name for this server layout.
+The
+.B ServerLayout
+section provides information specific to the whole session, including
+session\-specific
+.BR Options .
+The
+.B ServerFlags
+options (described above) may be specified here, and ones given here
+override those given in the
+.B ServerFlags
+section.
+.PP
+The entries that may be used in this section are described here.
+.TP 7
+.BI "Screen  " "screen\-num" " \*qscreen\-id\*q " "position\-information"
+One of these entries must be given for each screen being used in
+a session.
+The
+.I screen\-id
+field is mandatory, and specifies the
+.B Screen
+section being referenced.
+The
+.I screen\-num
+field is optional, and may be used to specify the screen number
+in multi\-head configurations.
+When this field is omitted, the screens will be numbered in the order that
+they are listed in.
+The numbering starts from 0, and must be consecutive.
+The
+.I position\-information
+field describes the way multiple screens are positioned.
+There are a number of different ways that this information can be provided:
+.RS 7
+.TP 4
+.I  "x y"
+.TP 4
+.BI "Absolute  " "x y"
+These both specify that the upper left corner's coordinates are
+.RI ( x , y ).
+The
+.B Absolute
+keyword is optional.
+Some older versions of XFree86 (4.2 and earlier) don't recognise the
+.B Absolute
+keyword, so it's safest to just specify the coordinates without it.
+.TP 4
+.BI "RightOf   \*q" screen\-id \*q
+.TP 4
+.BI "LeftOf    \*q" screen\-id \*q
+.TP 4
+.BI "Above     \*q" screen\-id \*q
+.TP 4
+.BI "Below     \*q" screen\-id \*q
+.TP 4
+.BI "Relative  \*q" screen\-id \*q " x y"
+These give the screen's location relative to another screen.
+The first four position the screen immediately to the right, left, above or
+below the other screen.
+When positioning to the right or left, the top edges are aligned.
+When positioning above or below, the left edges are aligned.
+The
+.B Relative
+form specifies the offset of the screen's origin (upper left corner)
+relative to the origin of another screen.
+.RE
+.TP 7
+.BI "InputDevice  \*q" idev\-id "\*q \*q" option \*q " ..."
+One of these entries should be given for each input device being used in
+a session.
+Normally at least two are required, one each for the core pointer and
+keyboard devices.
+If either of those is missing, suitable
+.B InputDevice
+entries are searched for using the method described above in the
+.B INPUTDEVICE
+section.  The
+.I idev\-id
+field is mandatory, and specifies the name of the
+.B InputDevice
+section being referenced.
+Multiple
+.I option
+fields may be specified, each in double quotes.
+The options permitted here are any that may also be given in the
+.B InputDevice
+sections.
+Normally only session\-specific input device options would be used here.
+The most commonly used options are:
+.PP
+.RS 11
+.nf
+.B \*qCorePointer\*q
+.B \*qCoreKeyboard\*q
+.B \*qSendCoreEvents\*q
+.fi
+.RE
+.PP
+.RS 7
+and the first two should normally be used to indicate the core pointer
+and core keyboard devices respectively.
+.RE
+.TP 7
+.B Options
+In addition to the following, any option permitted in the
+.B ServerFlags
+section may also be specified here.
+When the same option appears in both places, the value given here overrides
+the one given in the
+.B ServerFlags
+section.
+.TP 7
+.BI "Option \*qIsolateDevice\*q  \*q" bus\-id \*q
+Restrict device resets to the specified
+.IR bus\-id .
+See the
+.B BusID
+option (described in
+.BR "DEVICE SECTION" ,
+above) for the format of the
+.I bus\-id
+parameter.
+This option overrides
+.BR SingleCard ,
+if specified.
+At present, only PCI devices can be isolated in this manner.
+.TP 7
+.BI "Option \*qSingleCard\*q  \*q" boolean \*q
+As
+.BR IsolateDevice ,
+except that the bus ID of the first device in the layout is used.
+.PP
+Here is an example of a
+.B ServerLayout
+section for a dual headed configuration with two mice:
+.PP
+.RS 4
+.nf
+.B "Section \*qServerLayout\*q"
+.B "    Identifier  \*qLayout 1\*q"
+.B "    Screen      \*qMGA 1\*q"
+.B "    Screen      \*qMGA 2\*q RightOf \*qMGA 1\*q"
+.B "    InputDevice \*qKeyboard 1\*q \*qCoreKeyboard\*q"
+.B "    InputDevice \*qMouse 1\*q    \*qCorePointer\*q"
+.B "    InputDevice \*qMouse 2\*q    \*qSendCoreEvents\*q"
+.B "    Option      \*qBlankTime\*q  \*q5\*q"
+.B "EndSection"
+.fi
+.RE
+.SH "DRI SECTION"
+This optional section is used to provide some information for the
+Direct Rendering Infrastructure.
+Details about the format of this section can be found on-line at
+.IR <http://dri.freedesktop.org/> .
+.SH "VENDOR SECTION"
+The optional
+.B Vendor
+section may be used to provide vendor\-specific configuration information.
+Multiple
+.B Vendor
+sections may be present, and they may contain an
+.B Identifier
+entry and multiple
+.B Option
+flags.
+The data therein is not used in this release.
+.PP
+.SH "SEE ALSO"
+General:
+.BR X (__miscmansuffix__),
+.BR Xserver (__appmansuffix__),
+.BR __xservername__ (__appmansuffix__),
+.BR cvt (__appmansuffix__),
+.BR gtf (__appmansuffix__).
+.PP
+.B "Not all modules or interfaces are available on all platforms."
+.PP
+Display drivers:
+.BR apm (__drivermansuffix__),
+.BR ati (__drivermansuffix__),
+.BR chips (__drivermansuffix__),
+.BR cirrus (__drivermansuffix__),
+.BR cyrix (__drivermansuffix__),
+.BR fbdev (__drivermansuffix__),
+.BR glide (__drivermansuffix__),
+.BR glint (__drivermansuffix__),
+.BR i128 (__drivermansuffix__),
+.BR i740 (__drivermansuffix__),
+.BR imstt (__drivermansuffix__),
+.BR intel (__drivermansuffix__),
+.BR mga (__drivermansuffix__),
+.BR neomagic (__drivermansuffix__),
+.BR nv (__drivermansuffix__),
+.BR openchrome (__drivermansuffix__),
+.BR r128 (__drivermansuffix__),
+.BR radeon (__drivermansuffix__),
+.BR rendition (__drivermansuffix__),
+.BR savage (__drivermansuffix__),
+.BR s3virge (__drivermansuffix__),
+.BR siliconmotion (__drivermansuffix__),
+.BR sis (__drivermansuffix__),
+.BR sisusb (__drivermansuffix__),
+.BR sunbw2 (__drivermansuffix__),
+.BR suncg14 (__drivermansuffix__),
+.BR suncg3 (__drivermansuffix__),
+.BR suncg6 (__drivermansuffix__),
+.BR sunffb (__drivermansuffix__),
+.BR sunleo (__drivermansuffix__),
+.BR suntcx (__drivermansuffix__),
+.BR tdfx (__drivermansuffix__),
+.\" .BR tga (__drivermansuffix__),
+.BR trident (__drivermansuffix__),
+.BR tseng (__drivermansuffix__),
+.BR vesa (__drivermansuffix__),
+.BR vmware (__drivermansuffix__),
+.BR voodoo (__drivermansuffix__),
+.BR wsfb (__drivermansuffix__),
+.BR xgi (__drivermansuffix__),
+.BR xgixp (__drivermansuffix__).
+.PP
+Input drivers:
+.BR acecad (__drivermansuffix__),
+.BR citron (__drivermansuffix__),
+.BR elographics (__drivermansuffix__),
+.BR evdev (__drivermansuffix__),
+.BR fpit (__drivermansuffix__),
+.BR joystick (__drivermansuffix__),
+.BR kbd (__drivermansuffix__),
+.BR mousedrv (__drivermansuffix__),
+.BR mutouch (__drivermansuffix__),
+.BR penmount (__drivermansuffix__),
+.BR synaptics (__drivermansuffix__),
+.BR vmmouse (__drivermansuffix__),
+.BR void (__drivermansuffix__),
+.BR wacom (__drivermansuffix__).
+.PP
+Other modules and interfaces:
+.BR exa (__drivermansuffix__),
+.BR fbdevhw (__drivermansuffix__),
+.\" .BR shadowfb (__drivermansuffix__),
+.BR v4l (__drivermansuffix__).
+.br
+.SH AUTHORS
+This manual page was largely rewritten by David Dawes
+.IR <dawes at xfree86.org> .
commit d3adf2d9350bee4125107e2ea1ed0c51bb736562
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Thu Mar 10 11:40:40 2011 +0200

    xfree86/modes: Fixed memory leak in xf86InitialConfiguration
    
    There were two memory leaks in the function: one was the lack of free
    for "enabled", the other was the full lack of releasing anything when
    configuration was too small. The first issue was fixed by adding the
    missing free, the other was addressed by replacing the duplicate
    memory releasing sequences with one that is gotoed into.
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 86f038a..c2814d4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2354,6 +2354,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
     int			i = scrn->scrnIndex;
     Bool have_outputs = TRUE;
     Bool ret;
+    Bool success = FALSE;
 
     /* Set up the device options */
     config->options = xnfalloc (sizeof (xf86DeviceOptions));
@@ -2412,11 +2413,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
      * Set the position of each output
      */
     if (!xf86InitialOutputPositions (scrn, modes))
-    {
-	free(crtcs);
-	free(modes);
-	return FALSE;
-    }
+	goto bailout;
 
     /*
      * Set initial panning of each output
@@ -2427,11 +2424,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
      * Assign CRTCs to fit output configuration
      */
     if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
-    {
-	free(crtcs);
-	free(modes);
-	return FALSE;
-    }
+	goto bailout;
     
     /* XXX override xf86 common frame computation code */
     
@@ -2508,7 +2501,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
      * Make sure the configuration isn't too small.
      */
     if (width < config->minWidth || height < config->minHeight)
-	return FALSE;
+	goto bailout;
 
     /*
      * Limit the crtc config to virtual[XY] if the driver can't grow the
@@ -2531,10 +2524,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 				   xf86CVTMode(width, height, 60, 0, 0));
     }
 
-    
+    success = TRUE;
+ bailout:
     free(crtcs);
     free(modes);
-    return TRUE;
+    free(enabled);
+    return success;
 }
 
 /*
commit a713832cbe494ff468a627e88b11164074bbd14e
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Mar 13 20:01:30 2011 +0000

    When XDMCP -from is specified, only register the requested address
    
    When XDMCP -from is specified, only register the requested address,
    rather than the requested address, and any others we have of different
    address families to the requested address.
    
    e.g. if we have 4 interfaces with both IPv4 and IPv6 addresses (which
    are not IPv6 mapped IPV4 addresses), using -from with one of those IPv4
    addresses currently means only that IPv4 address, and all IPv6 addresses
    are used in the connection data in XDMCP REQUEST packet.
    
    (See http://cygwin.com/ml/cygwin-xfree/2011-02/msg00000.html)
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/os/xdmcp.c b/os/xdmcp.c
index 877b11c..f5331e1 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -486,7 +486,7 @@ XdmcpRegisterConnection (
 	    }
 	}
 #endif
-	if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) {
+	if (!fromAddr || memcmp(regAddr, fromAddr, regAddrlen) != 0) {
 	    return;
 	}
     }
commit 0ac4931753a5d5925fc844c8cbec08585aea57a7
Merge: a8146f6... d7f8011...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Mar 14 13:06:41 2011 -0700

    Merge remote-tracking branch 'ajax/xserver-next'

commit d7f8011418f9da06631f27c66c29bcb226d0dffe
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 8 10:14:28 2011 -0500

    Remove TriStrip and TriFan from the picture screen
    
    These functions no longer go through the screen vtable, so remove
    them and fix up the various wrappers.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h
index bf4b92c..c6b6199 100644
--- a/hw/dmx/dmx.h
+++ b/hw/dmx/dmx.h
@@ -249,8 +249,6 @@ typedef struct _DMXScreenInfo {
 
     TrapezoidsProcPtr              Trapezoids;
     TrianglesProcPtr               Triangles;
-    TriStripProcPtr                TriStrip;
-    TriFanProcPtr                  TriFan;
 } DMXScreenInfo;
 
 /* Global variables available to all Xserver/hw/dmx routines. */
diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c
index bbde8fd..1fb5462 100644
--- a/hw/dmx/dmxpict.c
+++ b/hw/dmx/dmxpict.c
@@ -165,8 +165,6 @@ Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
 
     DMX_WRAP(Trapezoids,         dmxTrapezoids,         dmxScreen, ps);
     DMX_WRAP(Triangles,          dmxTriangles,          dmxScreen, ps);
-    DMX_WRAP(TriStrip,           dmxTriStrip,           dmxScreen, ps);
-    DMX_WRAP(TriFan,             dmxTriFan,             dmxScreen, ps);
 
     return TRUE;
 }
@@ -1237,88 +1235,3 @@ void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 
     DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
 }
-
-/** Composite a triangle strip on the appropriate screen.  For a
- *  complete description see the protocol document of the RENDER
- *  library. */
-void dmxTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
-		 PictFormatPtr maskFormat,
-		 INT16 xSrc, INT16 ySrc,
-		 int npoint, xPointFixed *points)
-{
-    ScreenPtr         pScreen   = pDst->pDrawable->pScreen;
-    DMXScreenInfo    *dmxScreen = &dmxScreens[pScreen->myNum];
-    PictureScreenPtr  ps        = GetPictureScreen(pScreen);
-    dmxPictPrivPtr    pSrcPriv  = DMX_GET_PICT_PRIV(pSrc);
-    dmxPictPrivPtr    pDstPriv  = DMX_GET_PICT_PRIV(pDst);
-
-    DMX_UNWRAP(TriStrip, dmxScreen, ps);
-#if 0
-    if (ps->TriStrip)
-	ps->TriStrip(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points);
-#endif
-
-    /* Draw trapezoids on back-end server */
-    if (pDstPriv->pict) {
-	XRenderPictFormat *pFormat;
-
-	pFormat = dmxFindFormat(dmxScreen, maskFormat);
-	if (!pFormat) {
-	    /* FIXME: Error! */
-	}
-
-	XRenderCompositeTriStrip(dmxScreen->beDisplay,
-				 op,
-				 pSrcPriv->pict,
-				 pDstPriv->pict,
-				 pFormat,
-				 xSrc, ySrc,
-				 (XPointFixed *)points,
-				 npoint);
-	dmxSync(dmxScreen, FALSE);
-    }
-
-    DMX_WRAP(TriStrip, dmxTriStrip, dmxScreen, ps);
-}
-
-/** Composite a triangle fan on the appropriate screen.  For a complete
- *  description see the protocol document of the RENDER library. */
-void dmxTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
-	       PictFormatPtr maskFormat,
-	       INT16 xSrc, INT16 ySrc,
-	       int npoint, xPointFixed *points)
-{
-    ScreenPtr         pScreen   = pDst->pDrawable->pScreen;
-    DMXScreenInfo    *dmxScreen = &dmxScreens[pScreen->myNum];
-    PictureScreenPtr  ps        = GetPictureScreen(pScreen);
-    dmxPictPrivPtr    pSrcPriv  = DMX_GET_PICT_PRIV(pSrc);
-    dmxPictPrivPtr    pDstPriv  = DMX_GET_PICT_PRIV(pDst);
-
-    DMX_UNWRAP(TriFan, dmxScreen, ps);
-#if 0
-    if (ps->TriFan)
-	ps->TriFan(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, *points);
-#endif
-
-    /* Draw trapezoids on back-end server */
-    if (pDstPriv->pict) {
-	XRenderPictFormat *pFormat;
-
-	pFormat = dmxFindFormat(dmxScreen, maskFormat);
-	if (!pFormat) {
-	    /* FIXME: Error! */
-	}
-
-	XRenderCompositeTriFan(dmxScreen->beDisplay,
-			       op,
-			       pSrcPriv->pict,
-			       pDstPriv->pict,
-			       pFormat,
-			       xSrc, ySrc,
-			       (XPointFixed *)points,
-			       npoint);
-	dmxSync(dmxScreen, FALSE);
-    }
-
-    DMX_WRAP(TriFan, dmxTriFan, dmxScreen, ps);
-}
diff --git a/hw/dmx/dmxpict.h b/hw/dmx/dmxpict.h
index 3c8a09c..a732991 100644
--- a/hw/dmx/dmxpict.h
+++ b/hw/dmx/dmxpict.h
@@ -100,16 +100,6 @@ extern void dmxTriangles(CARD8 op,
 			 PictFormatPtr maskFormat,
 			 INT16 xSrc, INT16 ySrc,
 			 int ntri, xTriangle *tris);
-extern void dmxTriStrip(CARD8 op,
-			PicturePtr pSrc, PicturePtr pDst,
-			PictFormatPtr maskFormat,
-			INT16 xSrc, INT16 ySrc,
-			int npoint, xPointFixed *points);
-extern void dmxTriFan(CARD8 op,
-		      PicturePtr pSrc, PicturePtr pDst,
-		      PictFormatPtr maskFormat,
-		      INT16 xSrc, INT16 ySrc,
-		      int npoint, xPointFixed *points);
 
 extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
 extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
index 31eb9e5..e2bb9ad 100644
--- a/miext/cw/cw.h
+++ b/miext/cw/cw.h
@@ -106,8 +106,6 @@ typedef struct {
 
     TrapezoidsProcPtr		Trapezoids;
     TrianglesProcPtr		Triangles;
-    TriStripProcPtr		TriStrip;
-    TriFanProcPtr		TriFan;
 
     RasterizeTrapezoidProcPtr	RasterizeTrapezoid;
 } cwScreenRec, *cwScreenPtr;
diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c
index 165c44f..1f990ae 100644
--- a/miext/cw/cw_render.c
+++ b/miext/cw/cw_render.c
@@ -371,66 +371,6 @@ cwTriangles (CARD8	    op,
     cwPsWrap(Triangles, cwTriangles);
 }
 
-static void
-cwTriStrip (CARD8	    op,
-	    PicturePtr	    pSrcPicture,
-	    PicturePtr	    pDstPicture,
-	    PictFormatPtr   maskFormat,
-	    INT16	    xSrc,
-	    INT16	    ySrc,
-	    int		    npoint,
-	    xPointFixed    *points)
-{
-    ScreenPtr	pScreen = pDstPicture->pDrawable->pScreen;
-    cwPsDecl(pScreen);
-    cwSrcPictureDecl;
-    cwDstPictureDecl;
-    int i;
-
-    cwPsUnwrap(TriStrip);
-    if (dst_picture_x_off || dst_picture_y_off) {
-	for (i = 0; i < npoint; i++)
-	{
-	    points[i].x += dst_picture_x_off << 16;
-	    points[i].y += dst_picture_y_off << 16;
-	}
-    }
-    (*ps->TriStrip) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat,
-		     xSrc + src_picture_x_off, ySrc + src_picture_y_off,
-		     npoint, points);
-    cwPsWrap(TriStrip, cwTriStrip);
-}
-
-static void
-cwTriFan (CARD8		 op,
-	  PicturePtr	 pSrcPicture,
-	  PicturePtr	 pDstPicture,
-	  PictFormatPtr  maskFormat,
-	  INT16		 xSrc,
-	  INT16		 ySrc,
-	  int		 npoint,
-	  xPointFixed   *points)
-{
-    ScreenPtr	pScreen = pDstPicture->pDrawable->pScreen;
-    cwPsDecl(pScreen);
-    cwSrcPictureDecl;
-    cwDstPictureDecl;
-    int i;
-
-    cwPsUnwrap(TriFan);
-    if (dst_picture_x_off || dst_picture_y_off) {
-	for (i = 0; i < npoint; i++)
-	{
-	    points[i].x += dst_picture_x_off << 16;
-	    points[i].y += dst_picture_y_off << 16;
-	}
-    }
-    (*ps->TriFan) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat,
-		   xSrc + src_picture_x_off, ySrc + src_picture_y_off,
-		   npoint, points);
-    cwPsWrap(TriFan, cwTriFan);
-}
-
 void
 cwInitializeRender (ScreenPtr pScreen)
 {
@@ -443,8 +383,6 @@ cwInitializeRender (ScreenPtr pScreen)
     cwPsWrap(CompositeRects, cwCompositeRects);
     cwPsWrap(Trapezoids, cwTrapezoids);
     cwPsWrap(Triangles, cwTriangles);
-    cwPsWrap(TriStrip, cwTriStrip);
-    cwPsWrap(TriFan, cwTriFan);
     /* There is no need to wrap AddTraps as far as we can tell.  AddTraps can
      * only be done on alpha-only pictures, and we won't be getting
      * alpha-only window pictures, so there's no need to translate.
@@ -463,7 +401,5 @@ cwFiniRender (ScreenPtr pScreen)
     cwPsUnwrap(CompositeRects);
     cwPsUnwrap(Trapezoids);
     cwPsUnwrap(Triangles);
-    cwPsUnwrap(TriStrip);
-    cwPsUnwrap(TriFan);
 }
 
diff --git a/render/mipict.c b/render/mipict.c
index a057840..08b2fa7 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -601,8 +601,6 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
     ps->CompositeRects	= miCompositeRects;
     ps->Trapezoids	= 0;
     ps->Triangles	= 0;
-    ps->TriStrip	= miTriStrip;
-    ps->TriFan		= miTriFan;
     
     ps->RasterizeTrapezoid = 0;			/* requires DDX support */
     ps->AddTraps	= 0;			/* requires DDX support */
diff --git a/render/mipict.h b/render/mipict.h
index a70db24..f6d9dee 100644
--- a/render/mipict.h
+++ b/render/mipict.h
@@ -148,26 +148,6 @@ miPointFixedBounds (int npoint, xPointFixed *points, BoxPtr bounds);
 extern _X_EXPORT void
 miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds);
 
-extern _X_EXPORT void
-miTriStrip (CARD8	    op,
-	    PicturePtr	    pSrc,
-	    PicturePtr	    pDst,
-	    PictFormatPtr   maskFormat,
-	    INT16	    xSrc,
-	    INT16	    ySrc,
-	    int		    npoint,
-	    xPointFixed	    *points);
-
-extern _X_EXPORT void
-miTriFan (CARD8		op,
-	  PicturePtr	pSrc,
-	  PicturePtr	pDst,
-	  PictFormatPtr maskFormat,
-	  INT16		xSrc,
-	  INT16		ySrc,
-	  int		npoint,
-	  xPointFixed	*points);
-
 extern _X_EXPORT Bool
 miInitIndexed (ScreenPtr	pScreen,
 	       PictFormatPtr	pFormat);
diff --git a/render/mitri.c b/render/mitri.c
index 2ca7cc4..b322a7c 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -66,27 +66,3 @@ miTriangleBounds (int ntri, xTriangle *tris, BoxPtr bounds)
 {
     miPointFixedBounds (ntri * 3, (xPointFixed *) tris, bounds);
 }
-
-void
-miTriStrip (CARD8	    op,
-	    PicturePtr	    pSrc,
-	    PicturePtr	    pDst,
-	    PictFormatPtr   maskFormat,
-	    INT16	    xSrc,
-	    INT16	    ySrc,
-	    int		    npoint,
-	    xPointFixed	    *points)
-{
-}
-
-void
-miTriFan (CARD8		op,
-	  PicturePtr	pSrc,
-	  PicturePtr	pDst,
-	  PictFormatPtr	maskFormat,
-	  INT16		xSrc,
-	  INT16		ySrc,
-	  int		npoint,
-	  xPointFixed	*points)
-{
-}
diff --git a/render/picturestr.h b/render/picturestr.h
index ae69eef..7c7edb1 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -381,8 +381,6 @@ typedef struct _PictureScreen {
 
     TrapezoidsProcPtr		Trapezoids;
     TrianglesProcPtr		Triangles;
-    TriStripProcPtr		TriStrip;
-    TriFanProcPtr		TriFan;
 
     RasterizeTrapezoidProcPtr	RasterizeTrapezoid;
 
commit 0eb5b0fbcf1233a93f285ff1e1609fcbd01e7c79
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 8 10:14:27 2011 -0500

    Absorb miTriStrip() into CompositeTriStrip()
    
    There is no need to virtualize this function that nobody cares about.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/render/mitri.c b/render/mitri.c
index c74192c..2ca7cc4 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -77,25 +77,6 @@ miTriStrip (CARD8	    op,
 	    int		    npoint,
 	    xPointFixed	    *points)
 {
-    ScreenPtr		pScreen = pDst->pDrawable->pScreen;
-    PictureScreenPtr    ps = GetPictureScreen(pScreen);
-    xTriangle		*tris, *tri;
-    int			ntri;
-    
-    if (npoint < 3)
-	return;
-    ntri = npoint - 2;
-    tris = malloc(ntri * sizeof (xTriangle));
-    if (!tris)
-	return;
-    for (tri = tris; npoint >= 3; npoint--, points++, tri++)
-    {
-	tri->p1 = points[0];
-	tri->p2 = points[1];
-	tri->p3 = points[2];
-    }
-    (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-    free(tris);
 }
 
 void
diff --git a/render/picture.c b/render/picture.c
index e16163a..015d633 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1773,11 +1773,25 @@ CompositeTriStrip (CARD8	    op,
 		   int		    npoints,
 		   xPointFixed	    *points)
 {
-    PictureScreenPtr	ps = GetPictureScreen(pDst->pDrawable->pScreen);
+    ScreenPtr           pScreen = pDst->pDrawable->pScreen;
+    PictureScreenPtr    ps = GetPictureScreen(pScreen);
+    xTriangle           *tris, *tri;
+    int                 ntri;
     
-    ValidatePicture (pSrc);
-    ValidatePicture (pDst);
-    (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+    if (npoints < 3)
+        return;
+    ntri = npoints - 2;
+    tris = malloc(ntri * sizeof (xTriangle));
+    if (!tris)
+        return;
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+    {
+        tri->p1 = points[0];
+        tri->p2 = points[1];
+        tri->p3 = points[2];
+    }
+    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
 }
 
 void
commit c2af0cea02bd85f4d5954c16e34b4a8fb0fe2243
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Mar 8 10:14:26 2011 -0500

    Absorb miTriFan() into CompositeTriFan()
    
    There is no need to virtualize this function that nobody cares about.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/render/mitri.c b/render/mitri.c
index b258c21..c74192c 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -108,25 +108,4 @@ miTriFan (CARD8		op,
 	  int		npoint,
 	  xPointFixed	*points)
 {
-    ScreenPtr		pScreen = pDst->pDrawable->pScreen;
-    PictureScreenPtr    ps = GetPictureScreen(pScreen);
-    xTriangle		*tris, *tri;
-    xPointFixed		*first;
-    int			ntri;
-    
-    if (npoint < 3)
-	return;
-    ntri = npoint - 2;
-    tris = malloc(ntri * sizeof (xTriangle));
-    if (!tris)
-	return;
-    first = points++;
-    for (tri = tris; npoint >= 3; npoint--, points++, tri++)
-    {
-	tri->p1 = *first;
-	tri->p2 = points[0];
-	tri->p3 = points[1];
-    }
-    (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-    free(tris);
 }
diff --git a/render/picture.c b/render/picture.c
index 0028cc7..e16163a 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1790,11 +1790,26 @@ CompositeTriFan (CARD8		op,
 		 int		npoints,
 		 xPointFixed	*points)
 {
-    PictureScreenPtr	ps = GetPictureScreen(pDst->pDrawable->pScreen);
+    ScreenPtr		pScreen = pDst->pDrawable->pScreen;
+    xTriangle		*tris, *tri;
+    xPointFixed		*first;
+    int			ntri;
     
-    ValidatePicture (pSrc);
-    ValidatePicture (pDst);
-    (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
+    if (npoints < 3)
+	return;
+    ntri = npoints - 2;
+    tris = malloc(ntri * sizeof (xTriangle));
+    if (!tris)
+	return;
+    first = points++;
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+    {
+	tri->p1 = *first;
+	tri->p2 = points[0];
+	tri->p3 = points[1];
+    }
+    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
 }
 
 void
commit a8146f6becc44bf9ad611d33bded17df07e6af21
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Wed Mar 9 17:29:14 2011 +0200

    mi/misprite: use memory management provided by dixRegisterPrivateKey
    
    The record allocated by miSpriteDeviceCursorInitialize was not being
    released.
    
    This patch makes misprite use dixRegisterPrivateKey with the record
    size argument, which handles the memory management
    issues. miSpriteDeviceCursorInitialize is restructured to initialize
    pCursorInfo only if miDCDeviceInitialize succeeds. The record itself
    is zeroed on cleanup to ensure that the assumptions in the code still
    hold.
    
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/misprite.c b/mi/misprite.c
index b0290af..1cfcdf6 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -308,7 +308,7 @@ miSpriteInitialize (ScreenPtr               pScreen,
     if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0))
 	return FALSE;
 
-    if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, 0))
+    if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
 	return FALSE;
 
     pScreenPriv = malloc(sizeof (miSpriteScreenRec));
@@ -860,38 +860,35 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 static Bool
 miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
-    miCursorInfoPtr pCursorInfo;
-    int ret = FALSE;
-
-    pCursorInfo = malloc(sizeof(miCursorInfoRec));
-    if (!pCursorInfo)
-        return FALSE;
-
-    pCursorInfo->pCursor = NULL;
-    pCursorInfo->x = 0;
-    pCursorInfo->y = 0;
-    pCursorInfo->isUp = FALSE;
-    pCursorInfo->shouldBeUp = FALSE;
-    pCursorInfo->pCacheWin = NullWindow;
-    pCursorInfo->isInCacheWin = FALSE;
-    pCursorInfo->checkPixels = TRUE;
-    pCursorInfo->pScreen = FALSE;
+    int ret = miDCDeviceInitialize(pDev, pScreen);
 
-    ret = miDCDeviceInitialize(pDev, pScreen);
-    if (!ret)
+    if (ret)
     {
-        free(pCursorInfo);
-        pCursorInfo = NULL;
+        miCursorInfoPtr pCursorInfo;
+        pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+        pCursorInfo->pCursor = NULL;
+        pCursorInfo->x = 0;
+        pCursorInfo->y = 0;
+        pCursorInfo->isUp = FALSE;
+        pCursorInfo->shouldBeUp = FALSE;
+        pCursorInfo->pCacheWin = NullWindow;
+        pCursorInfo->isInCacheWin = FALSE;
+        pCursorInfo->checkPixels = TRUE;
+        pCursorInfo->pScreen = FALSE;
     }
-    dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, pCursorInfo);
+
     return ret;
 }
 
 static void
 miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
+    miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+
     if (DevHasCursor(pDev))
         miDCDeviceCleanup(pDev, pScreen);
+
+    memset(pCursorInfo, 0, sizeof(miCursorInfoRec));
 }
 
 /*
commit f985a7319ef80b9b613eeaf24581000827cb220f
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Wed Mar 9 17:29:14 2011 +0200

    mi/misprite: use memory management provided by dixRegisterPrivateKey
    
    The record allocated by miSpriteDeviceCursorInitialize was not being
    released.
    
    This patch makes misprite use dixRegisterPrivateKey with the record
    size argument, which handles the memory management issues.
    miSpriteDeviceCursorInitialize is restructured to initialize pCursorInfo
    only if miDCDeviceInitialize succeeds. The record itself is zeroed on
    cleanup to ensure that the assumptions in the code still hold.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

diff --git a/mi/misprite.c b/mi/misprite.c
index b0290af..1cfcdf6 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -308,7 +308,7 @@ miSpriteInitialize (ScreenPtr               pScreen,
     if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0))
 	return FALSE;
 
-    if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, 0))
+    if (!dixRegisterPrivateKey(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
 	return FALSE;
 
     pScreenPriv = malloc(sizeof (miSpriteScreenRec));
@@ -860,38 +860,35 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 static Bool
 miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
-    miCursorInfoPtr pCursorInfo;
-    int ret = FALSE;
-
-    pCursorInfo = malloc(sizeof(miCursorInfoRec));
-    if (!pCursorInfo)
-        return FALSE;
-
-    pCursorInfo->pCursor = NULL;
-    pCursorInfo->x = 0;
-    pCursorInfo->y = 0;
-    pCursorInfo->isUp = FALSE;
-    pCursorInfo->shouldBeUp = FALSE;
-    pCursorInfo->pCacheWin = NullWindow;
-    pCursorInfo->isInCacheWin = FALSE;
-    pCursorInfo->checkPixels = TRUE;
-    pCursorInfo->pScreen = FALSE;
+    int ret = miDCDeviceInitialize(pDev, pScreen);
 
-    ret = miDCDeviceInitialize(pDev, pScreen);
-    if (!ret)
+    if (ret)
     {
-        free(pCursorInfo);
-        pCursorInfo = NULL;
+        miCursorInfoPtr pCursorInfo;
+        pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+        pCursorInfo->pCursor = NULL;
+        pCursorInfo->x = 0;
+        pCursorInfo->y = 0;
+        pCursorInfo->isUp = FALSE;
+        pCursorInfo->shouldBeUp = FALSE;
+        pCursorInfo->pCacheWin = NullWindow;
+        pCursorInfo->isInCacheWin = FALSE;
+        pCursorInfo->checkPixels = TRUE;
+        pCursorInfo->pScreen = FALSE;
     }
-    dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, pCursorInfo);
+
     return ret;
 }
 
 static void
 miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
+    miCursorInfoPtr pCursorInfo = dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
+
     if (DevHasCursor(pDev))
         miDCDeviceCleanup(pDev, pScreen);
+
+    memset(pCursorInfo, 0, sizeof(miCursorInfoRec));
 }
 
 /*
commit 57b35adaed112520c3b3b2fbad13cf5a91cd6652
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Wed Mar 9 13:57:25 2011 -0500

    Remove geometry arguments from miSourceValidate()
    
    The only user of the geometry coordinates is the software sprite code,
    which uses them to remove the pointer whenever the window beneath is
    being used as a source. However, using Window pictures as a source is
    extremely rare (let alone *partial* windows), so there is no harm done
    in just validating all of the drawable.
    
    Additionally, the miSourceValidate() function was buggy in at least
    three respects:
    
    (a) It added drawable->{x,y} before calling down, which is wrong since
        the misprite code already adds them in its check. (Alternatively,
        the misprite code is wrong, but there are actual users who would
        notice if that code was broken).
    
    (b) It didn't account for the width of the interpolation filter, so if
        the Picture had a bilinear or convolution filter, the edges
        surrounding the source area would not be validated.
    
    (c) It didn't validate alpha maps.
    
    Finally, computing the bounding box of the transform on every
    composite request was a real performance issue in pixman, so
    presumably it could be one here as well.
    
    This patch changes miSourceValidate() to simply validate all of the
    underlying drawable.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Soren Sandmann <ssp at redhat.com>

diff --git a/fb/fbpict.c b/fb/fbpict.c
index 312f3df..133f422 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -54,9 +54,9 @@ fbComposite (CARD8      op,
     int msk_xoff, msk_yoff;
     int dst_xoff, dst_yoff;
     
-    miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
+    miCompositeSourceValidate (pSrc);
     if (pMask)
-	miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
+	miCompositeSourceValidate (pMask);
     
     src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
     mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
diff --git a/render/mipict.c b/render/mipict.c
index 3b73888..a057840 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -333,12 +333,8 @@ miClipPictureSrc (RegionPtr	pRegion,
     return TRUE;
 }
 
-void
-miCompositeSourceValidate (PicturePtr	pPicture,
-			   INT16	x,
-			   INT16	y,
-			   CARD16	width,
-			   CARD16	height)
+static void
+SourceValidateOnePicture (PicturePtr pPicture)
 {
     DrawablePtr	pDrawable = pPicture->pDrawable;
     ScreenPtr	pScreen;
@@ -347,50 +343,22 @@ miCompositeSourceValidate (PicturePtr	pPicture,
         return;
 
     pScreen = pDrawable->pScreen;
-    
+
     if (pScreen->SourceValidate)
     {
-	if (pPicture->transform)
-	{
-	    xPoint	    points[4];
-	    int		    i;
-	    int		    xmin, ymin, xmax, ymax;
-
-#define VectorSet(i,_x,_y) { points[i].x = _x; points[i].y = _y; }
-	    VectorSet (0, x, y);
-	    VectorSet (1, x + width, y);
-	    VectorSet (2, x, y + height);
-	    VectorSet (3, x + width, y + height);
-	    xmin = ymin = 32767;
-	    xmax = ymax = -32737;
-	    for (i = 0; i < 4; i++)
-	    {
-		PictVector  t;
-		t.vector[0] = IntToxFixed (points[i].x);
-		t.vector[1] = IntToxFixed (points[i].y);
-		t.vector[2] = xFixed1;
-		if (pixman_transform_point (pPicture->transform, &t))
-		{
-		    int	tx = xFixedToInt (t.vector[0]);
-		    int ty = xFixedToInt (t.vector[1]);
-		    if (tx < xmin) xmin = tx;
-		    if (tx > xmax) xmax = tx;
-		    if (ty < ymin) ymin = ty;
-		    if (ty > ymax) ymax = ty;
-		}
-	    }
-	    x = xmin;
-	    y = ymin;
-	    width = xmax - xmin;
-	    height = ymax - ymin;
-	}
-        x += pPicture->pDrawable->x;
-        y += pPicture->pDrawable->y;
-	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
-				    pPicture->subWindowMode);
+	pScreen->SourceValidate (
+	    pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
     }
 }
 
+void
+miCompositeSourceValidate (PicturePtr pPicture)
+{
+    SourceValidateOnePicture (pPicture);
+    if (pPicture->alphaMap)
+	SourceValidateOnePicture (pPicture->alphaMap);
+}
+
 /*
  * returns FALSE if the final region is empty.  Indistinguishable from
  * an allocation failure, but rendering ignores those anyways.
@@ -480,9 +448,9 @@ miComputeCompositeRegion (RegionPtr	pRegion,
     }
 
     
-    miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
+    miCompositeSourceValidate (pSrc);
     if (pMask)
-	miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+	miCompositeSourceValidate (pMask);
 
     return TRUE;
 }
diff --git a/render/mipict.h b/render/mipict.h
index d149589..a70db24 100644
--- a/render/mipict.h
+++ b/render/mipict.h
@@ -81,11 +81,8 @@ miChangePictureFilter (PicturePtr pPicture,
 		       int	  nparams);
 
 extern _X_EXPORT void
-miCompositeSourceValidate (PicturePtr	pPicture,
-			   INT16	x,
-			   INT16	y,
-			   CARD16	width,
-			   CARD16	height);
+miCompositeSourceValidate (PicturePtr pPicture);
+
 extern _X_EXPORT Bool
 miComputeCompositeRegion (RegionPtr	pRegion,
 			  PicturePtr	pSrc,
commit 016edc17512ba966d60edede8cf947996bae0b3c
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 17:12:26 2011 -0500

    dix: Define RESTYPE as uint32_t
    
    long is needlessly long on LP64.
    
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/resource.h b/include/resource.h
index 763aa99..772b7b8 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -56,7 +56,7 @@ SOFTWARE.
 
 /* classes for Resource routines */
 
-typedef unsigned long RESTYPE;
+typedef uint32_t RESTYPE;
 
 #define RC_VANILLA	((RESTYPE)0)
 #define RC_CACHED	((RESTYPE)1<<31)
commit 1f2bc777f96fd41feb55a4799ece939652130ef4
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 13:11:12 2011 -0500

    dix: Shrink PropertyRec on LP64
    
    size needn't be a long.  No change on ILP32 but, combined with the
    previous change, 56 -> 40 bytes on LP64.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/propertyst.h b/include/propertyst.h
index fd1148e..1edd11d 100644
--- a/include/propertyst.h
+++ b/include/propertyst.h
@@ -58,8 +58,8 @@ typedef struct _Property {
         struct _Property       *next;
 	ATOM 		propertyName;
 	ATOM		type;       /* ignored by server */
-	short		format;     /* format of data for swapping - 8,16,32 */
-	long		size;       /* size of data in (format/8) bytes */
+	uint32_t	format;     /* format of data for swapping - 8,16,32 */
+	uint32_t	size;       /* size of data in (format/8) bytes */
 	pointer         data;       /* private to client */
 	PrivateRec	*devPrivates;
 } PropertyRec;
commit 51f353d0a0d116af16d7d9590cadef6c56328746
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 13:10:20 2011 -0500

    dix: Fix ATOM typedef
    
    unsigned long is needlessly large on LP64.  Use uint32_t instead.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/misc.h b/include/misc.h
index b0abf9a..803f5ba 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -79,6 +79,7 @@ OF THIS SOFTWARE.
 #include <X11/Xdefs.h>
 
 #include <stddef.h>
+#include <stdint.h>
 
 #ifndef MAXSCREENS
 #define MAXSCREENS	16
@@ -91,7 +92,7 @@ OF THIS SOFTWARE.
 #define EXTENSION_EVENT_BASE 64
 #define EXTENSION_BASE 128
 
-typedef unsigned long ATOM;
+typedef uint32_t ATOM;
 
 #ifndef TRUE
 #define TRUE 1
commit 7ca75abbbdd2a1211e52a4f43ac4ed24d3c8ab34
Author: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Wed Mar 9 11:17:28 2011 +1100

    glx: Use PATH_MAX as size of filename buffer
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>

diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index daa955d..9149e0d 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -215,7 +215,7 @@ glxProbeDriver(const char *driverName,
 {
     int i;
     void *driver;
-    char filename[128];
+    char filename[PATH_MAX];
     const __DRIextension **extensions;
 
     snprintf(filename, sizeof filename, "%s/%s_dri.so",
commit d17a9fb8414becf6a8998041df68f209f9222b2b
Author: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Wed Mar 9 11:17:27 2011 +1100

    Consolidate all the PATH_MAX handling into misc.h
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 883c48c..c712df7 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -39,6 +39,7 @@
 #include "xf86Bus.h"
 #include "xf86Sbus.h"
 #endif
+#include "misc.h"
 
 typedef struct _DevToConfig {
     GDevRec GDev;
@@ -514,10 +515,6 @@ configureDDCMonitorSection (int screennum)
     return ptr;
 }
 
-#if !defined(PATH_MAX)
-# define PATH_MAX 1024
-#endif
-
 void
 DoConfigure(void)
 {
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 147a201..24c92fb 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -370,6 +370,9 @@
 
 #include <sys/wait.h>	/* May need to adjust this for other OSs */
 
+/* For PATH_MAX */
+#include "misc.h"
+
 /* 
  * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
  * and it's safe, so just do it.
@@ -390,14 +393,6 @@
 # undef _POSIX_SOURCE
 #endif /* _POSIX_SOURCE */
 
-#if !defined(PATH_MAX)
-# if defined(MAXPATHLEN)
-#  define PATH_MAX MAXPATHLEN
-# else
-#  define PATH_MAX 1024
-# endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
 
 #ifndef DEV_MEM
 #define DEV_MEM "/dev/mem"
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index e4fce30..1cff3bc 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -77,18 +77,13 @@
 #undef _POSIX_SOURCE
 #endif /* _POSIX_SOURCE */
 
-#if !defined(PATH_MAX)
-#if defined(MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif /* MAXPATHLEN */
-#endif /* !PATH_MAX */
-
 #if !defined(MAXHOSTNAMELEN)
 #define MAXHOSTNAMELEN 32
 #endif /* !MAXHOSTNAMELEN */
 
+/* For PATH_MAX */
+#include "misc.h"
+
 #include "Configint.h"
 #include "xf86tokens.h"
 
diff --git a/include/misc.h b/include/misc.h
index 0717db6..b0abf9a 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -178,6 +178,17 @@ typedef struct _xReq *xReqPtr;
 
 #endif
 
+#ifndef PATH_MAX
+#include <sys/param.h>
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+#endif
+
 /**
  * Calculate the number of bytes needed to hold bits.
  * @param bits The minimum number of bits needed.
diff --git a/os/access.c b/os/access.c
index eb1a21d..3856e60 100644
--- a/os/access.c
+++ b/os/access.c
@@ -165,17 +165,6 @@ SOFTWARE.
 
 #endif /* WIN32 */
 
-#ifndef PATH_MAX
-#include <sys/param.h>
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif 
-
 
 #define X_INCLUDE_NETDB_H
 #include <X11/Xos_r.h>
@@ -185,14 +174,6 @@ SOFTWARE.
 
 #include "xace.h"
 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
 Bool defeatAccessControl = FALSE;
 
 #define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len)
diff --git a/os/osinit.c b/os/osinit.c
index 018e404..45d202d 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -63,17 +63,10 @@ SOFTWARE.
 #include <execinfo.h>
 #endif
 
+#include "misc.h"
 
 #include "dixstruct.h"
 
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
 
 #if !defined(SYSV) && !defined(WIN32) 
 #include <sys/resource.h>
diff --git a/os/utils.c b/os/utils.c
index 18fd911..a365aca 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -231,17 +231,6 @@ OsSignal(int sig, OsSigHandlerPtr handler)
 #define LOCK_PREFIX "/.X"
 #define LOCK_SUFFIX "-lock"
 
-#ifndef PATH_MAX
-#include <sys/param.h>
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-#endif
-
 static Bool StillLocking = FALSE;
 static char LockFile[PATH_MAX];
 static Bool nolock = FALSE;
commit 021393d1b8bcc9ff2ff5deb2306360e6b0afa1c6
Author: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Wed Mar 9 11:15:07 2011 +1100

    glx: Factor out glxProbeDriver function.
    
    DRI, DRI2 and swrast all had near-identical driver probing logic.
    Pull it into glxdricommon.
    
    [ajax: warning fix]
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>

diff --git a/glx/glxdri.c b/glx/glxdri.c
index 7717fcf..3a57337 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -858,8 +858,6 @@ static const __DRIextension *loader_extensions[] = {
 
 
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -971,13 +969,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     drm_handle_t  hFB;
     int        junk;
     __GLXDRIscreen *screen;
-    char filename[128];
     Bool isCapable;
     size_t buffer_size;
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     const __DRIconfig **driConfigs;
-    const __DRIextension **extensions;
-    int i;
 
     if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
 	!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@@ -1052,42 +1047,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 	goto handle_error;
     }
 
-    snprintf(filename, sizeof filename, "%s/%s_dri.so",
-             dri_driver_path, driverName);
-
-    screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+    screen->driver = glxProbeDriver(driverName,
+				    (void **)&screen->core,
+				    __DRI_CORE, __DRI_CORE_VERSION,
+				    (void **)&screen->legacy,
+				    __DRI_LEGACY, __DRI_LEGACY_VERSION);
     if (screen->driver == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-		   filename, dlerror());
         goto handle_error;
     }
-
-    extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-    if (extensions == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-		   driverName, dlerror());
-	goto handle_error;
-    }
     
-    for (i = 0; extensions[i]; i++) {
-	if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
-	    extensions[i]->version >= __DRI_CORE_VERSION) {
-		screen->core = (__DRIcoreExtension *) extensions[i];
-	}
-
-	if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0 &&
-	    extensions[i]->version >= __DRI_LEGACY_VERSION) {
-		screen->legacy = (__DRIlegacyExtension *) extensions[i];
-	}
-    }
-
-    if (screen->core == NULL || screen->legacy == NULL) {
-	LogMessage(X_ERROR,
-		   "AIGLX error: %s does not export required DRI extension\n",
-		   driverName);
-	goto handle_error;
-    }
-
     /*
      * Get device-specific info.  pDevPriv will point to a struct
      * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that
@@ -1172,7 +1140,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     pScrn->LeaveVT = glxDRILeaveVT;
 
     LogMessage(X_INFO,
-	       "AIGLX: Loaded and initialized %s\n", filename);
+	       "AIGLX: Loaded and initialized %s\n", driverName);
 
     return &screen->base;
 
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 8d21c93..18927d7 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -599,8 +599,6 @@ static const __DRIextension *loader_extensions[] = {
     NULL
 };
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static Bool
 glxDRIEnterVT (int index, int flags)
 {
@@ -702,12 +700,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 {
     const char *driverName, *deviceName;
     __GLXDRIscreen *screen;
-    char filename[128];
     size_t buffer_size;
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    const __DRIextension **extensions;
     const __DRIconfig **driConfigs;
-    int i;
 
     screen = calloc(1, sizeof *screen);
     if (screen == NULL)
@@ -729,40 +724,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     __glXInitExtensionEnableBits(screen->glx_enable_bits);
 
-    snprintf(filename, sizeof filename,
-	     "%s/%s_dri.so", dri_driver_path, driverName);
-
-    screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+    screen->driver = glxProbeDriver(driverName, (void **)&screen->core, __DRI_CORE, 1,
+				    (void **)&screen->dri2, __DRI_DRI2, 1);
     if (screen->driver == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-		   filename, dlerror());
         goto handle_error;
     }
-
-    extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-    if (extensions == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-		   driverName, dlerror());
-	goto handle_error;
-    }
     
-    for (i = 0; extensions[i]; i++) {
-        if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
-	    extensions[i]->version >= 1) {
-		screen->core = (const __DRIcoreExtension *) extensions[i];
-	}
-        if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 &&
-	    extensions[i]->version >= 1) {
-		screen->dri2 = (const __DRIdri2Extension *) extensions[i];
-	}
-    }
-
-    if (screen->core == NULL || screen->dri2 == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
-		   driverName);
-	goto handle_error;
-    }
-
     screen->driScreen =
 	(*screen->dri2->createNewScreen)(pScreen->myNum,
 					 screen->fd,
@@ -816,7 +783,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     pScrn->LeaveVT = glxDRILeaveVT;
 
     LogMessage(X_INFO,
-	       "AIGLX: Loaded and initialized %s\n", filename);
+	       "AIGLX: Loaded and initialized %s\n", driverName);
 
     return &screen->base;
 
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 86797a0..daa955d 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -29,6 +29,7 @@
 
 #include <stdint.h>
 #include <errno.h>
+#include <dlfcn.h>
 #include <sys/time.h>
 #include <GL/gl.h>
 #include <GL/glxtokens.h>
@@ -204,3 +205,59 @@ glxConvertConfigs(const __DRIcoreExtension *core,
 
     return head.next;
 }
+
+static const char dri_driver_path[] = DRI_DRIVER_PATH;
+
+void *
+glxProbeDriver(const char *driverName,
+	       void **coreExt, const char *coreName, int coreVersion,
+	       void **renderExt, const char *renderName, int renderVersion)
+{
+    int i;
+    void *driver;
+    char filename[128];
+    const __DRIextension **extensions;
+
+    snprintf(filename, sizeof filename, "%s/%s_dri.so",
+             dri_driver_path, driverName);
+
+    driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+    if (driver == NULL) {
+	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
+		   filename, dlerror());
+	goto cleanup_failure;
+    }
+
+    extensions = dlsym(driver, __DRI_DRIVER_EXTENSIONS);
+    if (extensions == NULL) {
+	LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
+		   driverName, dlerror());
+	goto cleanup_failure;
+    }
+
+    for (i = 0; extensions[i]; i++) {
+	if (strcmp(extensions[i]->name, coreName) == 0 &&
+	    extensions[i]->version >= coreVersion) {
+		*coreExt = (void *)extensions[i];
+	}
+
+	if (strcmp(extensions[i]->name, renderName) == 0 &&
+	    extensions[i]->version >= renderVersion) {
+		*renderExt = (void *)extensions[i];
+	}
+    }
+
+    if (*coreExt == NULL || *renderExt == NULL) {
+	LogMessage(X_ERROR,
+		   "AIGLX error: %s does not export required DRI extension\n",
+		   driverName);
+	goto cleanup_failure;
+    }
+    return driver;
+
+cleanup_failure:
+    if (driver)
+	dlclose(driver);
+    *coreExt = *renderExt = NULL;
+    return NULL;
+}
diff --git a/glx/glxdricommon.h b/glx/glxdricommon.h
index 41e2d27..2c55e60 100644
--- a/glx/glxdricommon.h
+++ b/glx/glxdricommon.h
@@ -38,4 +38,9 @@ glxConvertConfigs(const __DRIcoreExtension *core,
 
 extern const __DRIsystemTimeExtension systemTimeExtension;
 
+void *
+glxProbeDriver(const char *name,
+	       void **coreExt, const char *coreName, int coreVersion,
+	       void **renderExt, const char *renderName, int renderVersion);
+
 #endif
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index f88d04f..78b24ff 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -435,17 +435,12 @@ initializeExtensions(__GLXDRIscreen *screen)
     }
 }
 
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
 static __GLXscreen *
 __glXDRIscreenProbe(ScreenPtr pScreen)
 {
     const char *driverName = "swrast";
     __GLXDRIscreen *screen;
-    char filename[128];
-    const __DRIextension **extensions;
     const __DRIconfig **driConfigs;
-    int i;
 
     screen = calloc(1, sizeof *screen);
     if (screen == NULL)
@@ -457,40 +452,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     screen->base.swapInterval   = NULL;
     screen->base.pScreen       = pScreen;
 
-    snprintf(filename, sizeof filename,
-	     "%s/%s_dri.so", dri_driver_path, driverName);
-
-    screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+    screen->driver = glxProbeDriver(driverName,
+				    (void **)&screen->core,
+				    __DRI_CORE, __DRI_CORE_VERSION,
+				    (void **)&screen->swrast,
+				    __DRI_SWRAST, __DRI_SWRAST_VERSION);
     if (screen->driver == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
-		   filename, dlerror());
         goto handle_error;
     }
 
-    extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-    if (extensions == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
-		   driverName, dlerror());
-	goto handle_error;
-    }
-
-    for (i = 0; extensions[i]; i++) {
-        if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
-	    extensions[i]->version >= __DRI_CORE_VERSION) {
-		screen->core = (const __DRIcoreExtension *) extensions[i];
-	}
-        if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0 &&
-	    extensions[i]->version >= __DRI_SWRAST_VERSION) {
-		screen->swrast = (const __DRIswrastExtension *) extensions[i];
-	}
-    }
-
-    if (screen->core == NULL || screen->swrast == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
-		   driverName);
-	goto handle_error;
-    }
-
     screen->driScreen =
 	(*screen->swrast->createNewScreen)(pScreen->myNum,
 					   loader_extensions,
@@ -516,7 +486,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     screen->base.GLXminor = 4;
 
     LogMessage(X_INFO,
-	       "AIGLX: Loaded and initialized %s\n", filename);
+	       "AIGLX: Loaded and initialized %s\n", driverName);
 
     return &screen->base;
 
commit 56c90e29f04727c903bd0f084d23bf44eb1a0a11
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 15 14:29:14 2010 -0500

    randr: Add RRConstrainCursorHarder
    
    Confine cursor motion to within the bounds of a single CRTC, iff all the
    CRTCs within a ScreenRec are reachable from each other.  If not you get
    the same "cursor floats within the bounding rect" behaviour you get now.
    
    v3:
    - Incorporate review feedback from Christopher James Halse Rogers
    v4:
    - Add mode field.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/randr/randr.c b/randr/randr.c
index 6077705..d337129 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -270,6 +270,8 @@ Bool RRScreenInit(ScreenPtr pScreen)
     
     wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen);
 
+    pScreen->ConstrainCursorHarder = RRConstrainCursorHarder;
+
     pScrPriv->numOutputs = 0;
     pScrPriv->outputs = NULL;
     pScrPriv->numCrtcs = 0;
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 7ea6080..d8dd37d 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -297,6 +297,7 @@ typedef struct _rrScrPriv {
     int			    rate;
     int			    size;
 #endif
+    Bool                   discontiguous;
 } rrScrPrivRec, *rrScrPrivPtr;
 
 extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
@@ -700,6 +701,9 @@ ProcRRGetPanning (ClientPtr client);
 int
 ProcRRSetPanning (ClientPtr client);
 
+void
+RRConstrainCursorHarder (DeviceIntPtr, ScreenPtr, int, int *, int *);
+
 /* rrdispatch.c */
 extern _X_EXPORT Bool
 RRClientKnowsRates (ClientPtr	pClient);
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 98206a2..d4d8f2a 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2006 Keith Packard
+ * Copyright 2010 Red Hat, Inc
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -22,6 +23,7 @@
 
 #include "randrstr.h"
 #include "swaprep.h"
+#include "mipointer.h"
 
 RESTYPE	RRCrtcType;
 
@@ -292,6 +294,92 @@ RRCrtcPendingProperties (RRCrtcPtr crtc)
     return FALSE;
 }
 
+static void
+crtc_bounds(RRCrtcPtr crtc, int *left, int *right, int *top, int *bottom)
+{
+    *left = crtc->x;
+    *top = crtc->y;
+
+    switch (crtc->rotation) {
+    case RR_Rotate_0:
+    case RR_Rotate_180:
+    default:
+       *right = crtc->x + crtc->mode->mode.width;
+       *bottom = crtc->y + crtc->mode->mode.height;
+       return;
+    case RR_Rotate_90:
+    case RR_Rotate_270:
+       *right = crtc->x + crtc->mode->mode.height;
+       *bottom = crtc->y + crtc->mode->mode.width;
+       return;
+    }
+}
+
+/* overlapping counts as adjacent */
+static Bool
+crtcs_adjacent(const RRCrtcPtr a, const RRCrtcPtr b)
+{
+    /* left, right, top, bottom... */
+    int al, ar, at, ab;
+    int bl, br, bt, bb;
+    int cl, cr, ct, cb; /* the overlap, if any */
+
+    crtc_bounds(a, &al, &ar, &at, &ab);
+    crtc_bounds(b, &bl, &br, &bt, &bb);
+
+    cl = max(al, bl);
+    cr = min(ar, br);
+    ct = max(at, bt);
+    cb = min(ab, bb);
+
+    return (cl <= cr) && (ct <= cb);
+}
+
+/* Depth-first search and mark all CRTCs reachable from cur */
+static void
+mark_crtcs (rrScrPrivPtr pScrPriv, int *reachable, int cur)
+{
+    int i;
+    reachable[cur] = TRUE;
+    for (i = 0; i < pScrPriv->numCrtcs; ++i) {
+        if (reachable[i] || !pScrPriv->crtcs[i]->mode)
+            continue;
+        if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i]))
+            mark_crtcs(pScrPriv, reachable, i);
+    }
+}
+
+static void
+RRComputeContiguity (ScreenPtr pScreen)
+{
+    rrScrPriv(pScreen);
+    Bool discontiguous = TRUE;
+    int i, n = pScrPriv->numCrtcs;
+
+    int *reachable = calloc(n, sizeof(int));
+    if (!reachable)
+        goto out;
+
+    /* Find first enabled CRTC and start search for reachable CRTCs from it */
+    for (i = 0; i < n; ++i) {
+        if (pScrPriv->crtcs[i]->mode) {
+            mark_crtcs(pScrPriv, reachable, i);
+            break;
+        }
+    }
+
+    /* Check that all enabled CRTCs were marked as reachable */
+    for (i = 0; i < n; ++i)
+        if (pScrPriv->crtcs[i]->mode && !reachable[i])
+            goto out;
+
+    discontiguous = FALSE;
+
+out:
+    free(reachable);
+    pScrPriv->discontiguous = discontiguous;
+}
+
 /*
  * Request that the Crtc be reconfigured
  */
@@ -306,6 +394,7 @@ RRCrtcSet (RRCrtcPtr    crtc,
 {
     ScreenPtr	pScreen = crtc->pScreen;
     Bool	ret = FALSE;
+    Bool	recompute = TRUE;
     rrScrPriv(pScreen);
 
     /* See if nothing changed */
@@ -318,6 +407,7 @@ RRCrtcSet (RRCrtcPtr    crtc,
 	!RRCrtcPendingProperties (crtc) &&
 	!RRCrtcPendingTransform (crtc))
     {
+	recompute = FALSE;
 	ret = TRUE;
     }
     else
@@ -381,6 +471,10 @@ RRCrtcSet (RRCrtcPtr    crtc,
 		RRPostPendingProperties (outputs[o]);
 	}
     }
+
+    if (recompute)
+       RRComputeContiguity(pScreen);
+
     return ret;
 }
 
@@ -1349,3 +1443,64 @@ ProcRRGetCrtcTransform (ClientPtr client)
     free(reply);
     return Success;
 }
+
+void
+RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, int *y)
+{
+    rrScrPriv (pScreen);
+    int i;
+
+    /* intentional dead space -> let it float */
+    if (pScrPriv->discontiguous)
+       return;
+
+    /* if we're moving inside a crtc, we're fine */
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
+       RRCrtcPtr crtc = pScrPriv->crtcs[i];
+
+       int left, right, top, bottom;
+
+       if (!crtc->mode)
+           continue;
+
+       crtc_bounds(crtc, &left, &right, &top, &bottom);
+
+       if ((*x >= left) && (*x <= right) && (*y >= top) && (*y <= bottom))
+           return;
+    }
+
+    /* if we're trying to escape, clamp to the CRTC we're coming from */
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
+       RRCrtcPtr crtc = pScrPriv->crtcs[i];
+       int nx, ny;
+       int left, right, top, bottom;
+
+       if (!crtc->mode)
+           continue;
+
+       crtc_bounds(crtc, &left, &right, &top, &bottom);
+       miPointerGetPosition(pDev, &nx, &ny);
+
+       if ((nx >= left) && (nx <= right) && (ny >= top) && (ny <= bottom)) {
+           if ((*x <= left) || (*x >= right)) {
+               int dx = *x - nx;
+
+               if (dx > 0)
+                   *x = right;
+               else if (dx < 0)
+                   *x = left;
+           }
+
+           if ((*y <= top) || (*y >= bottom)) {
+               int dy = *y - ny;
+
+               if (dy > 0)
+                   *y = bottom;
+               else if (dy < 0)
+                   *y = top;
+           }
+
+           return;
+       }
+    }
+}
commit 810fbfa44626bff9f443ab17c0ad27ff7ae121d7
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Feb 9 17:32:16 2011 -0500

    mi: Call pScreen->ConstrainCursorHarder from the position update path
    
    v2: Cover more paths, spotted by Daniel Stone.
    v3: pass down the mode field for movement mode.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 520583f..c578d0b 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -272,6 +272,9 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
 
     pPointer->generateEvent = generateEvent;
 
+    if (pScreen->ConstrainCursorHarder)
+	pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);
+
     /* device dependent - must pend signal and call miPointerWarpCursor */
     (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
     if (!generateEvent)
@@ -616,6 +619,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
     if (*y >= pPointer->limits.y2)
 	*y = pPointer->limits.y2 - 1;
 
+    if (pScreen->ConstrainCursorHarder)
+       pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y);
+
     if (pPointer->x == *x && pPointer->y == *y && 
             pPointer->pScreen == pScreen) 
         return;
commit 769531b9ccade723a56498b0888af58d085fec9e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 18 14:19:18 2011 +1000

    Add mode field to pointer movement hooks.
    
    Preparation work for pointer barriers.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 5b8e379..cba6163 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -812,7 +812,11 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
  * miPointerSetPosition() and then scale back into device coordinates (if
  * needed). miPSP will change x/y if the screen was crossed.
  *
+ * The coordinates provided are always absolute. The parameter mode whether
+ * it was relative or absolute movement that landed us at those coordinates.
+ *
  * @param dev The device to be moved.
+ * @param mode Movement mode (Absolute or Relative)
  * @param x Pointer to current x-axis value, may be modified.
  * @param y Pointer to current y-axis value, may be modified.
  * @param x_frac Fractional part of current x-axis value, may be modified.
@@ -824,7 +828,8 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
  * @param screeny_frac Fractional part of screen y coordinate, as above.
  */
 static void
-positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
+positionSprite(DeviceIntPtr dev, int mode,
+               int *x, int *y, float x_frac, float y_frac,
                ScreenPtr scr, int *screenx, int *screeny, float *screenx_frac, float *screeny_frac)
 {
     int old_screenx, old_screeny;
@@ -863,7 +868,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
     old_screeny = *screeny;
     /* This takes care of crossing screens for us, as well as clipping
      * to the current screen. */
-    miPointerSetPosition(dev, screenx, screeny);
+    miPointerSetPosition(dev, mode, screenx, screeny);
 
     if(!IsMaster(dev) || !IsFloating(dev)) {
         DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
@@ -1194,7 +1199,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
 
     set_raw_valuators(raw, &mask, raw->valuators.data);
 
-    positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
+    positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
+                   &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
     updateHistory(pDev, &mask, ms);
 
     /* Update the valuators with the true value sent to the client*/
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 209ea06..520583f 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -560,14 +560,18 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen,
  * This function is called during the pointer update path in
  * GetPointerEvents and friends (and the same in the xwin DDX).
  *
+ * The coordinates provided are always absolute. The parameter mode whether
+ * it was relative or absolute movement that landed us at those coordinates.
+ *
  * @param pDev The device to move
+ * @param mode Movement mode (Absolute or Relative)
  * @param[in,out] x The x coordiante in screen coordinates (in regards to total
  * desktop size)
  * @param[in,out] y The y coordiante in screen coordinates (in regards to total
  * desktop size)
  */
 void
-miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
+miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
 {
     miPointerScreenPtr	pScreenPriv;
     ScreenPtr		pScreen;
diff --git a/mi/mipointer.h b/mi/mipointer.h
index 3c86110..539096e 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -133,6 +133,7 @@ extern _X_EXPORT void miPointerGetPosition(
  * x and y are modified in-place. */
 extern _X_EXPORT void miPointerSetPosition(
     DeviceIntPtr pDev,
+    int mode,
     int *x,
     int *y);
 
commit 92788e677be79bd04e5ef140f4ced50ad8b1bf8e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 22 12:32:01 2011 +1000

    test: add some tests for basic list manipulation.
    
    This has less purpose as a test but more as documentation on how to actually
    use the differnent list calls.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/Makefile.am b/test/Makefile.am
index 456221e..be54e5f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,6 @@
 if UNITTESTS
 SUBDIRS= . xi2
-check_PROGRAMS = xkb input xtest
+check_PROGRAMS = xkb input xtest list
 check_LTLIBRARIES = libxservertest.la
 
 TESTS=$(check_PROGRAMS)
@@ -16,6 +16,7 @@ endif
 xkb_LDADD=$(TEST_LDADD)
 input_LDADD=$(TEST_LDADD)
 xtest_LDADD=$(TEST_LDADD)
+list_LDADD=$(TEST_LDADD)
 
 libxservertest_la_LIBADD = \
             $(XSERVER_LIBS) \
diff --git a/test/list.c b/test/list.c
new file mode 100644
index 0000000..a87d2db
--- /dev/null
+++ b/test/list.c
@@ -0,0 +1,176 @@
+/**
+ * Copyright © 2011 Red Hat, Inc.
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice (including the next
+ *  paragraph) shall be included in all copies or substantial portions of the
+ *  Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *  DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/Xlib.h>
+#include <list.h>
+#include <string.h>
+#include <glib.h>
+
+struct parent {
+    int a;
+    struct list children;
+    int b;
+};
+
+struct child {
+    int foo;
+    int bar;
+    struct list node;
+};
+
+static void
+test_list_init(void)
+{
+    struct parent parent, tmp;
+
+    memset(&parent, 0, sizeof(parent));
+    parent.a = 0xa5a5a5;
+    parent.b = ~0xa5a5a5;
+
+    tmp = parent;
+
+    list_init(&parent.children);
+
+    /* test we haven't touched anything else. */
+    g_assert(parent.a == tmp.a);
+    g_assert(parent.b == tmp.b);
+
+    g_assert(list_is_empty(&parent.children));
+}
+
+static void
+test_list_add(void)
+{
+    struct parent parent = {0};
+    struct child child[3];
+    struct child *c;
+
+    list_init(&parent.children);
+
+    list_add(&child[0].node, &parent.children);
+    g_assert(!list_is_empty(&parent.children));
+
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[0], sizeof(struct child)) == 0);
+
+    /* note: list_add prepends */
+    list_add(&child[1].node, &parent.children);
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[1], sizeof(struct child)) == 0);
+
+    list_add(&child[2].node, &parent.children);
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[2], sizeof(struct child)) == 0);
+};
+
+static void
+test_list_del(void)
+{
+    struct parent parent = {0};
+    struct child child[3];
+    struct child *c;
+
+    list_init(&parent.children);
+
+    list_add(&child[0].node, &parent.children);
+    g_assert(!list_is_empty(&parent.children));
+
+    list_del(&parent.children);
+    g_assert(list_is_empty(&parent.children));
+
+    list_add(&child[0].node, &parent.children);
+    list_del(&child[0].node);
+    g_assert(list_is_empty(&parent.children));
+
+    list_add(&child[0].node, &parent.children);
+    list_add(&child[1].node, &parent.children);
+
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[1], sizeof(struct child)) == 0);
+
+    /* delete first node */
+    list_del(&child[1].node);
+    g_assert(!list_is_empty(&parent.children));
+    g_assert(list_is_empty(&child[1].node));
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[0], sizeof(struct child)) == 0);
+
+    /* delete last node */
+    list_add(&child[1].node, &parent.children);
+    list_del(&child[0].node);
+    c = list_first_entry(&parent.children, struct child, node);
+    g_assert(memcmp(c, &child[1], sizeof(struct child)) == 0);
+
+    /* delete list head */
+    list_add(&child[0].node, &parent.children);
+    list_del(&parent.children);
+    g_assert(list_is_empty(&parent.children));
+    g_assert(!list_is_empty(&child[1].node));
+    g_assert(!list_is_empty(&child[2].node));
+}
+
+static void
+test_list_for_each(void)
+{
+    struct parent parent = {0};
+    struct child child[3];
+    struct child *c;
+    int i = 0;
+
+    list_init(&parent.children);
+
+    list_add(&child[2].node, &parent.children);
+    list_add(&child[1].node, &parent.children);
+    list_add(&child[0].node, &parent.children);
+
+    list_for_each_entry(c, &parent.children, node) {
+        g_assert(memcmp(c, &child[i], sizeof(struct child)) == 0);
+        i++;
+    }
+
+    /* foreach on empty list */
+    list_del(&parent.children);
+    g_assert(list_is_empty(&parent.children));
+
+    list_for_each_entry(c, &parent.children, node) {
+        g_assert(0); /* we must not get here */
+    }
+}
+
+
+int main(int argc, char** argv)
+{
+    g_test_init(&argc, &argv,NULL);
+    g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+    g_test_add_func("/list/init", test_list_init);
+    g_test_add_func("/list/add", test_list_add);
+    g_test_add_func("/list/del", test_list_del);
+    g_test_add_func("/list/for_each", test_list_for_each);
+
+    return g_test_run();
+}
commit 1ad9f01c31742157934a791e6141d10520d13e8a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Mar 10 10:47:40 2011 -0500

    glx: Add texbuffer2 support to swrast
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 08ea338..f88d04f 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -201,6 +201,14 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
     if (texBuffer == NULL)
         return Success;
 
+#if __DRI_TEX_BUFFER_VERSION >= 2
+    if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
+	(*texBuffer->setTexBuffer2)(context->driContext,
+				    glxPixmap->target,
+				    glxPixmap->format,
+				    drawable->driDrawable);
+    } else
+#endif
     texBuffer->setTexBuffer(context->driContext,
 			    glxPixmap->target,
 			    drawable->driDrawable);
commit 5fb329a04a18835ce864d0563f6dfeb3d3c78d69
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 9 15:05:26 2011 +1000

    panoramiX: convert 1->panoramiXNumScreens loops to use macro (v2)
    
    This converts all the remaining 1->num loops to the macro,
    this removes nearly all the panoramiXNumScreens usage in
    loops, and is a step to replacing it.
    
    v2: move some from the other patch.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index d10af70..74241d8 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -413,7 +413,7 @@ static void XineramaInitData(ScreenPtr pScreen)
     PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
     PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height;
 
-    for (i = 1; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS_FORWARD_SKIP(i) {
 	pScreen = screenInfo.screens[i];
 	w = pScreen->x + pScreen->width;
 	h = pScreen->y + pScreen->height;
@@ -740,7 +740,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
     int j, k;
     Bool found = FALSE;
 
-    for (j = 1; j < PanoramiXNumScreens; j++) {
+    FOR_NSCREENS_FORWARD_SKIP(j) {
 	pScreen = screenInfo.screens[j];
 	for (k = 0; k < pScreen->numDepths; k++) {
 	    if (pScreen->allowedDepths[k].depth == pDepth->depth) {
@@ -773,7 +773,7 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
     int j, k;
     Bool found = FALSE;
 
-    for (j = 1; j < PanoramiXNumScreens; j++) {
+    FOR_NSCREENS_FORWARD_SKIP(j) {
 	pScreen = screenInfo.screens[j];
 	found = FALSE;
 
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 4eb9a13..9ea4611 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1840,7 +1840,7 @@ int PanoramiXGetImage(ClientPtr client)
     }
 
     drawables[0] = pDraw;
-    for(i = 1; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS_FORWARD_SKIP(i) {
 	rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
 			       DixGetAttrAccess);
 	if (rc != Success)
diff --git a/Xext/shm.c b/Xext/shm.c
index 6294720..b08af82 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -848,7 +848,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
 	return BadAlloc;
 
     drawables[0] = pDraw;
-    for(i = 1; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS_FORWARD_SKIP(i) {
 	rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, 
 			       DixReadAccess);
 	if (rc != Success)
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index beb26a9..b968431 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1918,7 +1918,7 @@ void XineramifyXv(void)
 
       MatchingAdaptors[0] = refAdapt;
       isOverlay = hasOverlay(refAdapt);
-      for(j = 1; j < PanoramiXNumScreens; j++)
+      FOR_NSCREENS_FORWARD_SKIP(j)
 	 MatchingAdaptors[j] = matchAdaptor(screenInfo.screens[j], refAdapt, isOverlay);
 
       /* now create a resource for each port */
diff --git a/dix/events.c b/dix/events.c
index 5151f74..8835c5e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2554,7 +2554,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
 	SpritePtr pSprite = inputInfo.pointer->spriteInfo->sprite;
 	int i;
 
-	for(i = 1; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS_FORWARD_SKIP(i) {
 	   if(RegionContainsPoint(&pSprite->windows[i]->borderSize,
 				  x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
 				  y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
@@ -3153,7 +3153,7 @@ XineramaPointInWindowIsVisible(
     xoff = x + screenInfo.screens[0]->x;
     yoff = y + screenInfo.screens[0]->y;
 
-    for(i = 1; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS_FORWARD_SKIP(i) {
 	pWin = inputInfo.pointer->spriteInfo->sprite->windows[i];
 	x = xoff - screenInfo.screens[i]->x;
 	y = yoff - screenInfo.screens[i]->y;
@@ -3360,7 +3360,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
      if(!noPanoramiXExtension && XineramaSetWindowPntrs(pDev, pWin)) {
 	int i;
 
-	for(i = 1; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS_FORWARD_SKIP(i) {
 	    if(RegionNotEmpty(&pDev->spriteInfo->sprite->windows[i]->borderSize))
 		return TRUE;
 	}
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index bc8cd9e..500e2cd 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -529,7 +529,7 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
 					   NullClient, DixUnknownAccess))
         return NULL;
 
-    for (i = 1; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS_FORWARD_SKIP(i) {
         dmxScreen = &dmxScreens[i];
         if (dmxScreen->beDisplay) {
             PixmapPtr     pSrc;
commit 0bccfcc97b2300b83aa4693454c27ac87f23f221
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 9 15:01:20 2011 +1000

    panoramiX: convert 0->panoramiXNumScreens loops to macro (v3)
    
    This just uses the FOR_NSCREENS macro instead.
    
    v2: remove some of the 1->x loops.
    v3: drop the 1->0 loop, will rework later.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index e6334bd..d10af70 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -393,7 +393,7 @@ static void XineramaInitData(ScreenPtr pScreen)
     int i, w, h;
 
     RegionNull(&PanoramiXScreenRegion);
-    for (i = 0; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS(i) {
 	BoxRec TheBox;
 	RegionRec ScreenRegion;
 
@@ -478,7 +478,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
 	 *	run in non-PanoramiXeen mode.
 	 */
 
-	for (i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	   pScreen = screenInfo.screens[i];
 	   pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
 	   dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
@@ -836,7 +836,7 @@ PanoramiXConsolidate(void)
     saver = malloc(sizeof(PanoramiXRes));
     saver->type = XRT_WINDOW;
 
-    for (i =  0; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS(i) {
 	ScreenPtr pScreen = screenInfo.screens[i];
 	root->info[i].id = pScreen->root->drawable.id;
 	root->u.win.class = InputOutput;
@@ -1074,7 +1074,7 @@ ProcXineramaQueryScreens(ClientPtr client)
 	xXineramaScreenInfo scratch;
 	int i;
 
-	for(i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	    scratch.x_org  = screenInfo.screens[i]->x;
 	    scratch.y_org  = screenInfo.screens[i]->y;
 	    scratch.width  = screenInfo.screens[i]->width;
@@ -1179,7 +1179,7 @@ XineramaGetImageData(
 
     depth = (format == XYPixmap) ? 1 : pDraw->depth;
 
-    for(i = 0; i < PanoramiXNumScreens; i++) {
+    FOR_NSCREENS(i) {
 	BoxRec TheBox;
 	ScreenPtr pScreen;
 	pDraw = pDrawables[i];
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 3e68d0a..4eb9a13 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -2186,7 +2186,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
     newCmap->type = XRT_COLORMAP;
     panoramix_setup_ids(newCmap, client, stuff->mid);
 
-    FOR_NSCREENS_BACKWARD(j){
+    FOR_NSCREENS_BACKWARD(j) {
         stuff->srcCmap = cmap->info[j].id;
 	stuff->mid = newCmap->info[j].id;
         result = (* SavedProcVector[X_CopyColormapAndFree])(client);
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index deddebd..beb26a9 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -1927,7 +1927,7 @@ void XineramifyXv(void)
 	 if(!port)
 	    break;
 
-	 for(k = 0; k < PanoramiXNumScreens; k++) {
+	 FOR_NSCREENS(k) {
 	    if(MatchingAdaptors[k] && (MatchingAdaptors[k]->nPorts > j)) 
 		port->info[k].id = MatchingAdaptors[k]->base_id + j;
 	    else
diff --git a/dix/events.c b/dix/events.c
index df62e83..5151f74 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -558,7 +558,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
 
     if(pWin == screenInfo.screens[0]->root) {
 	int i;
-	for (i = 0; i < PanoramiXNumScreens; i++)
+	FOR_NSCREENS(i)
 	    pSprite->windows[i] = screenInfo.screens[i]->root;
     } else {
 	PanoramiXRes *win;
@@ -569,7 +569,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin)
 	if (rc != Success)
 	    return FALSE;
 
-	for(i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	    rc = dixLookupWindow(pSprite->windows + i, win->info[i].id,
 				 serverClient, DixReadAccess);
 	    if (rc != Success)  /* window is being unmapped */
diff --git a/dix/window.c b/dix/window.c
index 9be7064..3668370 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3067,7 +3067,7 @@ SendVisibilityNotify(WindowPtr pWin)
 
 	switch(visibility) {
 	case VisibilityUnobscured:
-	    for(i = 0; i < PanoramiXNumScreens; i++) {
+	    FOR_NSCREENS(i) {
 		if(i == Scrnum) continue;
 
 		rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient,
@@ -3089,7 +3089,7 @@ SendVisibilityNotify(WindowPtr pWin)
 	    }
 	    break;
 	case VisibilityFullyObscured:
-	    for(i = 0; i < PanoramiXNumScreens; i++) {
+	    FOR_NSCREENS(i) {
 		if(i == Scrnum) continue;
 
 		rc = dixLookupWindow(&pWin2, win->info[i].id, serverClient,
diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c
index 4e7279a..d0eb351 100644
--- a/hw/dmx/dmxcb.c
+++ b/hw/dmx/dmxcb.c
@@ -46,6 +46,7 @@
 extern int     connBlockScreenStart;
 
 #ifdef PANORAMIX
+#include "panoramiXsrv.h"
 extern int     PanoramiXPixWidth;
 extern int     PanoramiXPixHeight;
 extern int     PanoramiXNumScreens;
@@ -137,7 +138,7 @@ void dmxConnectionBlockCallback(void)
         }
         dmxLog(dmxInfo, "%d screens configured with Xinerama (%d %d)\n",
                PanoramiXNumScreens, PanoramiXPixWidth, PanoramiXPixHeight);
-	for (i = 0; i < PanoramiXNumScreens; i++) found[i] = FALSE;
+	FOR_NSCREENS(i) found[i] = FALSE;
     } else {
 #endif
                                 /* This never happens because we're
@@ -177,7 +178,7 @@ void dmxConnectionBlockCallback(void)
 #ifdef PANORAMIX
 	    if (!noPanoramiXExtension) {
 		int  k;
-		for (k = 0; k < PanoramiXNumScreens; k++) {
+		FOR_NSCREENS(k) {
 		    DMXScreenInfo *dmxScreen = &dmxScreens[k];
 
 		    if (dmxScreen->beDisplay) {
@@ -203,7 +204,7 @@ void dmxConnectionBlockCallback(void)
 #ifdef PANORAMIX
     if (!noPanoramiXExtension) {
 	Bool fatal = FALSE;
-	for (i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	    fatal |= !found[i];
 	    if (!found[i]) {
 		dmxLog(dmxError,
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index bd326ce..db5709e 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -703,7 +703,7 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
 				RT_PIXMAP, NullClient, DixUnknownAccess);
 	if (pPix != pDst) return; /* Not a match.... Next! */
 
-	for (i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	    PixmapPtr      pSrc;
 	    dmxPixPrivPtr  pSrcPriv = NULL;
 
@@ -1372,7 +1372,7 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
 				RT_PIXMAP, NullClient, DixUnknownAccess);
 	if (pPix != pDst) return; /* Not a match.... Next! */
 
-	for (i = 0; i < PanoramiXNumScreens; i++) {
+	FOR_NSCREENS(i) {
 	    PixmapPtr      pSrc;
 	    dmxPixPrivPtr  pSrcPriv = NULL;
 
commit 5a94934487ea477947e24dcd4720b7cde77d3d2f
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 9 14:53:26 2011 +1000

    panoramiX: consolidate common id assignment code.
    
    This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first
    element and is a common idiom throughout panoramiX code.
    
    It then adds a new inline function to hide id assignment to a
    panoramiX resource and cleans up lots of common repeated code.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index e4938f5..71651e5 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -44,7 +44,7 @@ Equipment Corporation.
 #include <X11/extensions/panoramiXproto.h>
 #undef _PANORAMIX_SERVER
 #include "gcstruct.h"
-
+#include "dixstruct.h"
 
 typedef struct _PanoramiXInfo {
     XID id ;
@@ -70,6 +70,7 @@ typedef struct {
 } PanoramiXRes;
 
 #define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
+#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++)
 #define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
 #define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
 
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 4ad5489..3e68d0a 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -120,9 +120,7 @@ int PanoramiXCreateWindow(ClientPtr client)
     newWin->u.win.visibility = VisibilityNotViewable;
     newWin->u.win.class = stuff->class;
     newWin->u.win.root = FALSE;
-    newWin->info[0].id = stuff->wid;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-        newWin->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newWin, client, stuff->wid);
 
     if (stuff->class == InputOnly)
 	stuff->visual = CopyFromParent;
@@ -663,9 +661,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
 
     newPix->type = XRT_PIXMAP;
     newPix->u.pix.shared = FALSE;
-    newPix->info[0].id = stuff->pid;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPix->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newPix, client, stuff->pid);
    
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPix->info[j].id;
@@ -767,9 +763,7 @@ int PanoramiXCreateGC(ClientPtr client)
         return BadAlloc;
 
     newGC->type = XRT_GC;
-    newGC->info[0].id = stuff->gc;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-        newGC->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newGC, client, stuff->gc);
 
     FOR_NSCREENS_BACKWARD(j) {
         stuff->gc = newGC->info[j].id;
@@ -2121,9 +2115,7 @@ int PanoramiXCreateColormap(ClientPtr client)
         return BadAlloc;
 
     newCmap->type = XRT_COLORMAP;
-    newCmap->info[0].id = stuff->mid;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-        newCmap->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newCmap, client, stuff->mid);
 
     orig_visual = stuff->visual;
     FOR_NSCREENS_BACKWARD(j){
@@ -2192,9 +2184,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
         return BadAlloc;
 
     newCmap->type = XRT_COLORMAP;
-    newCmap->info[0].id = stuff->mid;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-        newCmap->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newCmap, client, stuff->mid);
 
     FOR_NSCREENS_BACKWARD(j){
         stuff->srcCmap = cmap->info[j].id;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index b0a5a6e..5dd02e8 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -51,4 +51,15 @@ extern _X_EXPORT void XineramaGetImageData(
     Bool isRoot
 );
 
+static inline void panoramix_setup_ids(PanoramiXRes *resource, 
+                                       ClientPtr client, XID base_id)
+{
+    int j;
+
+    resource->info[0].id = base_id;
+    FOR_NSCREENS_FORWARD_SKIP(j) {
+        resource->info[j].id = FakeClientID(client->index);
+    }
+}
+
 #endif /* _PANORAMIXSRV_H_ */
diff --git a/Xext/shm.c b/Xext/shm.c
index 23afe6b..6294720 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -972,9 +972,7 @@ CreatePmap:
 
     newPix->type = XRT_PIXMAP;
     newPix->u.pix.shared = TRUE;
-    newPix->info[0].id = stuff->pid;
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPix->info[j].id = FakeClientID(client->index);
+    panoramix_setup_ids(newPix, client, stuff->pid);
 
     result = Success;
 
diff --git a/composite/compext.c b/composite/compext.c
index fbd36b5..e0d8e75 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -703,10 +703,7 @@ PanoramiXCompositeNameWindowPixmap (ClientPtr client)
 
     newPix->type = XRT_PIXMAP;
     newPix->u.pix.shared = FALSE;
-    newPix->info[0].id = stuff->pixmap;
-
-    for (i = 1; i < PanoramiXNumScreens; i++)
-	newPix->info[i].id = FakeClientID (client->index);
+    panoramix_setup_ids(newPix, client, stuff->pixmap);
 
     FOR_NSCREENS(i) {
 	rc = dixLookupResourceByType ((void **) &pWin, win->info[i].id,
diff --git a/render/render.c b/render/render.c
index 7029558..3cb1b54 100644
--- a/render/render.c
+++ b/render/render.c
@@ -2690,7 +2690,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
     if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
 	return BadAlloc;
     newPict->type = XRT_PICTURE;
-    newPict->info[0].id = stuff->pid;
+    panoramix_setup_ids(newPict, client, stuff->pid);
     
     if (refDraw->type == XRT_WINDOW &&
 	stuff->drawable == screenInfo.screens[0]->root->drawable.id)
@@ -2699,9 +2699,6 @@ PanoramiXRenderCreatePicture (ClientPtr client)
     }
     else
 	newPict->u.pict.root = FALSE;
-
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPict->info[j].id = FakeClientID(client->index);
     
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPict->info[j].id;
@@ -3225,11 +3222,8 @@ PanoramiXRenderCreateSolidFill (ClientPtr client)
 	return BadAlloc;
 
     newPict->type = XRT_PICTURE;
-    newPict->info[0].id = stuff->pid;
+    panoramix_setup_ids(newPict, client, stuff->pid);
     newPict->u.pict.root = FALSE;
-
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPict->info[j].id = FakeClientID(client->index);
 	
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPict->info[j].id;
@@ -3258,12 +3252,9 @@ PanoramiXRenderCreateLinearGradient (ClientPtr client)
 	return BadAlloc;
 
     newPict->type = XRT_PICTURE;
-    newPict->info[0].id = stuff->pid;
+    panoramix_setup_ids(newPict, client, stuff->pid);
     newPict->u.pict.root = FALSE;
 
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPict->info[j].id = FakeClientID(client->index);
-
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPict->info[j].id;
 	result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client);
@@ -3291,12 +3282,9 @@ PanoramiXRenderCreateRadialGradient (ClientPtr client)
 	return BadAlloc;
 
     newPict->type = XRT_PICTURE;
-    newPict->info[0].id = stuff->pid;
+    panoramix_setup_ids(newPict, client, stuff->pid);
     newPict->u.pict.root = FALSE;
 
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPict->info[j].id = FakeClientID(client->index);
-
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPict->info[j].id;
 	result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client);
@@ -3324,12 +3312,9 @@ PanoramiXRenderCreateConicalGradient (ClientPtr client)
 	return BadAlloc;
 
     newPict->type = XRT_PICTURE;
-    newPict->info[0].id = stuff->pid;
+    panoramix_setup_ids(newPict, client, stuff->pid);
     newPict->u.pict.root = FALSE;
 
-    for(j = 1; j < PanoramiXNumScreens; j++)
-	newPict->info[j].id = FakeClientID(client->index);
-
     FOR_NSCREENS_BACKWARD(j) {
 	stuff->pid = newPict->info[j].id;
 	result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client);
commit c48c530e541e201ea1afe2512d85967659ceef84
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 9 15:11:42 2011 +1000

    panoramiX: macro checking if drawable is root (v2)
    
    this code appears in quite a few places, consolidate it into
    a macro in a header.
    
    v2: align braces with macro just above it, and with
    lines removed
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index a8684f0..e4938f5 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -75,4 +75,5 @@ typedef struct {
 
 #define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
 
+#define IS_ROOT_DRAWABLE(d) (((d)->type == XRT_WINDOW) && (d)->u.win.root)
 #endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index d843168..4ad5489 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1334,7 +1334,7 @@ int PanoramiXPolyLine(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
     npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
     if (npoint > 0){
         origPts = malloc(npoint * sizeof(xPoint));
@@ -1394,7 +1394,7 @@ int PanoramiXPolySegment(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
     if(nsegs & 4) return BadLength;
@@ -1457,7 +1457,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
     if(nrects & 4) return BadLength;
@@ -1519,7 +1519,7 @@ int PanoramiXPolyArc(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
     if(narcs % sizeof(xArc)) return BadLength;
@@ -1579,7 +1579,7 @@ int PanoramiXFillPoly(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
     if (count > 0){
@@ -1640,7 +1640,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
     if(things & 4) return BadLength;
@@ -1701,7 +1701,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
     if (narcs % sizeof(xArc)) return BadLength;
@@ -1761,7 +1761,7 @@ int PanoramiXPutImage(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     orig_x = stuff->dstX;
     orig_y = stuff->dstY;
@@ -1824,7 +1824,7 @@ int PanoramiXGetImage(ClientPtr client)
     format = stuff->format;
     planemask = stuff->planeMask;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     if(isRoot) {
       if( /* check for being onscreen */
@@ -1962,7 +1962,7 @@ PanoramiXPolyText8(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     orig_x = stuff->x;
     orig_y = stuff->y;
@@ -2003,7 +2003,7 @@ PanoramiXPolyText16(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     orig_x = stuff->x;
     orig_y = stuff->y;
@@ -2044,7 +2044,7 @@ int PanoramiXImageText8(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     orig_x = stuff->x;
     orig_y = stuff->y;
@@ -2085,7 +2085,7 @@ int PanoramiXImageText16(ClientPtr client)
     if (result != Success)
 	return result;
 
-    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
+    isRoot = IS_ROOT_DRAWABLE(draw);
 
     orig_x = stuff->x;
     orig_y = stuff->y;
commit c3c0e2fdd326214e271ce144e8fc2725cbd738ef
Merge: a19771e... 7355555...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Mar 9 14:25:54 2011 -0800

    Merge remote branch 'whot/for-keith'

commit 73555555a440855f9ae64c3367c5c7dca98c8741
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Mar 8 15:33:13 2011 -0500

    record: warning fix
    
    record.c:810:9: warning: unused variable 'count'
    
    Scope-shadowed by a later variable of the same name, safe to just
    delete.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/record/record.c b/record/record.c
index 1168c43..c59f187 100644
--- a/record/record.c
+++ b/record/record.c
@@ -804,7 +804,6 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
     RecordContextPtr pContext;
     RecordClientsAndProtocolPtr pRCAP;
     int eci; /* enabled context index */
-    int count;
 
     for (eci = 0; eci < numEnabledContexts; eci++)
     {
commit 4d114cc5467a514faa437ce7f4c5e772e2f6a21d
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Mar 8 15:33:12 2011 -0500

    input: warning fixes
    
    eventconvert.c:287:9: warning: enumeration value 'ET_Enter' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_Leave' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_FocusIn' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_FocusOut' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_DeviceChanged' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_Hierarchy' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_DGAEvent' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyPress' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_RawKeyRelease' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonPress' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_RawButtonRelease' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_RawMotion' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_XQuartz' not handled in switch
    eventconvert.c:287:9: warning: enumeration value 'ET_Internal' not handled in switch
    
    From the code it appears these are can't happens, so if they ever do,
    BadImplementation seems entirely appropriate.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 760729b..c9d1994 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -297,6 +297,9 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
             case ET_ProximityOut:
                 *count = 0;
                 return BadMatch;
+	    default:
+		*count = 0;
+		return BadImplementation;
         }
     }
 
commit 7b5e562ea74039832116ee13db910f290f074782
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Mar 8 15:33:11 2011 -0500

    input: warning fix
    
    getevents.c:770:5: warning: suggest parentheses around '&&' within '||'
    
    Introduced with dc57f89959e549403f8488eb9f23425bd7118b22:
    
    -    if(dev->u.master && dev->valuator) {
    +    if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
    
    So I'm assuming the two terms around the || are meant to be a unit.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 1403ccc..441c20f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -767,7 +767,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
     /* if attached, clip both x and y to the defined limits (usually
      * co-ord space limit). If it is attached, we need x/y to go over the
      * limits to be able to change screens. */
-    if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
+    if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) {
         if (valuator_get_mode(dev, 0) == Absolute)
             clipAxis(dev, 0, x);
         if (valuator_get_mode(dev, 1) == Absolute)
commit 33fee13361e745e1db29e250b08622c83046d488
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 8 14:41:21 2011 +1000

    Xi: fix XI2 passive grab reply length calculation
    
    If modifiers failed, the reply length was 4 bytes too short.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 8663d12..3319ef9 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -191,7 +191,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
             info->status = status;
             info->modifiers = *modifiers;
             rep.num_modifiers++;
-            rep.length++;
+            rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
         }
     }
 
@@ -199,7 +199,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
     if (rep.num_modifiers)
     {
 	client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
-        WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed);
+        WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed);
     }
     free(modifiers_failed);
     return ret;
commit eb8141b6edd8b477c0ba796be71e985c35520a9b
Author: Julien Cristau <jcristau at debian.org>
Date:   Mon Mar 7 18:55:19 2011 +0100

    Xi: fix length checks for swapped clients
    
    ChangeDeviceProperty and XIChangeProperty are followed by some data, so
    use REQUEST_AT_LEAST_SIZE instead of REQUEST_SIZE_MATCH.
    
    X.Org bug#35082 <https://bugs.freedesktop.org/show_bug.cgi?id=35082>
    
    Reported-by: Markus Fleschutz <markus.fleschutz at x-software.com>
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 17835e2..83ce930 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -1051,11 +1051,11 @@ SProcXChangeDeviceProperty (ClientPtr client)
     char n;
     REQUEST(xChangeDevicePropertyReq);
 
+    REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
     swaps(&stuff->length, n);
     swapl(&stuff->property, n);
     swapl(&stuff->type, n);
     swapl(&stuff->nUnits, n);
-    REQUEST_SIZE_MATCH(xChangeDevicePropertyReq);
     return (ProcXChangeDeviceProperty(client));
 }
 
@@ -1295,12 +1295,12 @@ SProcXIChangeProperty(ClientPtr client)
     char n;
     REQUEST(xXIChangePropertyReq);
 
+    REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
     swaps(&stuff->length, n);
     swaps(&stuff->deviceid, n);
     swapl(&stuff->property, n);
     swapl(&stuff->type, n);
     swapl(&stuff->num_items, n);
-    REQUEST_SIZE_MATCH(xXIChangePropertyReq);
     return (ProcXIChangeProperty(client));
 }
 
commit 4114533db6704324fc26f28a444415e325ace8e0
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:33 2011 +0200

    config: Ensure that stolen option list elements are released.
    
    NewInputDeviceRequest steals the contents of option list elements but
    doesn't use the elements themselves for anything. Therefore the list
    elements need to be released always.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/config/hal.c b/config/hal.c
index 0b848a0..297520a 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -392,10 +392,10 @@ unwind:
     free(driver);
     free(name);
     free(config_info);
-    while (!dev && (tmpo = options)) {
+    while ((tmpo = options)) {
         options = tmpo->next;
-        free(tmpo->key);
-        free(tmpo->value);
+        free(tmpo->key);        /* NULL if dev != NULL */
+        free(tmpo->value);      /* NULL if dev != NULL */
         free(tmpo);
     }
 
diff --git a/config/udev.c b/config/udev.c
index ab27c98..678e47a 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -197,10 +197,10 @@ device_added(struct udev_device *udev_device)
 
  unwind:
     free(config_info);
-    while (!dev && (tmpo = options)) {
+    while ((tmpo = options)) {
         options = tmpo->next;
-        free(tmpo->key);
-        free(tmpo->value);
+        free(tmpo->key);        /* NULL if dev != NULL */
+        free(tmpo->value);      /* NULL if dev != NULL */
         free(tmpo);
     }
 
commit 8d30aff4aa708b9b885d492602ced7493a96a4df
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:32 2011 +0200

    dix: Release input device config info when the device disconnects.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index b8d8e7b..f1ba31e 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -938,6 +938,8 @@ CloseDevice(DeviceIntPtr dev)
     }
 
     free(dev->deviceGrab.sync.event);
+    free(dev->config_info);     /* Allocated in xf86ActivateDevice. */
+    dev->config_info = NULL;
     dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
 }
 
commit 40e56d34538f4663426db50893c231a2b5d760dc
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:31 2011 +0200

    xkb: Ensure that XKB device private won't leak on device disconnect.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 65c678a..c4336d7 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -68,20 +68,13 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
 Bool
 XkbInitPrivates(void)
 {
-    return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, 0);
+    return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec));
 }
 
 void
 XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
 {
-    xkbDeviceInfoPtr xkbPrivPtr;
-
-    xkbPrivPtr = (xkbDeviceInfoPtr) calloc(1, sizeof(xkbDeviceInfoRec));
-    if (!xkbPrivPtr)
-	return;
-    xkbPrivPtr->unwrapProc = NULL;
-
-    dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr);
+    xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
     WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc);
 }
 
commit 18413f55089623123537c1499b02aa95ca2014d2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Mar 3 14:15:55 2011 +1000

    xfree86: block signals between EnableDevice and first CheckMotion()
    
    Devices usually enable SIGIO processing in EnableDevice. CheckMotion
    initialises the pointer sprite, sends Enter/Leave events, etc. This leaves
    us with a small window where events may be processed without the sprite or
    pointer position (as seen from the protocol) is valid.
    Block signals during this window.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 74365e1..e3264e6 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -817,15 +817,18 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
     /* Enable it if it's properly initialised and we're currently in the VT */
     if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
     {
+        OsBlockSignals();
         EnableDevice(dev, TRUE);
         if (!dev->enabled)
         {
+            OsReleaseSignals();
             xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
             rval = BadMatch;
             goto unwind;
         }
         /* send enter/leave event, update sprite window */
         CheckMotion(NULL, dev);
+        OsReleaseSignals();
     }
 
     *pdev = dev;
commit a19771e4337d1c4600550314bbc42a1495a023ff
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Tue Mar 8 13:29:41 2011 -0500

    xfree86/common: Remove a configScreen leak when conf_screen is NULL
    
    configScreen used a dynamically allocated buffer for XF86ConfScreenRec
    when conf_screen argument was NULL. This pointer was never stored
    anywhere, nor was it released, so this patch makes the function use
    automatically allocated storage in that situation.
    
    [ajax: minor grammar fix]
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 9602e89..5312ca6 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1787,9 +1787,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
     XF86ConfDisplayPtr dispptr;
     XF86ConfAdaptorLinkPtr conf_adaptor;
     Bool defaultMonitor = FALSE;
+    XF86ConfScreenRec local_conf_screen;
 
     if (!conf_screen) {
-        conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+        memset(&local_conf_screen, 0, sizeof(local_conf_screen));
+        conf_screen = &local_conf_screen;
         conf_screen->scrn_identifier = "Default Screen Section";
         xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
     }
commit b73ebe65cd071a063417ac9c38513a6742e32428
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 12:12:35 2011 -0500

    glx: Remove unused _glapi_get_proc_name
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index fde5d76..209ae50 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -426,26 +426,6 @@ get_static_proc_address(const char *funcName)
 
 #endif /* !defined(XFree86Server) && !defined(XGLServer) */
 
-
-
-/**
- * Return the name of the function at the given offset in the dispatch
- * table.  For debugging only.
- */
-static const char *
-get_static_proc_name( GLuint offset )
-{
-   GLuint i;
-   for (i = 0; static_functions[i].Name_offset >= 0; i++) {
-      if (static_functions[i].Offset == offset) {
-	 return gl_string_table + static_functions[i].Name_offset;
-      }
-   }
-   return NULL;
-}
-
-
-
 /**********************************************************************
  * Extension function management.
  */
@@ -860,35 +840,6 @@ _glapi_get_proc_address(const char *funcName)
    return (entry == NULL) ? NULL : entry->dispatch_stub;
 }
 
-
-
-/**
- * Return the name of the function at the given dispatch offset.
- * This is only intended for debugging.
- */
-const char *
-_glapi_get_proc_name(GLuint offset)
-{
-   GLuint i;
-   const char * n;
-
-   /* search built-in functions */
-   n = get_static_proc_name(offset);
-   if ( n != NULL ) {
-      return n;
-   }
-
-   /* search added extension functions */
-   for (i = 0; i < NumExtEntryPoints; i++) {
-      if (ExtEntryTable[i].dispatch_offset == offset) {
-         return ExtEntryTable[i].name;
-      }
-   }
-   return NULL;
-}
-
-
-
 /**
  * Return size of dispatch table struct as number of functions (or
  * slots).
diff --git a/glx/glapi.h b/glx/glapi.h
index 9911e50..80b53aa 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -146,7 +146,4 @@ _glapi_add_dispatch( const char * const * function_names,
 extern _glapi_proc
 _glapi_get_proc_address(const char *funcName);
 
-extern const char *
-_glapi_get_proc_name(GLuint offset);
-
 #endif
commit 4377288abdbaac8506d8643b440c300ba03182fe
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:52:27 2011 -0500

    glx: Simplify _glapi_check_multithread
    
    We can guarantee that the X server does not call DRI driver services
    from multiple threads, so _glapi_check_multithread need never do
    anything special.  As a result, ThreadSafe is always false, so remove it
    and simplify expressions where it appeared to match.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index 42bf6c1..fde5d76 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -175,12 +175,6 @@ static GLint NoOpUnused(void)
  * static dispatch functions access these variables via \c _glapi_get_dispatch
  * and \c _glapi_get_context.
  *
- * There is a race condition in setting \c _glapi_Dispatch to \c NULL.  It is
- * possible for the original thread to be setting it at the same instant a new
- * thread, perhaps running on a different processor, is clearing it.  Because
- * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is
- * used to determine whether or not the application is multithreaded.
- * 
  * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are
  * hardcoded to \c NULL.  Instead the TLS variables \c _glapi_tls_Dispatch and
  * \c _glapi_tls_Context are used.  Having \c _glapi_Dispatch and
@@ -204,7 +198,6 @@ PUBLIC const void *_glapi_Context = NULL;
 
 #if defined(THREADS)
 
-static GLboolean ThreadSafe = GL_FALSE;  /**< In thread-safe mode? */
 _glthread_TSD _gl_DispatchTSD;           /**< Per-thread dispatch pointer */
 static _glthread_TSD ContextTSD;         /**< Per-thread context pointer */
 
@@ -243,37 +236,14 @@ str_dup(const char *str)
 }
 
 
-
-/**
- * We should call this periodically from a function such as glXMakeCurrent
- * in order to test if multiple threads are being used.
+/*
+ * xserver's gl is not multithreaded, we promise.
  */
 PUBLIC void
 _glapi_check_multithread(void)
 {
-#if defined(THREADS) && !defined(GLX_USE_TLS)
-   if (!ThreadSafe) {
-      static unsigned long knownID;
-      static GLboolean firstCall = GL_TRUE;
-      if (firstCall) {
-         knownID = _glthread_GetID();
-         firstCall = GL_FALSE;
-      }
-      else if (knownID != _glthread_GetID()) {
-         ThreadSafe = GL_TRUE;
-         _glapi_set_dispatch(NULL);
-         _glapi_set_context(NULL);
-      }
-   }
-   else if (!_glapi_get_dispatch()) {
-      /* make sure that this thread's dispatch pointer isn't null */
-      _glapi_set_dispatch(NULL);
-   }
-#endif
 }
 
-
-
 /**
  * Set the current context pointer for this thread.
  * The context pointer is an opaque type which should be cast to
@@ -287,7 +257,7 @@ _glapi_set_context(void *context)
    _glapi_tls_Context = context;
 #elif defined(THREADS)
    _glthread_SetTSD(&ContextTSD, context);
-   _glapi_Context = (ThreadSafe) ? NULL : context;
+   _glapi_Context = context;
 #else
    _glapi_Context = context;
 #endif
@@ -305,13 +275,6 @@ _glapi_get_context(void)
 {
 #if defined(GLX_USE_TLS)
    return _glapi_tls_Context;
-#elif defined(THREADS)
-   if (ThreadSafe) {
-      return _glthread_GetTSD(&ContextTSD);
-   }
-   else {
-      return _glapi_Context;
-   }
 #else
    return _glapi_Context;
 #endif
@@ -341,7 +304,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
    _glapi_tls_Dispatch = dispatch;
 #elif defined(THREADS)
    _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch);
-   _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch;
+   _glapi_Dispatch = dispatch;
 #else /*THREADS*/
    _glapi_Dispatch = dispatch;
 #endif /*THREADS*/
@@ -358,10 +321,6 @@ _glapi_get_dispatch(void)
    struct _glapi_table * api;
 #if defined(GLX_USE_TLS)
    api = _glapi_tls_Dispatch;
-#elif defined(THREADS)
-   api = (ThreadSafe)
-     ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD)
-     : _glapi_Dispatch;
 #else
    api = _glapi_Dispatch;
 #endif
commit d5e8bb2150ce9d8a4132d61f76621a2c7a7f0acf
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:26:05 2011 -0500

    glx: unifdef BEOS_THREADS
    
    We don't support BeOS, so, no.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index a2d95b5..5da7e43 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,49 +179,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-/*
- * BeOS threads
- */
-#ifdef BEOS_THREADS
-
-unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) find_thread(NULL);
-}
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   tsd->key = tls_allocate();
-   tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   return tls_get(tsd->key);
-}
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != (int) INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   tls_set(tsd->key, ptr);
-}
-
-#endif /* BEOS_THREADS */
-
-
-
 #else  /* THREADS */
 
-
 /*
  * no-op functions
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index 782a2a3..28793fc 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,7 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
+#if (defined(PTHREADS) || defined(WIN32_THREADS)) \
     && !defined(THREADS)
 # define THREADS
 #endif
commit 3692ff0b35e774a6f6cbedf634d53c4df2e53a24
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:22:45 2011 -0500

    glx: unifdef USE_XTHREADS
    
    xthreads is an ancient wrapper around a half dozen or so common thread
    APIs, including pthreads.  Just use pthreads directly if you have it; if
    you don't, get with the times.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index 2d76a49..a2d95b5 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -179,57 +179,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* WIN32_THREADS */
 
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   return (unsigned long) xthread_self();
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if (xthread_key_create(&tsd->key, NULL) != 0) {
-      perror(INIT_TSD_ERROR);
-      exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void *ptr;
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   xthread_get_specific(tsd->key, &ptr);
-   return ptr;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   xthread_set_specific(tsd->key, ptr);
-}
-
-#endif /* XTHREAD */
-
-
-
 /*
  * BeOS threads
  */
diff --git a/glx/glthread.h b/glx/glthread.h
index e7e2385..782a2a3 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,8 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-#if (defined(PTHREADS) || \
-     defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
+#if (defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)) \
     && !defined(THREADS)
 # define THREADS
 #endif
@@ -154,49 +153,6 @@ typedef CRITICAL_SECTION _glthread_Mutex;
 
 #endif /* WIN32_THREADS */
 
-
-
-
-/*
- * XFree86 has its own thread wrapper, Xthreads.h
- * We wrap it again for GL.
- */
-#ifdef USE_XTHREADS
-#include <X11/Xthreads.h>
-
-typedef struct {
-   xthread_key_t key;
-   int initMagic;
-} _glthread_TSD;
-
-typedef xthread_t _glthread_Thread;
-
-typedef xmutex_rec _glthread_Mutex;
-
-#ifdef XMUTEX_INITIALIZER
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name = XMUTEX_INITIALIZER
-#else
-#define _glthread_DECLARE_STATIC_MUTEX(name) \
-   static _glthread_Mutex name
-#endif
-
-#define _glthread_INIT_MUTEX(name) \
-   xmutex_init(&(name))
-
-#define _glthread_DESTROY_MUTEX(name) \
-   xmutex_clear(&(name))
-
-#define _glthread_LOCK_MUTEX(name) \
-   (void) xmutex_lock(&(name))
-
-#define _glthread_UNLOCK_MUTEX(name) \
-   (void) xmutex_unlock(&(name))
-
-#endif /* USE_XTHREADS */
-
-
-
 /*
  * BeOS threads. R5.x required.
  */
commit 2371b44f9eb9181ec2c081ce66befee51d18bf6e
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 11:17:07 2011 -0500

    glx: unifdef SOLARIS_THREADS
    
    Solaris 7 and older are not supported; Solaris 8 and later have (and
    use) pthreads.
    
    Acked-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glthread.c b/glx/glthread.c
index 8b9f618..2d76a49 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -114,76 +114,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 
 #endif /* PTHREADS */
 
-
-
-/*
- * Solaris/Unix International Threads -- Use only if POSIX threads
- *   aren't available on your Unix platform.  Solaris 2.[34] are examples
- *   of platforms where this is the case.  Be sure to use -mt and/or
- *   -D_REENTRANT when compiling.
- */
-#ifdef SOLARIS_THREADS
-#define USE_LOCK_FOR_KEY	/* undef this to try a version without
-				   lock for the global key... */
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
-   OsAbort();   /* XXX not implemented yet */
-   return (unsigned long) 0;
-}
-
-
-void
-_glthread_InitTSD(_glthread_TSD *tsd)
-{
-   if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 ||
-      (errno = thr_keycreate(&(tsd->key), free)) != 0) {
-      perror(INIT_TSD_ERROR);
-      exit(-1);
-   }
-   tsd->initMagic = INIT_MAGIC;
-}
-
-
-void *
-_glthread_GetTSD(_glthread_TSD *tsd)
-{
-   void* ret;
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-#ifdef USE_LOCK_FOR_KEY
-   mutex_lock(&tsd->keylock);
-   thr_getspecific(tsd->key, &ret);
-   mutex_unlock(&tsd->keylock);
-#else
-   if ((errno = thr_getspecific(tsd->key, &ret)) != 0) {
-      perror(GET_TSD_ERROR);
-      exit(-1);
-   }
-#endif
-   return ret;
-}
-
-
-void
-_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
-{
-   if (tsd->initMagic != INIT_MAGIC) {
-      _glthread_InitTSD(tsd);
-   }
-   if ((errno = thr_setspecific(tsd->key, ptr)) != 0) {
-      perror(SET_TSD_ERROR);
-      exit(-1);
-   }
-}
-
-#undef USE_LOCK_FOR_KEY
-#endif /* SOLARIS_THREADS */
-
-
-
 /*
  * Win32 Threads.  The only available option for Windows 95/NT.
  * Be sure that you compile using the Multithreaded runtime, otherwise
diff --git a/glx/glthread.h b/glx/glthread.h
index e2765ce..e7e2385 100644
--- a/glx/glthread.h
+++ b/glx/glthread.h
@@ -68,9 +68,7 @@
 #define _glapi_Dispatch _mglapi_Dispatch
 #endif
 
-
-
-#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
+#if (defined(PTHREADS) || \
      defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
     && !defined(THREADS)
 # define THREADS
@@ -127,27 +125,6 @@ typedef pthread_mutex_t _glthread_Mutex;
  * Be sure to compile with -mt on the Solaris compilers, or
  * use -D_REENTRANT if using gcc.
  */
-#ifdef SOLARIS_THREADS
-#include <thread.h>
-
-typedef struct {
-   thread_key_t key;
-   mutex_t      keylock;
-   int          initMagic;
-} _glthread_TSD;
-
-typedef thread_t _glthread_Thread;
-
-typedef mutex_t _glthread_Mutex;
-
-/* XXX need to really implement mutex-related macros */
-#define _glthread_DECLARE_STATIC_MUTEX(name)  static _glthread_Mutex name = 0
-#define _glthread_INIT_MUTEX(name)  (void) name
-#define _glthread_DESTROY_MUTEX(name) (void) name
-#define _glthread_LOCK_MUTEX(name)  (void) name
-#define _glthread_UNLOCK_MUTEX(name)  (void) name
-
-#endif /* SOLARIS_THREADS */
 
 
 
commit a5fdd1aa06c7c8ecefeafafc4a778fc816ad41a4
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Mar 2 10:20:02 2011 -0500

    glx: Remove unused _glapi_get_proc_offset and friends
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index d6a568e..42bf6c1 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -336,11 +336,6 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
       /* use the no-op functions */
       dispatch = (struct _glapi_table *) __glapi_noop_table;
    }
-#ifdef DEBUG
-   else {
-      _glapi_check_table(dispatch);
-   }
-#endif
 
 #if defined(GLX_USE_TLS)
    _glapi_tls_Dispatch = dispatch;
@@ -867,26 +862,6 @@ _glapi_add_dispatch( const char * const * function_names,
    return offset;
 }
 
-
-/**
- * Return offset of entrypoint for named function within dispatch table.
- */
-PUBLIC GLint
-_glapi_get_proc_offset(const char *funcName)
-{
-   /* search extension functions first */
-   GLuint i;
-   for (i = 0; i < NumExtEntryPoints; i++) {
-      if (strcmp(ExtEntryTable[i].name, funcName) == 0) {
-         return ExtEntryTable[i].dispatch_offset;
-      }
-   }
-   /* search static functions */
-   return get_static_proc_offset(funcName);
-}
-
-
-
 /**
  * Return pointer to the named function.  If the function name isn't found
  * in the name of static functions, try generating a new API entrypoint on
@@ -965,88 +940,6 @@ _glapi_get_dispatch_table_size(void)
    return DISPATCH_TABLE_SIZE;
 }
 
-
-
-/**
- * Make sure there are no NULL pointers in the given dispatch table.
- * Intended for debugging purposes.
- */
-void
-_glapi_check_table(const struct _glapi_table *table)
-{
-#ifdef DEBUG
-   const GLuint entries = _glapi_get_dispatch_table_size();
-   const void **tab = (const void **) table;
-   GLuint i;
-   for (i = 1; i < entries; i++) {
-      assert(tab[i]);
-   }
-
-   /* Do some spot checks to be sure that the dispatch table
-    * slots are assigned correctly.
-    */
-   {
-      GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
-      char *BeginFunc = (char*) &table->Begin;
-      GLuint offset = (BeginFunc - (char *) table) / sizeof(void *);
-      assert(BeginOffset == _gloffset_Begin);
-      assert(BeginOffset == offset);
-   }
-   {
-      GLuint viewportOffset = _glapi_get_proc_offset("glViewport");
-      char *viewportFunc = (char*) &table->Viewport;
-      GLuint offset = (viewportFunc - (char *) table) / sizeof(void *);
-      assert(viewportOffset == _gloffset_Viewport);
-      assert(viewportOffset == offset);
-   }
-   {
-      GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer");
-      char *VertexPointerFunc = (char*) &table->VertexPointer;
-      GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *);
-      assert(VertexPointerOffset == _gloffset_VertexPointer);
-      assert(VertexPointerOffset == offset);
-   }
-   {
-      GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax");
-      char *ResetMinMaxFunc = (char*) &table->ResetMinmax;
-      GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *);
-      assert(ResetMinMaxOffset == _gloffset_ResetMinmax);
-      assert(ResetMinMaxOffset == offset);
-   }
-   {
-      GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor");
-      char *blendColorFunc = (char*) &table->BlendColor;
-      GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *);
-      assert(blendColorOffset == _gloffset_BlendColor);
-      assert(blendColorOffset == offset);
-   }
-   {
-      GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT");
-      char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT;
-      GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *);
-      assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT);
-      assert(secondaryColor3fOffset == offset);
-   }
-   {
-      GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV");
-      char *pointParameterivFunc = (char*) &table->PointParameterivNV;
-      GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
-      assert(pointParameterivOffset == _gloffset_PointParameterivNV);
-      assert(pointParameterivOffset == offset);
-   }
-   {
-      GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
-      char *setFenceFunc = (char*) &table->SetFenceNV;
-      GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
-      assert(setFenceOffset == _gloffset_SetFenceNV);
-      assert(setFenceOffset == offset);
-   }
-#else
-   (void) table;
-#endif
-}
-
-
 #if defined(PTHREADS) || defined(GLX_USE_TLS)
 /**
  * Perform platform-specific GL API entry-point fixups.
diff --git a/glx/glapi.h b/glx/glapi.h
index 8f2cf66..9911e50 100644
--- a/glx/glapi.h
+++ b/glx/glapi.h
@@ -115,57 +115,38 @@ _glapi_set_warning_func(_glapi_warning_func func);
 extern void
 _glapi_check_multithread(void);
 
-
 extern void
 _glapi_set_context(void *context);
 
-
 extern void *
 _glapi_get_context(void);
 
-
 extern void
 _glapi_set_dispatch(struct _glapi_table *dispatch);
 
-
 extern struct _glapi_table *
 _glapi_get_dispatch(void);
 
-
 extern int
 _glapi_begin_dispatch_override(struct _glapi_table *override);
 
-
 extern void
 _glapi_end_dispatch_override(int layer);
 
-
 struct _glapi_table *
 _glapi_get_override_dispatch(int layer);
 
-
 extern GLuint
 _glapi_get_dispatch_table_size(void);
 
-
-extern void
-_glapi_check_table(const struct _glapi_table *table);
-
-
 extern int
 _glapi_add_dispatch( const char * const * function_names,
 		     const char * parameter_signature );
 
-extern GLint
-_glapi_get_proc_offset(const char *funcName);
-
-
 extern _glapi_proc
 _glapi_get_proc_address(const char *funcName);
 
-
 extern const char *
 _glapi_get_proc_name(GLuint offset);
 
-
 #endif
commit 2cb3dc020cbec1ba64848dac532b3bb2d84d0635
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 17:11:35 2011 -0500

    xi: Use RESTYPE consistently
    
    No functional change
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index f755707..8c5a42e 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -76,7 +76,7 @@ extern int ChangeDeviceNotify;
 extern int DevicePresenceNotify;
 extern int DevicePropertyNotify;
 
-extern int RT_INPUTCLIENT;
+extern RESTYPE RT_INPUTCLIENT;
 
 extern DevPrivateKeyRec XIClientPrivateKeyRec;
 #define XIClientPrivateKey (&XIClientPrivateKeyRec)
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 82df7eb..46d3459 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -358,7 +358,7 @@ int ChangeDeviceNotify;
 int DevicePresenceNotify;
 int DevicePropertyNotify;
 
-int RT_INPUTCLIENT;
+RESTYPE RT_INPUTCLIENT;
 
 /*****************************************************************
  *
commit 2413702aa0b488f1a4f828a017d5b508c4f219f1
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:54:17 2011 -0500

    xvmc: Use RESTYPE consistently
    
    Also mark these static since they're not used externally.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 8fbdfae..4d29941 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -42,9 +42,9 @@ unsigned long XvMCGeneration = 0;
 int XvMCReqCode;
 int XvMCEventBase;
 
-unsigned long XvMCRTContext;
-unsigned long XvMCRTSurface;
-unsigned long XvMCRTSubpicture;
+static RESTYPE XvMCRTContext;
+static RESTYPE XvMCRTSurface;
+static RESTYPE XvMCRTSubpicture;
 
 typedef struct {
    int num_adaptors;
commit cd58924d294de2abddbd2f03c2db021894fe9759
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:28:26 2011 -0500

    xinerama: Use RESTYPE consistently
    
    No functional change
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index e6334bd..391346a 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -83,11 +83,11 @@ static DepthPtr		PanoramiXDepths;
 static int		PanoramiXNumVisuals;
 static VisualPtr	PanoramiXVisuals;
 
-unsigned long XRC_DRAWABLE;
-unsigned long XRT_WINDOW;
-unsigned long XRT_PIXMAP;
-unsigned long XRT_GC;
-unsigned long XRT_COLORMAP;
+RESTYPE XRC_DRAWABLE;
+RESTYPE XRT_WINDOW;
+RESTYPE XRT_PIXMAP;
+RESTYPE XRT_GC;
+RESTYPE XRT_COLORMAP;
 
 static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
 XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index b0a5a6e..9751feb 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -21,12 +21,12 @@ extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
 
 extern _X_EXPORT void XineramaReinitData(ScreenPtr);
 
-extern _X_EXPORT unsigned long XRC_DRAWABLE;
-extern _X_EXPORT unsigned long XRT_WINDOW;
-extern _X_EXPORT unsigned long XRT_PIXMAP;
-extern _X_EXPORT unsigned long XRT_GC;
-extern _X_EXPORT unsigned long XRT_COLORMAP;
-extern _X_EXPORT unsigned long XRT_PICTURE;
+extern _X_EXPORT RESTYPE XRC_DRAWABLE;
+extern _X_EXPORT RESTYPE XRT_WINDOW;
+extern _X_EXPORT RESTYPE XRT_PIXMAP;
+extern _X_EXPORT RESTYPE XRT_GC;
+extern _X_EXPORT RESTYPE XRT_COLORMAP;
+extern _X_EXPORT RESTYPE XRT_PICTURE;
 
 /*
  * Drivers are allowed to wrap this function.  Each wrapper can decide that the
diff --git a/render/render.c b/render/render.c
index 7029558..fbb2968 100644
--- a/render/render.c
+++ b/render/render.c
@@ -239,7 +239,7 @@ RenderClientCallback (CallbackListPtr	*list,
 }
 
 #ifdef PANORAMIX
-unsigned long	XRT_PICTURE;
+RESTYPE	XRT_PICTURE;
 #endif
 
 void
commit 9a6a9971b03381b7c44257284edecdfa0135957f
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 16:25:23 2011 -0500

    xv: Use RESTYPE where appropriate
    
    No functional change.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xvdix.h b/Xext/xvdix.h
index a210615..e9c22bf 100644
--- a/Xext/xvdix.h
+++ b/Xext/xvdix.h
@@ -64,12 +64,12 @@ extern _X_EXPORT int XvReqCode;
 extern _X_EXPORT int XvEventBase;
 extern _X_EXPORT int XvErrorBase;
 
-extern _X_EXPORT unsigned long XvRTPort;
-extern _X_EXPORT unsigned long XvRTEncoding;
-extern _X_EXPORT unsigned long XvRTGrab;
-extern _X_EXPORT unsigned long XvRTVideoNotify;
-extern _X_EXPORT unsigned long XvRTVideoNotifyList;
-extern _X_EXPORT unsigned long XvRTPortNotify;
+extern _X_EXPORT RESTYPE XvRTPort;
+extern _X_EXPORT RESTYPE XvRTEncoding;
+extern _X_EXPORT RESTYPE XvRTGrab;
+extern _X_EXPORT RESTYPE XvRTVideoNotify;
+extern _X_EXPORT RESTYPE XvRTVideoNotifyList;
+extern _X_EXPORT RESTYPE XvRTPortNotify;
 #endif
 
 typedef struct {
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 12b4c51..cd6f097 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -115,14 +115,12 @@ int XvReqCode;
 int XvEventBase;
 int XvErrorBase;
 
-unsigned long XvRTPort;
-unsigned long XvRTEncoding;
-unsigned long XvRTGrab;
-unsigned long XvRTVideoNotify;
-unsigned long XvRTVideoNotifyList;
-unsigned long XvRTPortNotify;
-
-
+RESTYPE XvRTPort;
+RESTYPE XvRTEncoding;
+RESTYPE XvRTGrab;
+RESTYPE XvRTVideoNotify;
+RESTYPE XvRTVideoNotifyList;
+RESTYPE XvRTPortNotify;
 
 /* EXTERNAL */
 
commit fddfd026a0e4a8190dc01fb0f38af4b2c29b63a3
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 28 13:01:15 2011 -0500

    dix: Remove PIXEL typedef
    
    Doesn't appear to be used anywhere.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/misc.h b/include/misc.h
index 62d813e..0717db6 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -91,10 +91,8 @@ OF THIS SOFTWARE.
 #define EXTENSION_EVENT_BASE 64
 #define EXTENSION_BASE 128
 
-typedef unsigned long PIXEL;
 typedef unsigned long ATOM;
 
-
 #ifndef TRUE
 #define TRUE 1
 #define FALSE 0
commit 82a8677d9175732a61df4116a396b76a7704efb4
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 22:49:32 2011 -0500

    dix: Remove deprecated.c
    
    No more internal users, this can be dropped now.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/Makefile.am b/dix/Makefile.am
index 59e512b..5435546 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -10,7 +10,6 @@ libdix_la_SOURCES = 	\
 	atom.c		\
 	colormap.c	\
 	cursor.c	\
-	deprecated.c	\
 	devices.c	\
 	dispatch.c	\
 	dispatch.h	\
diff --git a/dix/deprecated.c b/dix/deprecated.c
deleted file mode 100644
index f05588e..0000000
--- a/dix/deprecated.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/***********************************************************
-
-Copyright 1987, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its 
-documentation for any purpose and without fee is hereby granted, 
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in 
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.  
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "dix.h"
-#include "misc.h"
-#include "dixstruct.h"
-
-/*
- * These are deprecated compatibility functions and will be marked as such
- * and removed soon!
- *
- * Please use the noted replacements instead.
- */
-
-/* replaced by dixLookupWindow */
-WindowPtr
-SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
-{
-    WindowPtr pWin;
-    static int warn = 1;
-    dixLookupWindow(&pWin, id, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupWindow().\n");
-    return pWin;
-}
-
-/* replaced by dixLookupWindow */
-WindowPtr
-LookupWindow(XID id, ClientPtr client)
-{
-    return SecurityLookupWindow(id, client, DixUnknownAccess);
-}
-
-/* replaced by dixLookupDrawable */
-pointer
-SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode)
-{
-    DrawablePtr pDraw;
-    static int warn = 1;
-    dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupDrawable().\n");
-    return pDraw;
-}
-
-/* replaced by dixLookupDrawable */
-pointer
-LookupDrawable(XID id, ClientPtr client)
-{
-    return SecurityLookupDrawable(id, client, DixUnknownAccess);
-}
-
-/* replaced by dixLookupClient */
-ClientPtr
-LookupClient(XID id, ClientPtr client)
-{
-    ClientPtr pClient;
-    static int warn = 1;
-    dixLookupClient(&pClient, id, client, DixUnknownAccess);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupClient() is deprecated.  Please convert your "
-	       "driver/module to use dixLookupClient().\n");
-    return pClient;
-}
-
-/* replaced by dixLookupResourceByType */
-pointer
-SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype,
-		       Mask access_mode)
-{
-    pointer retval;
-    static int warn = 1;
-    dixLookupResourceByType(&retval, id, rtype, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResourceByType().\n");
-    return retval;
-}
-
-pointer
-SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes,
-			Mask access_mode)
-{
-    pointer retval;
-    static int warn = 1;
-    dixLookupResourceByClass(&retval, id, classes, client, access_mode);
-    if (warn > 0 && warn--)
-	ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
-	       "are deprecated.  Please convert your driver/module "
-	       "to use dixLookupResourceByClass().\n");
-    return retval;
-}
-
-/* replaced by dixLookupResourceByType */
-pointer
-LookupIDByType(XID id, RESTYPE rtype)
-{
-    pointer val;
-    dixLookupResourceByType(&val, id, rtype, NullClient, DixUnknownAccess);
-    return val;
-}
-
-/* replaced by dixLookupResourceByClass */
-pointer
-LookupIDByClass(XID id, RESTYPE classes)
-{
-    pointer val;
-    dixLookupResourceByClass(&val, id, classes, NullClient, DixUnknownAccess);
-    return val;
-}
-
-/* end deprecated functions */
diff --git a/include/dix.h b/include/dix.h
index 3f99098..c201e3a 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -576,35 +576,4 @@ extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
 extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what);
 
-
-/*
- * These are deprecated compatibility functions and will be removed soon!
- * Please use the noted replacements instead.
- */
-/* replaced by dixLookupWindow */
-extern _X_EXPORT WindowPtr SecurityLookupWindow(
-    XID id,
-    ClientPtr client,
-    Mask access_mode);
-/* replaced by dixLookupWindow */
-extern _X_EXPORT WindowPtr LookupWindow(
-    XID id,
-    ClientPtr client);
-
-/* replaced by dixLookupDrawable */
-extern _X_EXPORT pointer SecurityLookupDrawable(
-    XID id,
-    ClientPtr client,
-    Mask access_mode);
-
-/* replaced by dixLookupDrawable */
-extern _X_EXPORT pointer LookupDrawable(
-    XID id,
-    ClientPtr client);
-
-/* replaced by dixLookupClient */
-extern _X_EXPORT ClientPtr LookupClient(
-    XID id,
-    ClientPtr client);
-
 #endif /* DIX_H */
diff --git a/include/resource.h b/include/resource.h
index 080061f..763aa99 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -251,34 +251,5 @@ extern _X_EXPORT unsigned int GetXIDList(
 extern _X_EXPORT RESTYPE lastResourceType;
 extern _X_EXPORT RESTYPE TypeMask;
 
-/*
- * These are deprecated compatibility functions and will be removed soon!
- * Please use the noted replacements instead.
- */
-
-/* replaced by dixLookupResourceByType */
-extern _X_EXPORT pointer SecurityLookupIDByType(
-    ClientPtr client,
-    XID id,
-    RESTYPE rtype,
-    Mask access_mode) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByClass */
-extern _X_EXPORT pointer SecurityLookupIDByClass(
-    ClientPtr client,
-    XID id,
-    RESTYPE classes,
-    Mask access_mode) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByType */
-extern _X_EXPORT pointer LookupIDByType(
-    XID id,
-    RESTYPE rtype) _X_DEPRECATED;
-
-/* replaced by dixLookupResourceByClass */
-extern _X_EXPORT pointer LookupIDByClass(
-    XID id,
-    RESTYPE classes) _X_DEPRECATED;
-
 #endif /* RESOURCE_H */
 
commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:37:45 2011 -0500

    dix: Remove usage_hint from pixmaps, store it in ->drawable.class
    
    The class field was unused for pixmaps, and we don't have enough classes
    to justify a whole uint32 anyway.
    
    Reviewed-by: Soren Sandmann <ssp at redhat.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/exa/exa.h b/exa/exa.h
index 8c93d15..6de6300 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -712,7 +712,7 @@ typedef struct _ExaDriver {
      * driver MUST fill out new_fb_pitch with valid pitch of pixmap
      */
     void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
-			   int depth, int usage_hint, int bitsPerPixel,
+			   int depth, int class, int bitsPerPixel,
 			   int *new_fb_pitch);
     /** @} */
 } ExaDriverRec, *ExaDriverPtr;
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 169ce3a..640b26a 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -54,7 +54,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -66,7 +66,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index b9903d1..4d2a1a5 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -48,7 +48,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -60,7 +60,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
@@ -78,7 +78,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
+	pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     }
     else {
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index fb47151..a563357 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -39,7 +39,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
     ExaPixmapPriv(pPixmap);
     int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
     int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
-    int usage_hint = pPixmap->usage_hint;
+    int class = pPixmap->drawable.class;
     int paddedWidth = pExaPixmap->sys_pitch;
 
     /* Already done. */
@@ -55,7 +55,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
 
     if (pExaScr->info->CreatePixmap2) {
 	int new_pitch = 0;
-        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
+        pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
 	paddedWidth = pExaPixmap->fb_pitch = new_pitch;
     } else {
 	if (paddedWidth < pExaPixmap->fb_pitch)
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index fd1afb2..24fce76 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -47,7 +47,7 @@ ExaGetPixmapAddress(PixmapPtr p)
  */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     PixmapPtr pPixmap;
     ExaPixmapPrivPtr	pExaPixmap;
@@ -59,7 +59,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
 	return NullPixmap;
 
     swap(pExaScr, pScreen, CreatePixmap);
-    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
+    pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
     swap(pExaScr, pScreen, CreatePixmap);
 
     if (!pPixmap)
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index e5d90d4..1f6dede 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -588,7 +588,7 @@ extern const GCFuncs exaGCFuncs;
 /* exa_classic.c */
 PixmapPtr
 exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
@@ -603,7 +603,7 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
 /* exa_driver.c */
 PixmapPtr
 exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
@@ -618,7 +618,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
 /* exa_mixed.c */
 PixmapPtr
 exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 Bool
 exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
diff --git a/fb/fb.h b/fb/fb.h
index 021a940..d905219 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1625,11 +1625,11 @@ fbPictureInit (ScreenPtr pScreen,
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned usage_hint);
+		   unsigned class);
 
 extern _X_EXPORT PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned usage_hint);
+		unsigned class);
 
 extern _X_EXPORT Bool
 fbDestroyPixmap (PixmapPtr pPixmap);
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index 2e600ed..e24f394 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -546,7 +546,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
     pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
 				     pOldTile->drawable.height,
 				     pOldTile->drawable.depth,
-				     pOldTile->usage_hint);
+				     pOldTile->drawable.class);
     if (!pNewTile)
 	return 0;
     fbGetDrawable (&pOldTile->drawable, 
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index 41b12ce..232de82 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -30,7 +30,7 @@
 
 PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
-		   unsigned usage_hint)
+		   unsigned class)
 {
     PixmapPtr	pPixmap;
     size_t	datasize;
@@ -54,7 +54,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     if (!pPixmap)
 	return NullPixmap;
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = 0;
+    pPixmap->drawable.class = class;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -78,14 +78,12 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
     pPixmap->screen_y = 0;
 #endif
 
-    pPixmap->usage_hint = usage_hint;
-
     return pPixmap;
 }
 
 PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
-		unsigned usage_hint)
+		unsigned class)
 {
     int	bpp;
     bpp = BitsPerPixel (depth);
@@ -93,7 +91,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
     if (bpp == 32 && depth <= 24)
 	bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
 #endif
-    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
+    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, class);
 }
 
 Bool
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 81b7115..a167364 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -82,7 +82,7 @@ void dmxBECreatePixmap(PixmapPtr pPixmap)
 /** Create a pixmap for \a pScreen with the specified \a width, \a
  *  height, and \a depth. */
 PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned usage_hint)
+			  unsigned class)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
     PixmapPtr      pPixmap;
@@ -104,7 +104,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
 	return NullPixmap;
 
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
-    pPixmap->drawable.class = 0;
+    pPixmap->drawable.class = class;
     pPixmap->drawable.pScreen = pScreen;
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
@@ -116,7 +116,6 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
     pPixmap->drawable.height = height;
     pPixmap->devKind = PixmapBytePad(width, bpp);
     pPixmap->refcnt = 1;
-    pPixmap->usage_hint = usage_hint;
 
     pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
     pPixPriv->pixmap = (Pixmap)0;
diff --git a/hw/dmx/dmxpixmap.h b/hw/dmx/dmxpixmap.h
index 59da788..4b4a8b2 100644
--- a/hw/dmx/dmxpixmap.h
+++ b/hw/dmx/dmxpixmap.h
@@ -50,7 +50,7 @@ extern Bool      dmxInitPixmap(ScreenPtr pScreen);
 
 extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen,
 				 int width, int height, int depth,
-				 unsigned usage_hint);
+				 unsigned class);
 extern Bool      dmxDestroyPixmap(PixmapPtr pPixmap);
 extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 215e845..c5ebb27 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -369,13 +369,13 @@ VGAarbiterClearToBackground (
 }
 
 static PixmapPtr
-VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
+VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 {
     PixmapPtr pPix;
 
     SCREEN_PROLOG ( CreatePixmap);
     VGAGet(pScreen);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
     VGAPut();
     SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
 
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 848e45d..e1ac20f 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -155,7 +155,7 @@ static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
 static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
     int h, Bool generateExposures);
 static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
-    int depth, unsigned int usage_hint);
+    int depth, unsigned int class);
 static Bool  VGAarbiterCreateGC(GCPtr pGC);
 static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
 static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 11443a6..dcbd5ab 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -34,7 +34,7 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
 static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
 			int *pwidth, int nspans, char *pdstStart);
 static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
-				 unsigned usage_hint);
+				 unsigned class);
 static Bool XAADestroyPixmap(PixmapPtr pPixmap);
 static Bool XAAEnterVT (int index, int flags);
 static void XAALeaveVT (int index, int flags);
@@ -331,7 +331,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen)
 }
 
 static PixmapPtr 
-XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
+XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
 {
     XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -346,7 +346,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 	XAAInitializeOffscreenDepths (pScreen);
 
     if(pScrn->vtSema &&
-	(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
+	(class != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
 	(infoRec->offscreenDepths & (1 << (depth - 1))) &&
 	(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
 	(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
@@ -379,7 +379,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
 	}
 
 	XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint);
+	pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, class);
 	XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
 	if (!pPix) {
@@ -411,7 +411,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
     }
 BAILOUT:
     XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
-    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
+    pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
     XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
 
     if(pPix) {
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index 3a92ffd..c901db1 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -37,7 +37,7 @@ DevPrivateKeyRec xnestPixmapPrivateKeyRec;
 
 PixmapPtr
 xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
-		  unsigned usage_hint)
+		  unsigned class)
 {
   PixmapPtr pPixmap;
 
@@ -45,7 +45,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   if (!pPixmap)
     return NullPixmap;
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = 0;
+  pPixmap->drawable.class = class;
   pPixmap->drawable.depth = depth;
   pPixmap->drawable.bitsPerPixel = depth;
   pPixmap->drawable.id = 0;
@@ -57,7 +57,6 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
   pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
   pPixmap->refcnt = 1;
   pPixmap->devKind = PixmapBytePad(width, depth);
-  pPixmap->usage_hint = usage_hint;
   if (width && height)
       xnestPixmapPriv(pPixmap)->pixmap = 
 	  XCreatePixmap(xnestDisplay, 
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index aa671ed..638a43a 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -30,7 +30,7 @@ typedef struct {
 #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
 
 PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
-			    int depth, unsigned usage_hint);
+			    int depth, unsigned class);
 Bool xnestDestroyPixmap(PixmapPtr pPixmap);
 RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
 
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 3f40fdb..606645f 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1069,7 +1069,7 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
 
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
-			  unsigned usage_hint);
+			  unsigned class);
 
 Bool
 winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
index 8bd8e34..62717f3 100644
--- a/hw/xwin/winpixmap.c
+++ b/hw/xwin/winpixmap.c
@@ -57,7 +57,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
 PixmapPtr
 winCreatePixmapNativeGDI (ScreenPtr pScreen,
 			  int iWidth, int iHeight,
-			  int iDepth, unsigned usage_hint)
+			  int iDepth, unsigned class)
 {
   winPrivPixmapPtr	pPixmapPriv = NULL;
   PixmapPtr		pPixmap = NULL;
@@ -72,13 +72,13 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
 
 #if CYGDEBUG
   winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
-	  iWidth, iHeight, iDepth, usage_hint,
+	  iWidth, iHeight, iDepth, class,
 	  PixmapBytePad (iWidth, iDepth));
 #endif
 
   /* Setup pixmap values */
   pPixmap->drawable.type = DRAWABLE_PIXMAP;
-  pPixmap->drawable.class = 0;
+  pPixmap->drawable.class = class;
   pPixmap->drawable.pScreen = pScreen;
   pPixmap->drawable.depth = iDepth;
   pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
@@ -91,7 +91,6 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
   pPixmap->devKind = 0;
   pPixmap->refcnt = 1;
   pPixmap->devPrivate.ptr = NULL;
-  pPixmap->usage_hint = usage_hint;
 
   /* Pixmap privates are allocated by AllocatePixmap */
   pPixmapPriv = winGetPixmapPriv (pPixmap);
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 702faf0..542c381 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -80,7 +80,6 @@ typedef struct _Pixmap {
     short		screen_x;
     short		screen_y;
 #endif
-    unsigned		usage_hint; /* see CREATE_PIXMAP_USAGE_* */
 } PixmapRec;
 
 #endif /* PIXMAPSTRUCT_H */
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index a9357e8..302a561 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -208,7 +208,7 @@ typedef    PixmapPtr (* CreatePixmapProcPtr)(
 	int /*width*/,
 	int /*height*/,
 	int /*depth*/,
-	unsigned /*usage_hint*/);
+	unsigned /*class*/);
 
 typedef    Bool (* DestroyPixmapProcPtr)(
 	PixmapPtr /*pPixmap*/);
commit d8caa782009abf4dc17b945e325e83fda299a534
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Feb 24 16:06:34 2011 -0500

    vbe: Fix malloc size bug
    
    v2: Slightly more obvious sizing math.
    
    ==14882== Invalid write of size 2
    ==14882==    at 0x6750267: VBEGetVBEInfo (vbe.c:400)
    ==14882==    by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so)
    ==14882==    by 0x471895: InitOutput (xf86Init.c:519)
    ==14882==    by 0x422778: main (main.c:205)
    ==14882==  Address 0x4f32fa8 is 72 bytes inside a block of size 73 alloc'd
    ==14882==    at 0x4A0640D: malloc (vg_replace_malloc.c:236)
    ==14882==    by 0x675024B: VBEGetVBEInfo (vbe.c:398)
    ==14882==    by 0x6142064: ??? (in /usr/lib64/xorg/modules/drivers/vesa_drv.so)
    ==14882==    by 0x471895: InitOutput (xf86Init.c:519)
    ==14882==    by 0x422778: main (main.c:205)
    
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index bcda5ec..04132d9 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -395,7 +395,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
     i = 0;
     while (modes[i] != 0xffff)
 	i++;
-    block->VideoModePtr = malloc(sizeof(CARD16) * i + 1);
+    block->VideoModePtr = malloc(sizeof(CARD16) * (i + 1));
     memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
     block->VideoModePtr[i] = 0xffff;
 
commit 628d16a92a7fa556fbb70bf4a4adf57ec05c190b
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Feb 26 10:31:50 2011 -0800

    loader: Don't distribute sdksyms.c and make it depend on the config
    
    sdksyms.c is constructed by processing header files with the C
    preprocessor. Its contents will vary depending on the precise
    configuration options, and so must depend on the config header
    files.
    
    We have one header file which is always changed when any config option
    is modified called do-not-use-config.h (which may want a different
    name at some point), so make sdksyms.c depend on that file.
    
    Also, we don't want to ship this file; it always needs to be
    built. So, include it in the nodist_libloader_la_SOURCES list to
    prevent it from being added to the tarball.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 7f386cc..0e5b304 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -12,18 +12,21 @@ EXTRA_DIST = \
 	loaderProcs.h \
 	sdksyms.sh
 
+nodist_libloader_la_SOURCES = \
+	sdksyms.c
+
 libloader_la_SOURCES = \
 	loader.c \
 	loaderProcs.h \
 	loadext.c \
         loadmod.c \
-	os.c \
-	sdksyms.c
+	os.c
+
 libloader_la_LIBADD = $(DLOPEN_LIBS)
 
 CLEANFILES = sdksyms.c sdksyms.dep
 
-sdksyms.dep sdksyms.c: sdksyms.sh
+sdksyms.dep sdksyms.c: sdksyms.sh $(top_builddir)/include/do-not-use-config.h
 	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
 
 SDKSYMS_DEP = sdksyms.dep
commit 1c008e7e7865b405b8033f625333cd64ece4499e
Author: Simon Thum <simon.thum at gmx.de>
Date:   Wed Feb 23 02:29:35 2011 +0100

    dix: change all timestamps in pointer acceleration to CARD32
    
    CARD32 is being returned by GetTimeInMilis(), so use it consistently.
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index ed80af5..ccd445e 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -1072,7 +1072,7 @@ void
 acceleratePointerPredictable(
     DeviceIntPtr dev,
     ValuatorMask* val,
-    int evtime)
+    CARD32 evtime)
 {
     float fdx, fdy, tmp, mult; /* no need to init */
     int dx = 0, dy = 0, tmpi;
@@ -1151,7 +1151,7 @@ void
 acceleratePointerLightweight(
     DeviceIntPtr dev,
     ValuatorMask* val,
-    int ignored)
+    CARD32 ignored)
 {
     float mult = 0.0, tmpf;
     int dx = 0, dy = 0, tmpi;
diff --git a/include/input.h b/include/input.h
index 165992a..bdef038 100644
--- a/include/input.h
+++ b/include/input.h
@@ -145,7 +145,7 @@ typedef void (*DeviceUnwrapProc)(
 typedef void (*PointerAccelSchemeProc)(
     DeviceIntPtr /*device*/,
     ValuatorMask* /*valuators*/,
-    int /*evtime*/);
+    CARD32 /*evtime*/);
 
 typedef void (*DeviceCallbackProc)(
               DeviceIntPtr /*pDev*/);
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index a1165b1..c14e12d 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -134,9 +134,11 @@ InitPredictableAccelerationScheme(DeviceIntPtr dev,
 				  struct _ValuatorAccelerationRec* protoScheme);
 
 extern _X_INTERNAL void
-acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val, int evtime);
+acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val,
+                             CARD32 evtime);
 
 extern _X_INTERNAL void
-acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val, int evtime);
+acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val,
+                             CARD32 evtime);
 
 #endif  /* POINTERVELOCITY_H */
commit a4b85261859b17dba9ad8f7f1ce650133f0235d4
Author: Simon Thum <simon.thum at gmx.de>
Date:   Wed Feb 23 02:29:34 2011 +0100

    dix: update pointer acceleration code to use ValuatorMask
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 5b8e379..1403ccc 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -791,17 +791,14 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
  * Accelerate the data in valuators based on the device's acceleration scheme.
  *
  * @param dev The device which's pointer is to be moved.
- * @param first The first valuator in @valuators
- * @param num Total number of valuators in @valuators.
- * @param valuators Valuator data for each axis between @first and
- *        @first+ at num.
+ * @param valuators Valuator mask
  * @param ms Current time.
  */
 static void
-accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
+accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, CARD32 ms)
 {
     if (dev->valuator->accelScheme.AccelSchemeProc)
-        dev->valuator->accelScheme.AccelSchemeProc(dev, first, num, valuators, ms);
+        dev->valuator->accelScheme.AccelSchemeProc(dev, valuators, ms);
 }
 
 /**
@@ -1170,20 +1167,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
         moveAbsolute(pDev, &x, &y, &mask);
     } else {
         if (flags & POINTER_ACCELERATE) {
-            /* FIXME: Pointer acceleration only requires X and Y values. This
-             * should be converted to masked valuators. */
-            int vals[2];
-            vals[0] = valuator_mask_isset(&mask, 0) ?
-                      valuator_mask_get(&mask, 0) : 0;
-            vals[1] = valuator_mask_isset(&mask, 1) ?
-                      valuator_mask_get(&mask, 1) : 0;
-            accelPointer(pDev, 0, 2, vals, ms);
-
-            if (valuator_mask_isset(&mask, 0))
-                valuator_mask_set(&mask, 0, vals[0]);
-            if (valuator_mask_isset(&mask, 1))
-                valuator_mask_set(&mask, 1, vals[1]);
-
+            accelPointer(pDev, &mask, ms);
             /* The pointer acceleration code modifies the fractional part
              * in-place, so we need to extract this information first */
             x_frac = pDev->last.remainder[0];
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 3b0c75a..ed80af5 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -1071,32 +1071,28 @@ GetDevicePredictableAccelData(
 void
 acceleratePointerPredictable(
     DeviceIntPtr dev,
-    int first_valuator,
-    int num_valuators,
-    int *valuators,
+    ValuatorMask* val,
     int evtime)
 {
     float fdx, fdy, tmp, mult; /* no need to init */
-    int dx = 0, dy = 0;
-    int *px = NULL, *py = NULL;
+    int dx = 0, dy = 0, tmpi;
     DeviceVelocityPtr velocitydata = GetDevicePredictableAccelData(dev);
     Bool soften = TRUE;
 
-    if (!num_valuators || !valuators || !velocitydata)
+    if (!velocitydata)
         return;
 
     if (velocitydata->statistics.profile_number == AccelProfileNone &&
-	velocitydata->const_acceleration == 1.0f) {
-	return; /*we're inactive anyway, so skip the whole thing.*/
+        velocitydata->const_acceleration == 1.0f) {
+        return; /*we're inactive anyway, so skip the whole thing.*/
     }
 
-    if (first_valuator == 0) {
-        dx = valuators[0];
-        px = &valuators[0];
+    if (valuator_mask_isset(val, 0)) {
+        dx = valuator_mask_get(val, 0);
     }
-    if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) {
-        dy = valuators[1 - first_valuator];
-        py = &valuators[1 - first_valuator];
+
+    if (valuator_mask_isset(val, 1)) {
+        dy = valuator_mask_get(val, 1);
     }
 
     if (dx || dy){
@@ -1108,15 +1104,15 @@ acceleratePointerPredictable(
         if (dev->ptrfeed && dev->ptrfeed->ctrl.num) {
             /* invoke acceleration profile to determine acceleration */
             mult = ComputeAcceleration (dev, velocitydata,
-					dev->ptrfeed->ctrl.threshold,
-					(float)dev->ptrfeed->ctrl.num /
-					(float)dev->ptrfeed->ctrl.den);
+                                        dev->ptrfeed->ctrl.threshold,
+                                        (float)dev->ptrfeed->ctrl.num /
+                                            (float)dev->ptrfeed->ctrl.den);
 
             if(mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
-                ApplySofteningAndConstantDeceleration( velocitydata,
-						       dx, dy,
-						       &fdx, &fdy,
-						       (mult > 1.0f) && soften);
+                ApplySofteningAndConstantDeceleration(velocitydata,
+                                                      dx, dy,
+                                                      &fdx, &fdy,
+                                                      (mult > 1.0f) && soften);
 
                 if (dx) {
                     tmp = mult * fdx + dev->last.remainder[0];
@@ -1125,13 +1121,15 @@ acceleratePointerPredictable(
                      * process each axis conditionally, there's no danger
                      * of a toggling remainder. Its lack of guarantees likely
                      * makes it faster on the average target. */
-                    *px = lrintf(tmp);
-                    dev->last.remainder[0] = tmp - (float)*px;
+                    tmpi = lrintf(tmp);
+                    valuator_mask_set(val, 0, tmpi);
+                    dev->last.remainder[0] = tmp - (float)tmpi;
                 }
                 if (dy) {
                     tmp = mult * fdy + dev->last.remainder[1];
-                    *py = lrintf(tmp);
-                    dev->last.remainder[1] = tmp - (float)*py;
+                    tmpi = lrintf(tmp);
+                    valuator_mask_set(val, 1, tmpi);
+                    dev->last.remainder[1] = tmp - (float)tmpi;
                 }
                 DebugAccelF("pos (%i | %i) remainders x: %.3f y: %.3f delta x:%.3f y:%.3f\n",
                             *px, *py, dev->last.remainder[0], dev->last.remainder[1], fdx, fdy);
@@ -1152,25 +1150,18 @@ acceleratePointerPredictable(
 void
 acceleratePointerLightweight(
     DeviceIntPtr dev,
-    int first_valuator,
-    int num_valuators,
-    int *valuators,
+    ValuatorMask* val,
     int ignored)
 {
-    float mult = 0.0;
-    int dx = 0, dy = 0;
-    int *px = NULL, *py = NULL;
-
-    if (!num_valuators || !valuators)
-        return;
+    float mult = 0.0, tmpf;
+    int dx = 0, dy = 0, tmpi;
 
-    if (first_valuator == 0) {
-        dx = valuators[0];
-        px = &valuators[0];
+    if (valuator_mask_isset(val, 0)) {
+        dx = valuator_mask_get(val, 0);
     }
-    if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) {
-        dy = valuators[1 - first_valuator];
-        py = &valuators[1 - first_valuator];
+
+    if (valuator_mask_isset(val, 1)) {
+        dy = valuator_mask_get(val, 1);
     }
 
     if (!dx && !dy)
@@ -1180,45 +1171,45 @@ acceleratePointerLightweight(
         /* modeled from xf86Events.c */
         if (dev->ptrfeed->ctrl.threshold) {
             if ((abs(dx) + abs(dy)) >= dev->ptrfeed->ctrl.threshold) {
-                dev->last.remainder[0] = ((float)dx *
-                                             (float)(dev->ptrfeed->ctrl.num)) /
-                                             (float)(dev->ptrfeed->ctrl.den) +
-                                            dev->last.remainder[0];
-                if (px) {
-                    *px = (int)dev->last.remainder[0];
-                    dev->last.remainder[0] = dev->last.remainder[0] -
-                                                (float)(*px);
+                tmpf = ((float)dx *
+                        (float)(dev->ptrfeed->ctrl.num)) /
+                       (float)(dev->ptrfeed->ctrl.den) +
+                       dev->last.remainder[0];
+                if (dx) {
+                    tmpi = (int) tmpf;
+                    valuator_mask_set(val, 0, tmpi);
+                    dev->last.remainder[0] = tmpf - (float)tmpi;
                 }
 
-                dev->last.remainder[1] = ((float)dy *
-                                             (float)(dev->ptrfeed->ctrl.num)) /
-                                             (float)(dev->ptrfeed->ctrl.den) +
-                                            dev->last.remainder[1];
-                if (py) {
-                    *py = (int)dev->last.remainder[1];
-                    dev->last.remainder[1] = dev->last.remainder[1] -
-                                                (float)(*py);
+                tmpf = ((float)dy *
+                        (float)(dev->ptrfeed->ctrl.num)) /
+                       (float)(dev->ptrfeed->ctrl.den) +
+                       dev->last.remainder[1];
+                if (dy) {
+                    tmpi = (int) tmpf;
+                    valuator_mask_set(val, 1, tmpi);
+                    dev->last.remainder[1] = tmpf - (float)tmpi;
                 }
             }
         }
         else {
-	    mult = pow((float)dx * (float)dx + (float)dy * (float)dy,
+            mult = pow((float)dx * (float)dx + (float)dy * (float)dy,
                        ((float)(dev->ptrfeed->ctrl.num) /
                         (float)(dev->ptrfeed->ctrl.den) - 1.0) /
                        2.0) / 2.0;
             if (dx) {
-                dev->last.remainder[0] = mult * (float)dx +
-                                            dev->last.remainder[0];
-                *px = (int)dev->last.remainder[0];
-                dev->last.remainder[0] = dev->last.remainder[0] -
-                                            (float)(*px);
+                tmpf = mult * (float)dx +
+                       dev->last.remainder[0];
+                tmpi = (int) tmpf;
+                valuator_mask_set(val, 0, tmpi);
+                dev->last.remainder[0] = tmpf - (float)tmpi;
             }
             if (dy) {
-                dev->last.remainder[1] = mult * (float)dy +
-                                            dev->last.remainder[1];
-                *py = (int)dev->last.remainder[1];
-                dev->last.remainder[1] = dev->last.remainder[1] -
-                                            (float)(*py);
+                tmpf = mult * (float)dy +
+                       dev->last.remainder[1];
+                tmpi = (int)tmpf;
+                valuator_mask_set(val, 1, tmpi);
+                dev->last.remainder[1] = tmpf - (float)tmpi;
             }
         }
     }
diff --git a/include/input.h b/include/input.h
index 643866f..165992a 100644
--- a/include/input.h
+++ b/include/input.h
@@ -106,6 +106,8 @@ typedef struct _ClassesRec *ClassesPtr;
 typedef struct _SpriteRec *SpritePtr;
 typedef union _GrabMask GrabMask;
 
+typedef struct _ValuatorMask ValuatorMask;
+
 typedef struct _EventList {
     xEvent* event;
     int evlen; /* length of allocated memory for event in bytes.  This is not
@@ -141,10 +143,8 @@ typedef void (*DeviceUnwrapProc)(
 
 /* pointer acceleration handling */
 typedef void (*PointerAccelSchemeProc)(
-    DeviceIntPtr /*pDev*/,
-    int /*first_valuator*/,
-    int /*num_valuators*/,
-    int* /*valuators*/,
+    DeviceIntPtr /*device*/,
+    ValuatorMask* /*valuators*/,
     int /*evtime*/);
 
 typedef void (*DeviceCallbackProc)(
@@ -163,8 +163,6 @@ typedef struct _DeviceRec {
     Bool	on;			/* used by DDX to keep state */
 } DeviceRec, *DevicePtr;
 
-typedef struct _ValuatorMask ValuatorMask;
-
 typedef struct {
     int			click, bell, bell_pitch, bell_duration;
     Bool		autoRepeat;
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 5c57d42..a1165b1 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -1,6 +1,6 @@
 /*
  *
- * Copyright © 2006-2009 Simon Thum             simon dot thum at gmx dot de
+ * Copyright © 2006-2011 Simon Thum             simon dot thum at gmx dot de
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -25,7 +25,7 @@
 #ifndef POINTERVELOCITY_H
 #define POINTERVELOCITY_H
 
-#include <input.h> /* DeviceIntPtr */
+#include <input.h>
 
 /* constants for acceleration profiles */
 
@@ -134,11 +134,9 @@ InitPredictableAccelerationScheme(DeviceIntPtr dev,
 				  struct _ValuatorAccelerationRec* protoScheme);
 
 extern _X_INTERNAL void
-acceleratePointerPredictable(DeviceIntPtr dev, int first_valuator,
-                             int num_valuators, int *valuators, int evtime);
+acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val, int evtime);
 
 extern _X_INTERNAL void
-acceleratePointerLightweight(DeviceIntPtr dev, int first_valuator,
-                             int num_valuators, int *valuators, int ignored);
+acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val, int evtime);
 
 #endif  /* POINTERVELOCITY_H */
commit 8128846e16b406c7d459ae7556f7cd09bdc24c91
Author: Simon Thum <simon.thum at gmx.de>
Date:   Wed Feb 23 02:29:33 2011 +0100

    dix: refactor predictable scheme initialization
    
    This intends to clean up the predictable accel struct
    from purely scheme-related things like input properties,
    as they would be useless in other use cases such
    as wheel acceleration.
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index e6ac2ed..3b0c75a 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -30,6 +30,7 @@
 #include <ptrveloc.h>
 #include <exevents.h>
 #include <X11/Xatom.h>
+#include <os.h>
 
 #include <xserver-properties.h>
 
@@ -68,9 +69,12 @@ SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, float velocity,
 static PointerAccelerationProfileFunc
 GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
 static BOOL
-InitializePredictableAccelerationProperties(DeviceIntPtr dev);
+InitializePredictableAccelerationProperties(DeviceIntPtr,
+                                            DeviceVelocityPtr,
+                                            PredictableAccelSchemePtr);
 static BOOL
-DeletePredictableAccelerationProperties(DeviceIntPtr dev);
+DeletePredictableAccelerationProperties(DeviceIntPtr,
+                                        PredictableAccelSchemePtr);
 
 /*#define PTRACCEL_DEBUGGING*/
 
@@ -87,7 +91,6 @@ DeletePredictableAccelerationProperties(DeviceIntPtr dev);
 /* some int which is not a profile number */
 #define PROFILE_UNINITIALIZE (-100)
 
-
 /**
  * Init DeviceVelocity struct so it should match the average case
  */
@@ -125,17 +128,22 @@ FreeVelocityData(DeviceVelocityPtr vel){
  */
 Bool
 InitPredictableAccelerationScheme(DeviceIntPtr dev,
-				  ValuatorAccelerationPtr protoScheme) {
+                                  ValuatorAccelerationPtr protoScheme) {
     DeviceVelocityPtr vel;
     ValuatorAccelerationRec scheme;
+    PredictableAccelSchemePtr schemeData;
     scheme = *protoScheme;
     vel = calloc(1, sizeof(DeviceVelocityRec));
-    if (!vel)
-	return FALSE;
+    schemeData = calloc(1, sizeof(PredictableAccelSchemeRec));
+    if (!vel || !schemeData)
+        return FALSE;
     InitVelocityData(vel);
-    scheme.accelData = vel;
+    schemeData->vel = vel;
+    scheme.accelData = schemeData;
+    if (!InitializePredictableAccelerationProperties(dev, vel, schemeData))
+        return FALSE;
+    /* all fine, assign scheme to device */
     dev->valuator->accelScheme = scheme;
-    InitializePredictableAccelerationProperties(dev);
     return TRUE;
 }
 
@@ -146,14 +154,21 @@ InitPredictableAccelerationScheme(DeviceIntPtr dev,
 void
 AccelerationDefaultCleanup(DeviceIntPtr dev)
 {
-    /*sanity check*/
-    if( dev->valuator->accelScheme.AccelSchemeProc == acceleratePointerPredictable
-            && dev->valuator->accelScheme.accelData != NULL){
+    DeviceVelocityPtr vel = GetDevicePredictableAccelData(dev);
+    if (vel) {
+        /* the proper guarantee would be that we're not inside of
+         * AccelSchemeProc(), but that seems impossible. Schemes don't get
+         * switched often anyway.
+         */
+        OsBlockSignals();
         dev->valuator->accelScheme.AccelSchemeProc = NULL;
-        FreeVelocityData(dev->valuator->accelScheme.accelData);
+        FreeVelocityData(vel);
+        free(vel);
+        DeletePredictableAccelerationProperties(dev,
+            (PredictableAccelSchemePtr) dev->valuator->accelScheme.accelData);
         free(dev->valuator->accelScheme.accelData);
         dev->valuator->accelScheme.accelData = NULL;
-        DeletePredictableAccelerationProperties(dev);
+        OsReleaseSignals();
     }
 }
 
@@ -345,26 +360,34 @@ AccelInitScaleProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
     return XIRegisterPropertyHandler(dev, AccelSetScaleProperty, NULL, NULL);
 }
 
-BOOL
-InitializePredictableAccelerationProperties(DeviceIntPtr dev)
+static BOOL
+InitializePredictableAccelerationProperties(
+    DeviceIntPtr dev,
+    DeviceVelocityPtr  vel,
+    PredictableAccelSchemePtr schemeData)
 {
-    DeviceVelocityPtr  vel = GetDevicePredictableAccelData(dev);
-
+    int num_handlers = 4;
     if(!vel)
-	return FALSE;
+        return FALSE;
 
-    vel->prop_handlers[0] = AccelInitProfileProperty(dev, vel);
-    vel->prop_handlers[1] = AccelInitDecelProperty(dev, vel);
-    vel->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
-    vel->prop_handlers[3] = AccelInitScaleProperty(dev, vel);
+    schemeData->prop_handlers = calloc(num_handlers, sizeof(long));
+    if (!schemeData->prop_handlers)
+        return FALSE;
+    schemeData->num_prop_handlers = num_handlers;
+    schemeData->prop_handlers[0] = AccelInitProfileProperty(dev, vel);
+    schemeData->prop_handlers[1] = AccelInitDecelProperty(dev, vel);
+    schemeData->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
+    schemeData->prop_handlers[3] = AccelInitScaleProperty(dev, vel);
 
     return TRUE;
 }
 
 BOOL
-DeletePredictableAccelerationProperties(DeviceIntPtr dev)
+DeletePredictableAccelerationProperties(
+    DeviceIntPtr dev,
+    PredictableAccelSchemePtr scheme)
 {
-    DeviceVelocityPtr  vel;
+    DeviceVelocityPtr vel;
     Atom prop;
     int i;
 
@@ -378,10 +401,15 @@ DeletePredictableAccelerationProperties(DeviceIntPtr dev)
     XIDeleteDeviceProperty(dev, prop, FALSE);
 
     vel = GetDevicePredictableAccelData(dev);
-    for (i = 0; vel && i < NPROPS_PREDICTABLE_ACCEL; i++)
-	if (vel->prop_handlers[i])
-	    XIUnregisterPropertyHandler(dev, vel->prop_handlers[i]);
+    if (vel) {
+        for (i = 0; i < scheme->num_prop_handlers; i++)
+            if (scheme->prop_handlers[i])
+                XIUnregisterPropertyHandler(dev, scheme->prop_handlers[i]);
+    }
 
+    free(scheme->prop_handlers);
+    scheme->prop_handlers = NULL;
+    scheme->num_prop_handlers = 0;
     return TRUE;
 }
 
@@ -397,8 +425,7 @@ InitTrackers(DeviceVelocityPtr vel, int ntracker)
 	return;
     }
     free(vel->tracker);
-    vel->tracker = (MotionTrackerPtr)malloc(ntracker * sizeof(MotionTracker));
-    memset(vel->tracker, 0, ntracker * sizeof(MotionTracker));
+    vel->tracker = (MotionTrackerPtr)calloc(ntracker, sizeof(MotionTracker));
     vel->num_tracker = ntracker;
 }
 
@@ -1026,7 +1053,8 @@ GetDevicePredictableAccelData(
 	    acceleratePointerPredictable &&
 	dev->valuator->accelScheme.accelData != NULL){
 
-	return (DeviceVelocityPtr)dev->valuator->accelScheme.accelData;
+	return ((PredictableAccelSchemePtr)
+		dev->valuator->accelScheme.accelData)->vel;
     }
     return NULL;
 }
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 8c59c03..5c57d42 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -62,9 +62,6 @@ typedef struct _MotionTracker {
     int dir;        /* initial direction bitfield */
 } MotionTracker, *MotionTrackerPtr;
 
-/* number of properties for predictable acceleration */
-#define NPROPS_PREDICTABLE_ACCEL 4
-
 /**
  * Contains all data needed to implement mouse ballistics
  */
@@ -91,9 +88,18 @@ typedef struct _DeviceVelocityRec {
     struct {   /* to be able to query this information */
         int     profile_number;
     } statistics;
-    long    prop_handlers[NPROPS_PREDICTABLE_ACCEL];
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
+/**
+ * contains the run-time data for the predictable scheme, that is, a
+ * DeviceVelocityPtr and the property handlers.
+ */
+typedef struct _PredictableAccelSchemeRec {
+    DeviceVelocityPtr vel;
+    long* prop_handlers;
+    int num_prop_handlers;
+} PredictableAccelSchemeRec, *PredictableAccelSchemePtr;
+
 extern _X_EXPORT void
 InitVelocityData(DeviceVelocityPtr vel);
 


More information about the Xquartz-changes mailing list