aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-19 19:42:41 +0000
committermarha <marha@users.sourceforge.net>2011-01-19 19:42:41 +0000
commitcdc60fdcddbe5666aac11af34c6c030d4a670b99 (patch)
tree4ec58bc0728308be9921485d5e79979bbc65a9b1 /xorg-server
parent800da6ed70c65f5059726b7ce35030e9c7235f01 (diff)
parenta13b75f056f9f9efcf6ecb8610b40ddbbb2bbb69 (diff)
downloadvcxsrv-cdc60fdcddbe5666aac11af34c6c030d4a670b99.tar.gz
vcxsrv-cdc60fdcddbe5666aac11af34c6c030d4a670b99.tar.bz2
vcxsrv-cdc60fdcddbe5666aac11af34c6c030d4a670b99.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/configure.ac11
-rw-r--r--xorg-server/cpprules.in49
-rw-r--r--xorg-server/doc/man/Makefile.am26
-rw-r--r--xorg-server/glx/glxcmds.c4595
-rw-r--r--xorg-server/glx/glxcmdsswap.c1695
-rw-r--r--xorg-server/glx/xfont.c378
-rw-r--r--xorg-server/hw/dmx/Makefile.am25
-rw-r--r--xorg-server/hw/dmx/config/Makefile.am21
-rw-r--r--xorg-server/hw/dmx/config/man/Makefile.am2
-rw-r--r--xorg-server/hw/dmx/config/man/dmxtodmx.man (renamed from xorg-server/hw/dmx/config/dmxtodmx.man)0
-rw-r--r--xorg-server/hw/dmx/config/man/vdltodmx.man (renamed from xorg-server/hw/dmx/config/vdltodmx.man)0
-rw-r--r--xorg-server/hw/dmx/config/man/xdmxconfig.man (renamed from xorg-server/hw/dmx/config/xdmxconfig.man)0
-rw-r--r--xorg-server/hw/dmx/man/Makefile.am2
-rw-r--r--xorg-server/hw/dmx/man/Xdmx.man (renamed from xorg-server/hw/dmx/Xdmx.man)0
-rw-r--r--xorg-server/hw/kdrive/ephyr/Makefile.am18
-rw-r--r--xorg-server/hw/kdrive/ephyr/man/Makefile.am2
-rw-r--r--xorg-server/hw/kdrive/ephyr/man/Xephyr.man (renamed from xorg-server/hw/kdrive/ephyr/Xephyr.man.pre)8
-rw-r--r--xorg-server/hw/vfb/Makefile.am85
-rw-r--r--xorg-server/hw/vfb/man/Makefile.am2
-rw-r--r--xorg-server/hw/vfb/man/Xvfb.man (renamed from xorg-server/hw/vfb/Xvfb.man.pre)12
-rw-r--r--xorg-server/hw/xfree86/Makefile.am240
-rw-r--r--xorg-server/hw/xfree86/doc/man/Makefile.am27
-rw-r--r--xorg-server/hw/xfree86/doc/man/Xorg.man (renamed from xorg-server/hw/xfree86/doc/man/Xorg.man.pre)1378
-rw-r--r--xorg-server/hw/xfree86/doc/man/xorg.conf.man (renamed from xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre)4956
-rw-r--r--xorg-server/hw/xfree86/exa/Makefile.am14
-rw-r--r--xorg-server/hw/xfree86/exa/man/Makefile.am2
-rw-r--r--xorg-server/hw/xfree86/exa/man/exa.man (renamed from xorg-server/hw/xfree86/exa/exa.man.pre)4
-rw-r--r--xorg-server/hw/xfree86/fbdevhw/Makefile.am46
-rw-r--r--xorg-server/hw/xfree86/fbdevhw/man/Makefile.am2
-rw-r--r--xorg-server/hw/xfree86/fbdevhw/man/fbdevhw.man (renamed from xorg-server/hw/xfree86/fbdevhw/fbdevhw.man.pre)4
-rw-r--r--xorg-server/hw/xfree86/utils/Makefile.am3
-rw-r--r--xorg-server/hw/xfree86/utils/cvt/Makefile.am76
-rw-r--r--xorg-server/hw/xfree86/utils/gtf/Makefile.am71
-rw-r--r--xorg-server/hw/xfree86/utils/man/Makefile.am2
-rw-r--r--xorg-server/hw/xfree86/utils/man/cvt.man (renamed from xorg-server/hw/xfree86/utils/cvt/cvt.man.pre)2
-rw-r--r--xorg-server/hw/xfree86/utils/man/gtf.man (renamed from xorg-server/hw/xfree86/utils/gtf/gtf.man.pre)0
-rw-r--r--xorg-server/hw/xfree86/xorgconf.cpp610
-rw-r--r--xorg-server/hw/xnest/Makefile.am26
-rw-r--r--xorg-server/hw/xnest/man/Makefile.am2
-rw-r--r--xorg-server/hw/xnest/man/Xnest.man (renamed from xorg-server/hw/xnest/Xnest.man.pre)0
-rw-r--r--xorg-server/hw/xquartz/Makefile.am4
-rw-r--r--xorg-server/hw/xquartz/bundle/cpprules.in22
-rw-r--r--xorg-server/hw/xquartz/doc/Makefile.am16
-rw-r--r--xorg-server/hw/xquartz/man/Makefile.am2
-rw-r--r--xorg-server/hw/xquartz/man/Xquartz.man (renamed from xorg-server/hw/xquartz/doc/Xquartz.man.pre)0
-rw-r--r--xorg-server/hw/xwin/Makefile.am429
-rw-r--r--xorg-server/hw/xwin/XWin.exe.manifest16
-rw-r--r--xorg-server/hw/xwin/man/Makefile.am3
-rw-r--r--xorg-server/hw/xwin/man/XWin.man (renamed from xorg-server/hw/xwin/XWin.man.pre)692
-rw-r--r--xorg-server/hw/xwin/man/XWinrc.man (renamed from xorg-server/hw/xwin/XWinrc.man.pre)0
-rw-r--r--xorg-server/include/scrnintstr.h1150
-rw-r--r--xorg-server/manpages.am37
-rw-r--r--xorg-server/xkb/ddxLoad.c930
53 files changed, 8902 insertions, 8795 deletions
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index 1ceffe7cb..45286eaf4 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -2213,7 +2213,9 @@ hw/xfree86/doc/sgml/Makefile
hw/xfree86/dri/Makefile
hw/xfree86/dri2/Makefile
hw/xfree86/exa/Makefile
+hw/xfree86/exa/man/Makefile
hw/xfree86/fbdevhw/Makefile
+hw/xfree86/fbdevhw/man/Makefile
hw/xfree86/i2c/Makefile
hw/xfree86/int10/Makefile
hw/xfree86/loader/Makefile
@@ -2233,27 +2235,34 @@ hw/xfree86/vgahw/Makefile
hw/xfree86/x86emu/Makefile
hw/xfree86/xaa/Makefile
hw/xfree86/utils/Makefile
+hw/xfree86/utils/man/Makefile
hw/xfree86/utils/cvt/Makefile
hw/xfree86/utils/gtf/Makefile
hw/dmx/config/Makefile
+hw/dmx/config/man/Makefile
hw/dmx/doc/Makefile
hw/dmx/examples/Makefile
hw/dmx/input/Makefile
hw/dmx/glxProxy/Makefile
hw/dmx/Makefile
+hw/dmx/man/Makefile
hw/vfb/Makefile
+hw/vfb/man/Makefile
hw/xnest/Makefile
+hw/xnest/man/Makefile
hw/xwin/Makefile
hw/xwin/glx/Makefile
+hw/xwin/man/Makefile
hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile
-hw/xquartz/doc/Makefile
+hw/xquartz/man/Makefile
hw/xquartz/mach-startup/Makefile
hw/xquartz/pbproxy/Makefile
hw/xquartz/xpr/Makefile
hw/kdrive/Makefile
hw/kdrive/ephyr/Makefile
+hw/kdrive/ephyr/man/Makefile
hw/kdrive/fake/Makefile
hw/kdrive/fbdev/Makefile
hw/kdrive/linux/Makefile
diff --git a/xorg-server/cpprules.in b/xorg-server/cpprules.in
deleted file mode 100644
index 6e435785a..000000000
--- a/xorg-server/cpprules.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- Makefile -*-
-# Rules for generating files using the C pre-processor
-# (Replaces CppFileTarget from Imake)
-
-SUFFIXES = .pre .man .man.pre
-
-# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
-# to cpp, because that trick does not work on all ANSI C preprocessors.
-# Delete line numbers from the cpp output (-P is not portable, I guess).
-# Allow XCOMM to be preceded by whitespace and provide a means of generating
-# output lines with trailing backslashes.
-# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
-
-CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
- -e '/^\#line *[0-9][0-9]* *.*$$/d' \
- -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
- -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
- -e '/^[ ]*XHASH/s/XHASH/\#/' \
- -e '/\@\@$$/s/\@\@$$/\\/'
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
- XSERVERNAME = Xorg
-
-MANDEFS = \
- -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
- -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
- -D__appmansuffix__=$(APP_MAN_SUFFIX) \
- -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
- -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
- -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
- -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
- -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
- -D__mandir__=$(mandir) \
- -D__projectroot__=$(prefix) \
- -D__sysconfdir__=$(sysconfdir) \
- -D__datadir__=$(datadir) \
- -D__xconfigfile__=$(__XCONFIGFILE__) \
- -D__xconfigdir__=$(__XCONFIGDIR__) \
- -D__xkbdir__=$(XKB_BASE_DIRECTORY) \
- -D__modulepath__="$(DEFAULT_MODULE_PATH)" \
- -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME)
-
-.pre:
- $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
-
-.man.pre.man:
- $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
diff --git a/xorg-server/doc/man/Makefile.am b/xorg-server/doc/man/Makefile.am
index 5259a104f..71d704917 100644
--- a/xorg-server/doc/man/Makefile.am
+++ b/xorg-server/doc/man/Makefile.am
@@ -1,20 +1,6 @@
-# Xserver.man covers options generic to all X servers built in this tree
-# (i.e. those handled in the os/utils.c options processing instead of in
-# the DDX-level options processing)
-
-appmandir = $(APP_MAN_DIR)
-appman_PRE = Xserver.man
-appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
-
-EXTRA_DIST = $(appman_PRE)
-CLEANFILES = $(appman_DATA)
-SUFFIXES = .$(APP_MAN_SUFFIX) .man
-
-# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
-# 's|/,|/, |g' will add a space to help font path formatting
-MAN_SUBSTS += -e 's|__datadir__|$(datadir)|g' \
- -e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \
- -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'
-
-.man.$(APP_MAN_SUFFIX):
- $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+# Xserver.man covers options generic to all X servers built in this tree
+# (i.e. those handled in the os/utils.c options processing instead of in
+# the DDX-level options processing)
+
+include $(top_srcdir)/manpages.am
+appman_PRE = Xserver.man
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index a685c8c7a..c14533805 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -1,2223 +1,2372 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * 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 including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * 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
- * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-
-#include "glheader.h"
-
-#endif
-
-#include <string.h>
-#include <assert.h>
-
-#include "glxserver.h"
-#include <GL/glxtokens.h>
-#include <unpack.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include "glxutil.h"
-#include "glxext.h"
-#include "glapitable.h"
-#include "glapi.h"
-#include "glthread.h"
-#include "dispatch.h"
-#include "indirect_dispatch.h"
-#include "indirect_table.h"
-#include "indirect_util.h"
-
-static int
-validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
-{
- /*
- ** Check if screen exists.
- */
- if (screen >= screenInfo.numScreens) {
- client->errorValue = screen;
- *err = BadValue;
- return FALSE;
- }
- *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
-
- return TRUE;
-}
-
-static int
-validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
- __GLXconfig **config, int *err)
-{
- __GLXconfig *m;
-
- for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next)
- if (m->fbconfigID == id) {
- *config = m;
- return TRUE;
- }
-
- client->errorValue = id;
- *err = __glXError(GLXBadFBConfig);
-
- return FALSE;
-}
-
-static int
-validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
- __GLXconfig **config, int *err)
-{
- int i;
-
- for (i = 0; i < pGlxScreen->numVisuals; i++)
- if (pGlxScreen->visuals[i]->visualID == id) {
- *config = pGlxScreen->visuals[i];
- return TRUE;
- }
-
- client->errorValue = id;
- *err = BadValue;
-
- return FALSE;
-}
-
-static int
-validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config,
- DrawablePtr pDraw, int *err)
-{
- ScreenPtr pScreen = pDraw->pScreen;
- VisualPtr pVisual = NULL;
- XID vid;
- int i;
-
- vid = wVisual((WindowPtr)pDraw);
- for (i = 0; i < pScreen->numVisuals; i++) {
- if (pScreen->visuals[i].vid == vid) {
- pVisual = &pScreen->visuals[i];
- break;
- }
- }
-
- /* FIXME: What exactly should we check here... */
- if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
- !(config->drawableType & GLX_WINDOW_BIT)) {
- client->errorValue = pDraw->id;
- *err = BadMatch;
- return FALSE;
- }
-
- return TRUE;
-}
-
-static int
-validGlxContext(ClientPtr client, XID id, int access_mode,
- struct glx_context **context, int *err)
-{
- *err = dixLookupResourceByType((pointer *) context, id,
- __glXContextRes, client, access_mode);
- if (*err != Success) {
- client->errorValue = id;
- if (*err == BadValue)
- *err = __glXError(GLXBadContext);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static int
-validGlxDrawable(ClientPtr client, XID id, int type, int access_mode,
- __GLXdrawable **drawable, int *err)
-{
- int rc;
-
- rc = dixLookupResourceByType((pointer *) drawable, id,
- __glXDrawableRes, client, access_mode);
- if (rc != Success && rc != BadValue) {
- *err = rc;
- client->errorValue = id;
- return FALSE;
- }
-
- /* If the ID of the glx drawable we looked up doesn't match the id
- * we looked for, it's because we looked it up under the X
- * drawable ID (see DoCreateGLXDrawable). */
- if (rc == BadValue ||
- (*drawable)->drawId != id ||
- (type != GLX_DRAWABLE_ANY && type != (*drawable)->type)) {
- client->errorValue = id;
- switch (type) {
- case GLX_DRAWABLE_WINDOW:
- *err = __glXError(GLXBadWindow);
- return FALSE;
- case GLX_DRAWABLE_PIXMAP:
- *err = __glXError(GLXBadPixmap);
- return FALSE;
- case GLX_DRAWABLE_PBUFFER:
- *err = __glXError(GLXBadPbuffer);
- return FALSE;
- case GLX_DRAWABLE_ANY:
- *err = __glXError(GLXBadDrawable);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-void
-__glXContextDestroy(struct glx_context *context)
-{
- __glXFlushContextCache();
-}
-
-static void __glXdirectContextDestroy(struct glx_context *context)
-{
- __glXContextDestroy(context);
- free(context);
-}
-
-static struct glx_context *__glXdirectContextCreate(__GLXscreen *screen,
- __GLXconfig *modes,
- struct glx_context *shareContext)
-{
- struct glx_context *context;
-
- context = calloc(1, sizeof (struct glx_context));
- if (context == NULL)
- return NULL;
-
- context->destroy = __glXdirectContextDestroy;
-
- return context;
-}
-
-void FlushContext(struct glx_context *cx)
-{
- CALL_Flush( GET_DISPATCH(), () );
- __GLX_NOTE_FLUSHED_CMDS(cx);
-}
-
-/**
- * Create a GL context with the given properties. This routine is used
- * to implement \c glXCreateContext, \c glXCreateNewContext, and
- * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way
- * that GLXFBConfigs are implemented. Basically, the FBConfigID is the
- * same as the VisualID.
- */
-
-static int
-DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
- GLXContextID shareList, __GLXconfig *config,
- __GLXscreen *pGlxScreen, GLboolean isDirect)
-{
- ClientPtr client = cl->client;
- struct glx_context *glxc, *shareglxc;
- int err;
-
- LEGAL_NEW_RESOURCE(gcId, client);
-
- /*
- ** Find the display list space that we want to share.
- **
- ** NOTE: In a multithreaded X server, we would need to keep a reference
- ** count for each display list so that if one client detroyed a list that
- ** another client was using, the list would not really be freed until it
- ** was no longer in use. Since this sample implementation has no support
- ** for multithreaded servers, we don't do this.
- */
- if (shareList == None) {
- shareglxc = 0;
- } else {
- if (!validGlxContext(client, shareList, DixReadAccess,
- &shareglxc, &err))
- return err;
-
- if (shareglxc->isDirect) {
- /*
- ** NOTE: no support for sharing display lists between direct
- ** contexts, even if they are in the same address space.
- */
-#if 0
- /* Disabling this code seems to allow shared display lists
- * and texture objects to work. We'll leave it disabled for now.
- */
- client->errorValue = shareList;
- return BadMatch;
-#endif
- } else {
- /*
- ** Create an indirect context regardless of what the client asked
- ** for; this way we can share display list space with shareList.
- */
- isDirect = GL_FALSE;
- }
- }
-
- /*
- ** Allocate memory for the new context
- */
- if (!isDirect)
- glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc);
- else
- glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc);
- if (!glxc) {
- return BadAlloc;
- }
-
- /*
- ** Initially, setup the part of the context that could be used by
- ** a GL core that needs windowing information (e.g., Mesa).
- */
- glxc->pGlxScreen = pGlxScreen;
- glxc->config = config;
-
- /*
- ** Register this context as a resource.
- */
- if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
- (*glxc->destroy)(glxc);
- client->errorValue = gcId;
- return BadAlloc;
- }
-
- /*
- ** Finally, now that everything is working, setup the rest of the
- ** context.
- */
- glxc->id = gcId;
- glxc->share_id = shareList;
- glxc->idExists = GL_TRUE;
- glxc->isCurrent = GL_FALSE;
- glxc->isDirect = isDirect;
- glxc->renderMode = GL_RENDER;
-
- __glXAddToContextList(glxc);
-
- return Success;
-}
-
-int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
- return err;
-
- return DoCreateContext(cl, req->context, req->shareList,
- config, pGlxScreen, req->isDirect);
-}
-
-int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
- return err;
-
- return DoCreateContext(cl, req->context, req->shareList,
- config, pGlxScreen, req->isDirect);
-}
-
-int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateContextWithConfigSGIXReq *req =
- (xGLXCreateContextWithConfigSGIXReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
- return err;
-
- return DoCreateContext(cl, req->context, req->shareList,
- config, pGlxScreen, req->isDirect);
-}
-int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
- struct glx_context *glxc;
- int err;
-
- if (!validGlxContext(cl->client, req->context, DixDestroyAccess,
- &glxc, &err))
- return err;
-
- FreeResourceByType(req->context, __glXContextRes, FALSE);
- return Success;
-}
-
-/*****************************************************************************/
-
-/*
-** For each client, the server keeps a table of all the contexts that are
-** current for that client (each thread of a client may have its own current
-** context). These routines add, change, and lookup contexts in the table.
-*/
-
-/*
-** Add a current context, and return the tag that will be used to refer to it.
-*/
-static int AddCurrentContext(__GLXclientState *cl, struct glx_context *glxc)
-{
- int i;
- int num = cl->numCurrentContexts;
- struct glx_context **table = cl->currentContexts;
-
- if (!glxc) return -1;
-
- /*
- ** Try to find an empty slot and use it.
- */
- for (i=0; i < num; i++) {
- if (!table[i]) {
- table[i] = glxc;
- return i+1;
- }
- }
- /*
- ** Didn't find a free slot, so we'll have to grow the table.
- */
- if (!num) {
- table = (struct glx_context **) malloc(sizeof(struct glx_context *));
- } else {
- table = (struct glx_context **) realloc(table,
- (num+1)*sizeof(struct glx_context *));
- }
- table[num] = glxc;
- cl->currentContexts = table;
- cl->numCurrentContexts++;
- return num+1;
-}
-
-/*
-** Given a tag, change the current context for the corresponding entry.
-*/
-static void ChangeCurrentContext(__GLXclientState *cl, struct glx_context *glxc,
- GLXContextTag tag)
-{
- struct glx_context **table = cl->currentContexts;
- table[tag-1] = glxc;
-}
-
-/*
-** For this implementation we have chosen to simply use the index of the
-** context's entry in the table as the context tag. A tag must be greater
-** than 0.
-*/
-struct glx_context *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
-{
- int num = cl->numCurrentContexts;
-
- if (tag < 1 || tag > num) {
- return 0;
- } else {
- return cl->currentContexts[tag-1];
- }
-}
-
-/*****************************************************************************/
-
-static void StopUsingContext(struct glx_context *glxc)
-{
- if (glxc) {
- if (glxc == __glXLastContext) {
- /* Tell server GL library */
- __glXLastContext = 0;
- }
- glxc->isCurrent = GL_FALSE;
- if (!glxc->idExists) {
- __glXFreeContext(glxc);
- }
- }
-}
-
-static void StartUsingContext(__GLXclientState *cl, struct glx_context *glxc)
-{
- glxc->isCurrent = GL_TRUE;
- __glXLastContext = glxc;
-}
-
-/**
- * This is a helper function to handle the legacy (pre GLX 1.3) cases
- * where passing an X window to glXMakeCurrent is valid. Given a
- * resource ID, look up the GLX drawable if available, otherwise, make
- * sure it's an X window and create a GLX drawable one the fly.
- */
-static __GLXdrawable *
-__glXGetDrawable(struct glx_context *glxc, GLXDrawable drawId, ClientPtr client,
- int *error)
-{
- DrawablePtr pDraw;
- __GLXdrawable *pGlxDraw;
- int rc;
-
- if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
- DixWriteAccess, &pGlxDraw, &rc)) {
- if (glxc != NULL && pGlxDraw->config != glxc->config) {
- client->errorValue = drawId;
- *error = BadMatch;
- return NULL;
- }
-
- return pGlxDraw;
- }
-
- /* No active context and an unknown drawable, bail. */
- if (glxc == NULL) {
- client->errorValue = drawId;
- *error = BadMatch;
- return NULL;
- }
-
- /* The drawId wasn't a GLX drawable. Make sure it's a window and
- * create a GLXWindow for it. Check that the drawable screen
- * matches the context screen and that the context fbconfig is
- * compatible with the window visual. */
-
- rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
- if (rc != Success || pDraw->type != DRAWABLE_WINDOW) {
- client->errorValue = drawId;
- *error = __glXError(GLXBadDrawable);
- return NULL;
- }
-
- if (!glxc || pDraw->pScreen != glxc->pGlxScreen->pScreen) {
- client->errorValue = pDraw->pScreen->myNum;
- *error = BadMatch;
- return NULL;
- }
-
- if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error))
- return NULL;
-
- pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen,
- pDraw, drawId,
- GLX_DRAWABLE_WINDOW,
- drawId, glxc->config);
-
- /* since we are creating the drawablePrivate, drawId should be new */
- if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy (pGlxDraw);
- *error = BadAlloc;
- return NULL;
- }
-
- return pGlxDraw;
-}
-
-/*****************************************************************************/
-/*
-** Make an OpenGL context and drawable current.
-*/
-
-static int
-DoMakeCurrent(__GLXclientState *cl,
- GLXDrawable drawId, GLXDrawable readId,
- GLXContextID contextId, GLXContextTag tag)
-{
- ClientPtr client = cl->client;
- xGLXMakeCurrentReply reply;
- struct glx_context *glxc, *prevglxc;
- __GLXdrawable *drawPriv = NULL;
- __GLXdrawable *readPriv = NULL;
- int error;
- GLuint mask;
-
- /*
- ** If one is None and the other isn't, it's a bad match.
- */
-
- mask = (drawId == None) ? (1 << 0) : 0;
- mask |= (readId == None) ? (1 << 1) : 0;
- mask |= (contextId == None) ? (1 << 2) : 0;
-
- if ( (mask != 0x00) && (mask != 0x07) ) {
- return BadMatch;
- }
-
- /*
- ** Lookup old context. If we have one, it must be in a usable state.
- */
- if (tag != 0) {
- prevglxc = __glXLookupContextByTag(cl, tag);
- if (!prevglxc) {
- /*
- ** Tag for previous context is invalid.
- */
- return __glXError(GLXBadContextTag);
- }
- if (prevglxc->renderMode != GL_RENDER) {
- /* Oops. Not in render mode render. */
- client->errorValue = prevglxc->id;
- return __glXError(GLXBadContextState);
- }
- } else {
- prevglxc = 0;
- }
-
- /*
- ** Lookup new context. It must not be current for someone else.
- */
- if (contextId != None) {
- int status;
-
- if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error))
- return error;
- if ((glxc != prevglxc) && glxc->isCurrent) {
- /* Context is current to somebody else */
- return BadAccess;
- }
-
- assert( drawId != None );
- assert( readId != None );
-
- drawPriv = __glXGetDrawable(glxc, drawId, client, &status);
- if (drawPriv == NULL)
- return status;
-
- readPriv = __glXGetDrawable(glxc, readId, client, &status);
- if (readPriv == NULL)
- return status;
-
- } else {
- /* Switching to no context. Ignore new drawable. */
- glxc = 0;
- drawPriv = 0;
- readPriv = 0;
- }
-
-
- if (prevglxc) {
- /*
- ** Flush the previous context if needed.
- */
- if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
- if (__glXForceCurrent(cl, tag, (int *)&error)) {
- CALL_Flush( GET_DISPATCH(), () );
- __GLX_NOTE_FLUSHED_CMDS(prevglxc);
- } else {
- return error;
- }
- }
-
- /*
- ** Make the previous context not current.
- */
- if (!(*prevglxc->loseCurrent)(prevglxc)) {
- return __glXError(GLXBadContext);
- }
- __glXFlushContextCache();
- if (!prevglxc->isDirect) {
- prevglxc->drawPriv = NULL;
- prevglxc->readPriv = NULL;
- }
- }
-
-
- if ((glxc != 0) && !glxc->isDirect) {
-
- glxc->drawPriv = drawPriv;
- glxc->readPriv = readPriv;
-
- /* make the context current */
- if (!(*glxc->makeCurrent)(glxc)) {
- glxc->drawPriv = NULL;
- glxc->readPriv = NULL;
- return __glXError(GLXBadContext);
- }
-
- glxc->isCurrent = GL_TRUE;
- }
-
- if (prevglxc) {
- ChangeCurrentContext(cl, glxc, tag);
- StopUsingContext(prevglxc);
- } else {
- tag = AddCurrentContext(cl, glxc);
- }
-
- if (glxc) {
- StartUsingContext(cl, glxc);
- reply.contextTag = tag;
- } else {
- reply.contextTag = 0;
- }
-
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapMakeCurrentReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply);
- }
- return Success;
-}
-
-int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->drawable,
- req->context, req->oldContextTag );
-}
-
-int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->readdrawable,
- req->context, req->oldContextTag );
-}
-
-int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
-
- return DoMakeCurrent( cl, req->drawable, req->readable,
- req->context, req->oldContextTag );
-}
-
-int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
- xGLXIsDirectReply reply;
- struct glx_context *glxc;
- int err;
-
- if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
- return err;
-
- reply.isDirect = glxc->isDirect;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapIsDirectReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
- }
-
- return Success;
-}
-
-int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
- xGLXQueryVersionReply reply;
- GLuint major, minor;
-
- major = req->majorVersion;
- minor = req->minorVersion;
- (void)major;
- (void)minor;
-
- /*
- ** Server should take into consideration the version numbers sent by the
- ** client if it wants to work with older clients; however, in this
- ** implementation the server just returns its version number.
- */
- reply.majorVersion = glxMajorVersion;
- reply.minorVersion = glxMinorVersion;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __glXSwapQueryVersionReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply);
- }
- return Success;
-}
-
-int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
- GLXContextTag tag = req->contextTag;
- struct glx_context *glxc = NULL;
- int error;
-
- if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc)
- return __glXError(GLXBadContextTag);
-
- if (!__glXForceCurrent(cl, req->contextTag, &error))
- return error;
-
- CALL_Finish( GET_DISPATCH(), () );
- }
-
- if (glxc && glxc->drawPriv->waitGL)
- (*glxc->drawPriv->waitGL)(glxc->drawPriv);
-
- return Success;
-}
-
-int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
- GLXContextTag tag = req->contextTag;
- struct glx_context *glxc = NULL;
- int error;
-
- if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc)
- return __glXError(GLXBadContextTag);
-
- if (!__glXForceCurrent(cl, req->contextTag, &error))
- return error;
- }
-
- if (glxc && glxc->drawPriv->waitX)
- (*glxc->drawPriv->waitX)(glxc->drawPriv);
-
- return Success;
-}
-
-int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
- GLXContextID source = req->source;
- GLXContextID dest = req->dest;
- GLXContextTag tag = req->contextTag;
- unsigned long mask = req->mask;
- struct glx_context *src, *dst;
- int error;
-
- if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error))
- return error;
- if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error))
- return error;
-
- /*
- ** They must be in the same address space, and same screen.
- ** NOTE: no support for direct rendering contexts here.
- */
- if (src->isDirect || dst->isDirect ||
- (src->pGlxScreen != dst->pGlxScreen)) {
- client->errorValue = source;
- return BadMatch;
- }
-
- /*
- ** The destination context must not be current for any client.
- */
- if (dst->isCurrent) {
- client->errorValue = dest;
- return BadAccess;
- }
-
- if (tag) {
- struct glx_context *tagcx = __glXLookupContextByTag(cl, tag);
-
- if (!tagcx) {
- return __glXError(GLXBadContextTag);
- }
- if (tagcx != src) {
- /*
- ** This would be caused by a faulty implementation of the client
- ** library.
- */
- return BadMatch;
- }
- /*
- ** In this case, glXCopyContext is in both GL and X streams, in terms
- ** of sequentiality.
- */
- if (__glXForceCurrent(cl, tag, &error)) {
- /*
- ** Do whatever is needed to make sure that all preceding requests
- ** in both streams are completed before the copy is executed.
- */
- CALL_Finish( GET_DISPATCH(), () );
- __GLX_NOTE_FLUSHED_CMDS(tagcx);
- } else {
- return error;
- }
- }
- /*
- ** Issue copy. The only reason for failure is a bad mask.
- */
- if (!(*dst->copy)(dst, src, mask)) {
- client->errorValue = mask;
- return BadValue;
- }
- return Success;
-}
-
-enum {
- GLX_VIS_CONFIG_UNPAIRED = 18,
- GLX_VIS_CONFIG_PAIRED = 20
-};
-
-enum {
- GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED
-};
-
-int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
- ClientPtr client = cl->client;
- xGLXGetVisualConfigsReply reply;
- __GLXscreen *pGlxScreen;
- __GLXconfig *modes;
- CARD32 buf[GLX_VIS_CONFIG_TOTAL];
- int p, i, err;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
-
- reply.numVisuals = pGlxScreen->numVisuals;
- reply.numProps = GLX_VIS_CONFIG_TOTAL;
- reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
- __GLX_SWAP_INT(&reply.numVisuals);
- __GLX_SWAP_INT(&reply.numProps);
- }
-
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
-
- for (i = 0; i < pGlxScreen->numVisuals; i++) {
- modes = pGlxScreen->visuals[i];
-
- p = 0;
- buf[p++] = modes->visualID;
- buf[p++] = glxConvertToXVisualType( modes->visualType );
- buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE;
-
- buf[p++] = modes->redBits;
- buf[p++] = modes->greenBits;
- buf[p++] = modes->blueBits;
- buf[p++] = modes->alphaBits;
- buf[p++] = modes->accumRedBits;
- buf[p++] = modes->accumGreenBits;
- buf[p++] = modes->accumBlueBits;
- buf[p++] = modes->accumAlphaBits;
-
- buf[p++] = modes->doubleBufferMode;
- buf[p++] = modes->stereoMode;
-
- buf[p++] = modes->rgbBits;
- buf[p++] = modes->depthBits;
- buf[p++] = modes->stencilBits;
- buf[p++] = modes->numAuxBuffers;
- buf[p++] = modes->level;
-
- assert(p == GLX_VIS_CONFIG_UNPAIRED);
- /*
- ** Add token/value pairs for extensions.
- */
- buf[p++] = GLX_VISUAL_CAVEAT_EXT;
- buf[p++] = modes->visualRating;
- buf[p++] = GLX_TRANSPARENT_TYPE;
- buf[p++] = modes->transparentPixel;
- buf[p++] = GLX_TRANSPARENT_RED_VALUE;
- buf[p++] = modes->transparentRed;
- buf[p++] = GLX_TRANSPARENT_GREEN_VALUE;
- buf[p++] = modes->transparentGreen;
- buf[p++] = GLX_TRANSPARENT_BLUE_VALUE;
- buf[p++] = modes->transparentBlue;
- buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE;
- buf[p++] = modes->transparentAlpha;
- buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
- buf[p++] = modes->transparentIndex;
- buf[p++] = GLX_SAMPLES_SGIS;
- buf[p++] = modes->samples;
- buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
- buf[p++] = modes->sampleBuffers;
- buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
- buf[p++] = 0;
-
- assert(p == GLX_VIS_CONFIG_TOTAL);
- if (client->swapped) {
- __GLX_SWAP_INT_ARRAY(buf, p);
- }
- WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *)buf);
- }
- return Success;
-}
-
-#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)
-#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
-/**
- * Send the set of GLXFBConfigs to the client. There is not currently
- * and interface into the driver on the server-side to get GLXFBConfigs,
- * so we "invent" some based on the \c __GLXvisualConfig structures that
- * the driver does supply.
- *
- * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX
- * is the same, so this routine pulls double duty.
- */
-
-static int
-DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
-{
- ClientPtr client = cl->client;
- xGLXGetFBConfigsReply reply;
- __GLXscreen *pGlxScreen;
- CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
- int p, err;
- __GLXconfig *modes;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err))
- return err;
-
- reply.numFBConfigs = pGlxScreen->numFBConfigs;
- reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS;
- reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs);
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
- if (client->swapped) {
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
- __GLX_SWAP_INT(&reply.numFBConfigs);
- __GLX_SWAP_INT(&reply.numAttribs);
- }
-
- WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply);
-
- for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) {
- p = 0;
-
-#define WRITE_PAIR(tag,value) \
- do { buf[p++] = tag ; buf[p++] = value ; } while( 0 )
-
- WRITE_PAIR( GLX_VISUAL_ID, modes->visualID );
- WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID );
- WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE );
-
- WRITE_PAIR( GLX_RGBA,
- (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE );
- WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType );
- WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode );
- WRITE_PAIR( GLX_STEREO, modes->stereoMode );
-
- WRITE_PAIR( GLX_BUFFER_SIZE, modes->rgbBits );
- WRITE_PAIR( GLX_LEVEL, modes->level );
- WRITE_PAIR( GLX_AUX_BUFFERS, modes->numAuxBuffers );
- WRITE_PAIR( GLX_RED_SIZE, modes->redBits );
- WRITE_PAIR( GLX_GREEN_SIZE, modes->greenBits );
- WRITE_PAIR( GLX_BLUE_SIZE, modes->blueBits );
- WRITE_PAIR( GLX_ALPHA_SIZE, modes->alphaBits );
- WRITE_PAIR( GLX_ACCUM_RED_SIZE, modes->accumRedBits );
- WRITE_PAIR( GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits );
- WRITE_PAIR( GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits );
- WRITE_PAIR( GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits );
- WRITE_PAIR( GLX_DEPTH_SIZE, modes->depthBits );
- WRITE_PAIR( GLX_STENCIL_SIZE, modes->stencilBits );
- WRITE_PAIR( GLX_X_VISUAL_TYPE, modes->visualType );
- WRITE_PAIR( GLX_CONFIG_CAVEAT, modes->visualRating );
- WRITE_PAIR( GLX_TRANSPARENT_TYPE, modes->transparentPixel );
- WRITE_PAIR( GLX_TRANSPARENT_RED_VALUE, modes->transparentRed );
- WRITE_PAIR( GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen );
- WRITE_PAIR( GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue );
- WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
- WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
- WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
- WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples );
- WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers );
- /* GLX_VISUAL_SELECT_GROUP_SGIX ? */
- WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType );
- WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb );
- WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba );
- WRITE_PAIR( GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture );
- WRITE_PAIR( GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets );
-
- if (client->swapped) {
- __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);
- }
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH,
- (char *)buf);
- }
- return Success;
-}
-
-
-int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
- return DoGetFBConfigs(cl, req->screen);
-}
-
-int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
- return DoGetFBConfigs(cl, req->screen);
-}
-
-GLboolean
-__glXDrawableInit(__GLXdrawable *drawable,
- __GLXscreen *screen, DrawablePtr pDraw, int type,
- XID drawId, __GLXconfig *config)
-{
- drawable->pDraw = pDraw;
- drawable->type = type;
- drawable->drawId = drawId;
- drawable->config = config;
- drawable->eventMask = 0;
-
- return GL_TRUE;
-}
-
-void
-__glXDrawableRelease(__GLXdrawable *drawable)
-{
-}
-
-static int
-DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen,
- __GLXconfig *config, DrawablePtr pDraw, XID drawableId,
- XID glxDrawableId, int type)
-{
- __GLXdrawable *pGlxDraw;
-
- if (pGlxScreen->pScreen != pDraw->pScreen)
- return BadMatch;
-
- pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw,
- drawableId, type,
- glxDrawableId, config);
- if (pGlxDraw == NULL)
- return BadAlloc;
-
- if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy (pGlxDraw);
- return BadAlloc;
- }
-
- /* Add the glx drawable under the XID of the underlying X drawable
- * too. That way we'll get a callback in DrawableGone and can
- * clean up properly when the drawable is destroyed. */
- if (drawableId != glxDrawableId &&
- !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
- pGlxDraw->destroy (pGlxDraw);
- return BadAlloc;
- }
-
- return Success;
-}
-
-static int
-DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config,
- XID drawableId, XID glxDrawableId)
-{
- DrawablePtr pDraw;
- int err;
-
- LEGAL_NEW_RESOURCE(glxDrawableId, client);
-
- err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess);
- if (err != Success) {
- client->errorValue = drawableId;
- return err;
- }
- if (pDraw->type != DRAWABLE_PIXMAP) {
- client->errorValue = drawableId;
- return BadPixmap;
- }
-
- err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId,
- glxDrawableId, GLX_DRAWABLE_PIXMAP);
-
- return err;
-}
-
-static void
-determineTextureTarget(ClientPtr client, XID glxDrawableID,
- CARD32 *attribs, CARD32 numAttribs)
-{
- GLenum target = 0;
- GLenum format = 0;
- int i, err;
- __GLXdrawable *pGlxDraw;
-
- if (!validGlxDrawable(client, glxDrawableID, GLX_DRAWABLE_PIXMAP,
- DixWriteAccess, &pGlxDraw, &err))
- /* We just added it in CreatePixmap, so we should never get here. */
- return;
-
- for (i = 0; i < numAttribs; i++) {
- if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) {
- switch (attribs[2 * i + 1]) {
- case GLX_TEXTURE_2D_EXT:
- target = GL_TEXTURE_2D;
- break;
- case GLX_TEXTURE_RECTANGLE_EXT:
- target = GL_TEXTURE_RECTANGLE_ARB;
- break;
- }
- }
-
- if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
- format = attribs[2 * i + 1];
- }
-
- if (!target) {
- int w = pGlxDraw->pDraw->width, h = pGlxDraw->pDraw->height;
-
- if (h & (h - 1) || w & (w - 1))
- target = GL_TEXTURE_RECTANGLE_ARB;
- else
- target = GL_TEXTURE_2D;
- }
-
- pGlxDraw->target = target;
- pGlxDraw->format = format;
-}
-
-int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
- return err;
-
- return DoCreateGLXPixmap(cl->client, pGlxScreen, config,
- req->pixmap, req->glxpixmap);
-}
-
-int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
- return err;
-
- err = DoCreateGLXPixmap(cl->client, pGlxScreen, config,
- req->pixmap, req->glxpixmap);
- if (err != Success)
- return err;
-
- determineTextureTarget(cl->client, req->glxpixmap,
- (CARD32*) (req + 1), req->numAttribs);
-
- return Success;
-}
-
-int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPixmapWithConfigSGIXReq *req =
- (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- int err;
-
- if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
- return err;
-
- return DoCreateGLXPixmap(cl->client, pGlxScreen,
- config, req->pixmap, req->glxpixmap);
-}
-
-
-static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
-{
- __GLXdrawable *pGlxDraw;
- int err;
-
- if (!validGlxDrawable(cl->client, glxdrawable, type,
- DixDestroyAccess, &pGlxDraw, &err))
- return err;
-
- FreeResource(glxdrawable, FALSE);
-
- return Success;
-}
-
-int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
-
- return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
-}
-
-int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
-
- return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
-}
-
-static int
-DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
- int width, int height, XID glxDrawableId)
-{
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- PixmapPtr pPixmap;
- int err;
-
- LEGAL_NEW_RESOURCE(glxDrawableId, client);
-
- if (!validGlxScreen(client, screenNum, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err))
- return err;
-
- __glXenterServer(GL_FALSE);
- pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen,
- width, height, config->rgbBits, 0);
- __glXleaveServer(GL_FALSE);
-
- /* Assign the pixmap the same id as the pbuffer and add it as a
- * resource so it and the DRI2 drawable will be reclaimed when the
- * pbuffer is destroyed. */
- pPixmap->drawable.id = glxDrawableId;
- if (!AddResource(pPixmap->drawable.id, RT_PIXMAP, pPixmap))
- return BadAlloc;
-
- return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable,
- glxDrawableId, glxDrawableId,
- GLX_DRAWABLE_PBUFFER);
-}
-
-int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
- CARD32 *attrs;
- int width, height, i;
-
- attrs = (CARD32 *) (req + 1);
- width = 0;
- height = 0;
-
- for (i = 0; i < req->numAttribs; i++) {
- switch (attrs[i * 2]) {
- case GLX_PBUFFER_WIDTH:
- width = attrs[i * 2 + 1];
- break;
- case GLX_PBUFFER_HEIGHT:
- height = attrs[i * 2 + 1];
- break;
- case GLX_LARGEST_PBUFFER:
- case GLX_PRESERVED_CONTENTS:
- /* FIXME: huh... */
- break;
- }
- }
-
- return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
- width, height, req->pbuffer);
-}
-
-int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
-
- return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
- req->width, req->height, req->pbuffer);
-}
-
-int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
-
- return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
-}
-
-int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
-
- return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
-}
-
-static int
-DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable,
- int numAttribs, CARD32 *attribs)
-{
- __GLXdrawable *pGlxDraw;
- int i, err;
-
- if (!validGlxDrawable(client, glxdrawable, GLX_DRAWABLE_ANY,
- DixSetAttrAccess, &pGlxDraw, &err))
- return err;
-
- for (i = 0; i < numAttribs; i++) {
- switch(attribs[i * 2]) {
- case GLX_EVENT_MASK:
- /* All we do is to record the event mask so we can send it
- * back when queried. We never actually clobber the
- * pbuffers, so we never need to send out the event. */
- pGlxDraw->eventMask = attribs[i * 2 + 1];
- break;
- }
- }
-
- return Success;
-}
-
-int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXChangeDrawableAttributesReq *req =
- (xGLXChangeDrawableAttributesReq *) pc;
-
- return DoChangeDrawableAttributes(cl->client, req->drawable,
- req->numAttribs, (CARD32 *) (req + 1));
-}
-
-int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXChangeDrawableAttributesSGIXReq *req =
- (xGLXChangeDrawableAttributesSGIXReq *)pc;
-
- return DoChangeDrawableAttributes(cl->client, req->drawable,
- req->numAttribs, (CARD32 *) (req + 1));
-}
-
-int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
- __GLXconfig *config;
- __GLXscreen *pGlxScreen;
- ClientPtr client = cl->client;
- DrawablePtr pDraw;
- int err;
-
- LEGAL_NEW_RESOURCE(req->glxwindow, client);
-
- if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
- return err;
- if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err))
- return err;
-
- err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess);
- if (err != Success || pDraw->type != DRAWABLE_WINDOW) {
- client->errorValue = req->window;
- return BadWindow;
- }
-
- if (!validGlxFBConfigForWindow(client, config, pDraw, &err))
- return err;
-
- return DoCreateGLXDrawable(client, pGlxScreen, config,
- pDraw, req->window,
- req->glxwindow, GLX_DRAWABLE_WINDOW);
-}
-
-int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
-
- return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW);
-}
-
-
-/*****************************************************************************/
-
-/*
-** NOTE: There is no portable implementation for swap buffers as of
-** this time that is of value. Consequently, this code must be
-** implemented by somebody other than SGI.
-*/
-int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
- GLXContextTag tag = req->contextTag;
- XID drawId = req->drawable;
- struct glx_context *glxc = NULL;
- __GLXdrawable *pGlxDraw;
- int error;
-
- if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc) {
- return __glXError(GLXBadContextTag);
- }
- /*
- ** The calling thread is swapping its current drawable. In this case,
- ** glxSwapBuffers is in both GL and X streams, in terms of
- ** sequentiality.
- */
- if (__glXForceCurrent(cl, tag, &error)) {
- /*
- ** Do whatever is needed to make sure that all preceding requests
- ** in both streams are completed before the swap is executed.
- */
- CALL_Finish( GET_DISPATCH(), () );
- __GLX_NOTE_FLUSHED_CMDS(glxc);
- } else {
- return error;
- }
- }
-
- pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error);
- if (pGlxDraw == NULL)
- return error;
-
- if (pGlxDraw->type == DRAWABLE_WINDOW &&
- (*pGlxDraw->swapBuffers)(cl->client, pGlxDraw) == GL_FALSE)
- return __glXError(GLXBadDrawable);
-
- return Success;
-}
-
-
-static int
-DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
-{
- ClientPtr client = cl->client;
- struct glx_context *ctx;
- xGLXQueryContextInfoEXTReply reply;
- int nProps;
- int *sendBuf, *pSendBuf;
- int nReplyBytes;
- int err;
-
- if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err))
- return err;
-
- nProps = 3;
- reply.length = nProps << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.n = nProps;
-
- nReplyBytes = reply.length << 2;
- sendBuf = (int *)malloc((size_t)nReplyBytes);
- if (sendBuf == NULL) {
- return __glXError(GLXBadContext); /* XXX: Is this correct? */
- }
- pSendBuf = sendBuf;
- *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
- *pSendBuf++ = (int)(ctx->share_id);
- *pSendBuf++ = GLX_VISUAL_ID_EXT;
- *pSendBuf++ = (int)(ctx->config->visualID);
- *pSendBuf++ = GLX_SCREEN_EXT;
- *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum);
-
- if (client->swapped) {
- __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
- } else {
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
- WriteToClient(client, nReplyBytes, (char *)sendBuf);
- }
- free((char *)sendBuf);
-
- return Success;
-}
-
-int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
-
- return DoQueryContext(cl, req->context);
-}
-
-int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
-
- return DoQueryContext(cl, req->context);
-}
-
-int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- ClientPtr client = cl->client;
- struct glx_context *context;
- __GLXdrawable *pGlxDraw;
- GLXDrawable drawId;
- int buffer;
- int error;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- drawId = *((CARD32 *) (pc));
- buffer = *((INT32 *) (pc + 4));
-
- if (buffer != GLX_FRONT_LEFT_EXT)
- return __glXError(GLXBadPixmap);
-
- context = __glXForceCurrent (cl, req->contextTag, &error);
- if (!context)
- return error;
-
- if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP,
- DixReadAccess, &pGlxDraw, &error))
- return error;
-
- if (!context->textureFromPixmap)
- return __glXError(GLXUnsupportedPrivateRequest);
-
- return context->textureFromPixmap->bindTexImage(context,
- buffer,
- pGlxDraw);
-}
-
-int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- ClientPtr client = cl->client;
- __GLXdrawable *pGlxDraw;
- struct glx_context *context;
- GLXDrawable drawId;
- int buffer;
- int error;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- drawId = *((CARD32 *) (pc));
- buffer = *((INT32 *) (pc + 4));
-
- context = __glXForceCurrent (cl, req->contextTag, &error);
- if (!context)
- return error;
-
- if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP,
- DixReadAccess, &pGlxDraw, &error))
- return error;
-
- if (!context->textureFromPixmap)
- return __glXError(GLXUnsupportedPrivateRequest);
-
- return context->textureFromPixmap->releaseTexImage(context,
- buffer,
- pGlxDraw);
-}
-
-int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLXContextTag tag = req->contextTag;
- struct glx_context *glxc = NULL;
- __GLXdrawable *pGlxDraw;
- ClientPtr client = cl->client;
- GLXDrawable drawId;
- int error;
- int x, y, width, height;
-
- (void) client;
- (void) req;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- drawId = *((CARD32 *) (pc));
- x = *((INT32 *) (pc + 4));
- y = *((INT32 *) (pc + 8));
- width = *((INT32 *) (pc + 12));
- height = *((INT32 *) (pc + 16));
-
- if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc) {
- return __glXError(GLXBadContextTag);
- }
- /*
- ** The calling thread is swapping its current drawable. In this case,
- ** glxSwapBuffers is in both GL and X streams, in terms of
- ** sequentiality.
- */
- if (__glXForceCurrent(cl, tag, &error)) {
- /*
- ** Do whatever is needed to make sure that all preceding requests
- ** in both streams are completed before the swap is executed.
- */
- CALL_Finish( GET_DISPATCH(), () );
- __GLX_NOTE_FLUSHED_CMDS(glxc);
- } else {
- return error;
- }
- }
-
- pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error);
- if (!pGlxDraw)
- return error;
-
- if (pGlxDraw == NULL ||
- pGlxDraw->type != GLX_DRAWABLE_WINDOW ||
- pGlxDraw->copySubBuffer == NULL)
- return __glXError(GLXBadDrawable);
-
- (*pGlxDraw->copySubBuffer)(pGlxDraw, x, y, width, height);
-
- return Success;
-}
-
-/*
-** Get drawable attributes
-*/
-static int
-DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
-{
- ClientPtr client = cl->client;
- xGLXGetDrawableAttributesReply reply;
- __GLXdrawable *pGlxDraw;
- CARD32 attributes[6];
- int numAttribs, error;
-
- if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
- DixGetAttrAccess, &pGlxDraw, &error))
- return error;
-
- numAttribs = 3;
- reply.length = numAttribs << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.numAttribs = numAttribs;
-
- attributes[0] = GLX_TEXTURE_TARGET_EXT;
- attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
- GLX_TEXTURE_RECTANGLE_EXT;
- attributes[2] = GLX_Y_INVERTED_EXT;
- attributes[3] = GL_FALSE;
- attributes[4] = GLX_EVENT_MASK;
- attributes[5] = pGlxDraw->eventMask;
-
- if (client->swapped) {
- __glXSwapGetDrawableAttributesReply(client, &reply, attributes);
- } else {
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
- (char *)&reply);
- WriteToClient(client, reply.length * sizeof (CARD32),
- (char *)attributes);
- }
-
- return Success;
-}
-
-int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
-
- return DoGetDrawableAttributes(cl, req->drawable);
-}
-
-int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetDrawableAttributesSGIXReq *req =
- (xGLXGetDrawableAttributesSGIXReq *)pc;
-
- return DoGetDrawableAttributes(cl, req->drawable);
-}
-
-/************************************************************************/
-
-/*
-** Render and Renderlarge are not in the GLX API. They are used by the GLX
-** client library to send batches of GL rendering commands.
-*/
-
-/*
-** Execute all the drawing commands in a request.
-*/
-int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderReq *req;
- ClientPtr client= cl->client;
- int left, cmdlen, error;
- int commandsDone;
- CARD16 opcode;
- __GLXrenderHeader *hdr;
- struct glx_context *glxc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXRenderReq *) pc;
- if (client->swapped) {
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- }
-
- glxc = __glXForceCurrent(cl, req->contextTag, &error);
- if (!glxc) {
- return error;
- }
-
- commandsDone = 0;
- pc += sz_xGLXRenderReq;
- left = (req->length << 2) - sz_xGLXRenderReq;
- while (left > 0) {
- __GLXrenderSizeData entry;
- int extra;
- __GLXdispatchRenderProcPtr proc;
- int err;
-
- /*
- ** Verify that the header length and the overall length agree.
- ** Also, each command must be word aligned.
- */
- hdr = (__GLXrenderHeader *) pc;
- if (client->swapped) {
- __GLX_SWAP_SHORT(&hdr->length);
- __GLX_SWAP_SHORT(&hdr->opcode);
- }
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- /*
- ** Check for core opcodes and grab entry data.
- */
- err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry);
- proc = (__GLXdispatchRenderProcPtr)
- __glXGetProtocolDecodeFunction(& Render_dispatch_info,
- opcode, client->swapped);
-
- if ((err < 0) || (proc == NULL)) {
- client->errorValue = commandsDone;
- return __glXError(GLXBadRenderRequest);
- }
-
- if (entry.varsize) {
- /* variable size command */
- extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE,
- client->swapped);
- if (extra < 0) {
- extra = 0;
- }
- if (cmdlen != __GLX_PAD(entry.bytes + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry.bytes)) {
- return BadLength;
- }
- }
- if (left < cmdlen) {
- return BadLength;
- }
-
- /*
- ** Skip over the header and execute the command. We allow the
- ** caller to trash the command memory. This is useful especially
- ** for things that require double alignment - they can just shift
- ** the data towards lower memory (trashing the header) by 4 bytes
- ** and achieve the required alignment.
- */
- (*proc)(pc + __GLX_RENDER_HDR_SIZE);
- pc += cmdlen;
- left -= cmdlen;
- commandsDone++;
- }
- __GLX_NOTE_UNFLUSHED_CMDS(glxc);
- return Success;
-}
-
-
-/*
-** Execute a large rendering request (one that spans multiple X requests).
-*/
-int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXRenderLargeReq *req;
- ClientPtr client= cl->client;
- size_t dataBytes;
- __GLXrenderLargeHeader *hdr;
- struct glx_context *glxc;
- int error;
- CARD16 opcode;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXRenderLargeReq *) pc;
- if (client->swapped) {
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->dataBytes);
- __GLX_SWAP_SHORT(&req->requestNumber);
- __GLX_SWAP_SHORT(&req->requestTotal);
- }
-
- glxc = __glXForceCurrent(cl, req->contextTag, &error);
- if (!glxc) {
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return error;
- }
- dataBytes = req->dataBytes;
-
- /*
- ** Check the request length.
- */
- if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
- client->errorValue = req->length;
- /* Reset in case this isn't 1st request. */
- __glXResetLargeCommandStatus(cl);
- return BadLength;
- }
- pc += sz_xGLXRenderLargeReq;
-
- if (cl->largeCmdRequestsSoFar == 0) {
- __GLXrenderSizeData entry;
- int extra;
- size_t cmdlen;
- int err;
-
- /*
- ** This is the first request of a multi request command.
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (req->requestNumber != 1) {
- client->errorValue = req->requestNumber;
- return __glXError(GLXBadLargeRequest);
- }
-
- hdr = (__GLXrenderLargeHeader *) pc;
- if (client->swapped) {
- __GLX_SWAP_INT(&hdr->length);
- __GLX_SWAP_INT(&hdr->opcode);
- }
- cmdlen = hdr->length;
- opcode = hdr->opcode;
-
- /*
- ** Check for core opcodes and grab entry data.
- */
- err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry);
- if (err < 0) {
- client->errorValue = opcode;
- return __glXError(GLXBadLargeRequest);
- }
-
- if (entry.varsize) {
- /*
- ** If it's a variable-size command (a command whose length must
- ** be computed from its parameters), all the parameters needed
- ** will be in the 1st request, so it's okay to do this.
- */
- extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE,
- client->swapped);
- if (extra < 0) {
- extra = 0;
- }
- /* large command's header is 4 bytes longer, so add 4 */
- if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) {
- return BadLength;
- }
- } else {
- /* constant size command */
- if (cmdlen != __GLX_PAD(entry.bytes + 4)) {
- return BadLength;
- }
- }
- /*
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (cl->largeCmdBufSize < cmdlen) {
- if (!cl->largeCmdBuf) {
- cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
- } else {
- cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
- }
- if (!cl->largeCmdBuf) {
- return BadAlloc;
- }
- cl->largeCmdBufSize = cmdlen;
- }
- memcpy(cl->largeCmdBuf, pc, dataBytes);
-
- cl->largeCmdBytesSoFar = dataBytes;
- cl->largeCmdBytesTotal = cmdlen;
- cl->largeCmdRequestsSoFar = 1;
- cl->largeCmdRequestsTotal = req->requestTotal;
- return Success;
-
- } else {
- /*
- ** We are receiving subsequent (i.e. not the first) requests of a
- ** multi request command.
- */
-
- /*
- ** Check the request number and the total request count.
- */
- if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
- client->errorValue = req->requestNumber;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
- }
- if (req->requestTotal != cl->largeCmdRequestsTotal) {
- client->errorValue = req->requestTotal;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
- }
-
- /*
- ** Check that we didn't get too much data.
- */
- if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
- }
- memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
- cl->largeCmdBytesSoFar += dataBytes;
- cl->largeCmdRequestsSoFar++;
-
- if (req->requestNumber == cl->largeCmdRequestsTotal) {
- __GLXdispatchRenderProcPtr proc;
-
- /*
- ** This is the last request; it must have enough bytes to complete
- ** the command.
- */
- /* NOTE: the two pad macros have been added below; they are needed
- ** because the client library pads the total byte count, but not
- ** the per-request byte counts. The Protocol Encoding says the
- ** total byte count should not be padded, so a proposal will be
- ** made to the ARB to relax the padding constraint on the total
- ** byte count, thus preserving backward compatibility. Meanwhile,
- ** the padding done below fixes a bug that did not allow
- ** large commands of odd sizes to be accepted by the server.
- */
- if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
- __GLX_PAD(cl->largeCmdBytesTotal)) {
- client->errorValue = dataBytes;
- __glXResetLargeCommandStatus(cl);
- return __glXError(GLXBadLargeRequest);
- }
- hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
- /*
- ** The opcode and length field in the header had already been
- ** swapped when the first request was received.
- **
- ** Use the opcode to index into the procedure table.
- */
- opcode = hdr->opcode;
-
- proc = (__GLXdispatchRenderProcPtr)
- __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode,
- client->swapped);
- if (proc == NULL) {
- client->errorValue = opcode;
- return __glXError(GLXBadLargeRequest);
- }
-
- /*
- ** Skip over the header and execute the command.
- */
- (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
- __GLX_NOTE_UNFLUSHED_CMDS(glxc);
-
- /*
- ** Reset for the next RenderLarge series.
- */
- __glXResetLargeCommandStatus(cl);
- } else {
- /*
- ** This is neither the first nor the last request.
- */
- }
- return Success;
- }
-}
-
-/************************************************************************/
-
-/*
-** No support is provided for the vendor-private requests other than
-** allocating the entry points in the dispatch table.
-*/
-
-int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLint vendorcode = req->vendorCode;
- __GLXdispatchVendorPrivProcPtr proc;
-
-
- proc = (__GLXdispatchVendorPrivProcPtr)
- __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
- vendorcode, 0);
- if (proc != NULL) {
- (*proc)(cl, (GLbyte*)req);
- return Success;
- }
-
- cl->client->errorValue = req->vendorCode;
- return __glXError(GLXUnsupportedPrivateRequest);
-}
-
-int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLint vendorcode = req->vendorCode;
- __GLXdispatchVendorPrivProcPtr proc;
-
-
- proc = (__GLXdispatchVendorPrivProcPtr)
- __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
- vendorcode, 0);
- if (proc != NULL) {
- return (*proc)(cl, (GLbyte*)req);
- }
-
- cl->client->errorValue = vendorcode;
- return __glXError(GLXUnsupportedPrivateRequest);
-}
-
-int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
- xGLXQueryExtensionsStringReply reply;
- __GLXscreen *pGlxScreen;
- size_t n, length;
- char *buf;
- int err;
-
- if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
- return err;
-
- n = strlen(pGlxScreen->GLXextensions) + 1;
- length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
-
- /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/
- buf = (char *) malloc(length << 2);
- if (buf == NULL)
- return BadAlloc;
- memcpy(buf, pGlxScreen->GLXextensions, n);
-
- if (client->swapped) {
- glxSwapQueryExtensionsStringReply(client, &reply, buf);
- } else {
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply);
- WriteToClient(client, (int)(length << 2), (char *)buf);
- }
-
- free(buf);
- return Success;
-}
-
-int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
- xGLXQueryServerStringReply reply;
- size_t n, length;
- const char *ptr;
- char *buf;
- __GLXscreen *pGlxScreen;
- int err;
- char ver_str[16];
-
- if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
- return err;
-
- switch(req->name) {
- case GLX_VENDOR:
- ptr = pGlxScreen->GLXvendor;
- break;
- case GLX_VERSION:
- /* Return to the server version rather than the screen version
- * to prevent confusion when they do not match.
- */
- snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
- ptr = ver_str;
- break;
- case GLX_EXTENSIONS:
- ptr = pGlxScreen->GLXextensions;
- break;
- default:
- return BadValue;
- }
-
- n = strlen(ptr) + 1;
- length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
-
- buf = (char *) malloc(length << 2);
- if (buf == NULL) {
- return BadAlloc;
- }
- memcpy(buf, ptr, n);
-
- if (client->swapped) {
- glxSwapQueryServerStringReply(client, &reply, buf);
- } else {
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply);
- WriteToClient(client, (int)(length << 2), buf);
- }
-
- free(buf);
- return Success;
-}
-
-int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
- const char *buf;
-
- cl->GLClientmajorVersion = req->major;
- cl->GLClientminorVersion = req->minor;
- free(cl->GLClientextensions);
- buf = (const char *)(req+1);
- cl->GLClientextensions = strdup(buf);
-
- return Success;
-}
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
+
+#include <string.h>
+#include <assert.h>
+
+#include "glxserver.h"
+#include <GL/glxtokens.h>
+#include <unpack.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include "glxutil.h"
+#include "glxext.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+#include "indirect_dispatch.h"
+#include "indirect_table.h"
+#include "indirect_util.h"
+
+static int
+validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
+{
+ /*
+ ** Check if screen exists.
+ */
+ if (screen < 0 || screen >= screenInfo.numScreens) {
+ client->errorValue = screen;
+ *err = BadValue;
+ return FALSE;
+ }
+ *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
+
+ return TRUE;
+}
+
+static int
+validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
+ __GLXconfig **config, int *err)
+{
+ __GLXconfig *m;
+
+ for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next)
+ if (m->fbconfigID == id) {
+ *config = m;
+ return TRUE;
+ }
+
+ client->errorValue = id;
+ *err = __glXError(GLXBadFBConfig);
+
+ return FALSE;
+}
+
+static int
+validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id,
+ __GLXconfig **config, int *err)
+{
+ int i;
+
+ for (i = 0; i < pGlxScreen->numVisuals; i++)
+ if (pGlxScreen->visuals[i]->visualID == id) {
+ *config = pGlxScreen->visuals[i];
+ return TRUE;
+ }
+
+ client->errorValue = id;
+ *err = BadValue;
+
+ return FALSE;
+}
+
+static int
+validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config,
+ DrawablePtr pDraw, int *err)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ VisualPtr pVisual = NULL;
+ XID vid;
+ int i;
+
+ vid = wVisual((WindowPtr)pDraw);
+ for (i = 0; i < pScreen->numVisuals; i++) {
+ if (pScreen->visuals[i].vid == vid) {
+ pVisual = &pScreen->visuals[i];
+ break;
+ }
+ }
+
+ /* FIXME: What exactly should we check here... */
+ if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
+ !(config->drawableType & GLX_WINDOW_BIT)) {
+ client->errorValue = pDraw->id;
+ *err = BadMatch;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static int
+validGlxContext(ClientPtr client, XID id, int access_mode,
+ struct glx_context **context, int *err)
+{
+ *err = dixLookupResourceByType((pointer *) context, id,
+ __glXContextRes, client, access_mode);
+ if (*err != Success) {
+ client->errorValue = id;
+ if (*err == BadValue)
+ *err = __glXError(GLXBadContext);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static int
+validGlxDrawable(ClientPtr client, XID id, int type, int access_mode,
+ __GLXdrawable **drawable, int *err)
+{
+ int rc;
+
+ rc = dixLookupResourceByType((pointer *) drawable, id,
+ __glXDrawableRes, client, access_mode);
+ if (rc != Success && rc != BadValue) {
+ *err = rc;
+ client->errorValue = id;
+ return FALSE;
+ }
+
+ /* If the ID of the glx drawable we looked up doesn't match the id
+ * we looked for, it's because we looked it up under the X
+ * drawable ID (see DoCreateGLXDrawable). */
+ if (rc == BadValue ||
+ (*drawable)->drawId != id ||
+ (type != GLX_DRAWABLE_ANY && type != (*drawable)->type)) {
+ client->errorValue = id;
+ switch (type) {
+ case GLX_DRAWABLE_WINDOW:
+ *err = __glXError(GLXBadWindow);
+ return FALSE;
+ case GLX_DRAWABLE_PIXMAP:
+ *err = __glXError(GLXBadPixmap);
+ return FALSE;
+ case GLX_DRAWABLE_PBUFFER:
+ *err = __glXError(GLXBadPbuffer);
+ return FALSE;
+ case GLX_DRAWABLE_ANY:
+ *err = __glXError(GLXBadDrawable);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+void
+__glXContextDestroy(struct glx_context *context)
+{
+ __glXFlushContextCache();
+}
+
+static void __glXdirectContextDestroy(struct glx_context *context)
+{
+ __glXContextDestroy(context);
+ free(context);
+}
+
+static struct glx_context *__glXdirectContextCreate(__GLXscreen *screen,
+ __GLXconfig *modes,
+ struct glx_context *shareContext)
+{
+ struct glx_context *context;
+
+ context = calloc(1, sizeof (struct glx_context));
+ if (context == NULL)
+ return NULL;
+
+ context->destroy = __glXdirectContextDestroy;
+
+ return context;
+}
+
+void FlushContext(struct glx_context *cx)
+{
+ CALL_Flush( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(cx);
+}
+
+/**
+ * Create a GL context with the given properties. This routine is used
+ * to implement \c glXCreateContext, \c glXCreateNewContext, and
+ * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way
+ * that GLXFBConfigs are implemented. Basically, the FBConfigID is the
+ * same as the VisualID.
+ */
+
+static int
+DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
+ GLXContextID shareList, __GLXconfig *config,
+ __GLXscreen *pGlxScreen, GLboolean isDirect)
+{
+ ClientPtr client = cl->client;
+ struct glx_context *glxc, *shareglxc;
+ int err;
+
+ LEGAL_NEW_RESOURCE(gcId, client);
+
+ /*
+ ** Find the display list space that we want to share.
+ **
+ ** NOTE: In a multithreaded X server, we would need to keep a reference
+ ** count for each display list so that if one client detroyed a list that
+ ** another client was using, the list would not really be freed until it
+ ** was no longer in use. Since this sample implementation has no support
+ ** for multithreaded servers, we don't do this.
+ */
+ if (shareList == None) {
+ shareglxc = 0;
+ } else {
+ if (!validGlxContext(client, shareList, DixReadAccess,
+ &shareglxc, &err))
+ return err;
+
+ if (shareglxc->isDirect) {
+ /*
+ ** NOTE: no support for sharing display lists between direct
+ ** contexts, even if they are in the same address space.
+ */
+#if 0
+ /* Disabling this code seems to allow shared display lists
+ * and texture objects to work. We'll leave it disabled for now.
+ */
+ client->errorValue = shareList;
+ return BadMatch;
+#endif
+ } else {
+ /*
+ ** Create an indirect context regardless of what the client asked
+ ** for; this way we can share display list space with shareList.
+ */
+ isDirect = GL_FALSE;
+ }
+ }
+
+ /*
+ ** Allocate memory for the new context
+ */
+ if (!isDirect)
+ glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc);
+ else
+ glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc);
+ if (!glxc) {
+ return BadAlloc;
+ }
+
+ /*
+ ** Initially, setup the part of the context that could be used by
+ ** a GL core that needs windowing information (e.g., Mesa).
+ */
+ glxc->pGlxScreen = pGlxScreen;
+ glxc->config = config;
+
+ /*
+ ** Register this context as a resource.
+ */
+ if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
+ (*glxc->destroy)(glxc);
+ client->errorValue = gcId;
+ return BadAlloc;
+ }
+
+ /*
+ ** Finally, now that everything is working, setup the rest of the
+ ** context.
+ */
+ glxc->id = gcId;
+ glxc->share_id = shareList;
+ glxc->idExists = GL_TRUE;
+ glxc->isCurrent = GL_FALSE;
+ glxc->isDirect = isDirect;
+ glxc->renderMode = GL_RENDER;
+
+ __glXAddToContextList(glxc);
+
+ return Success;
+}
+
+int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXCreateContextReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
+ return err;
+
+ return DoCreateContext(cl, req->context, req->shareList,
+ config, pGlxScreen, req->isDirect);
+}
+
+int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
+ return err;
+
+ return DoCreateContext(cl, req->context, req->shareList,
+ config, pGlxScreen, req->isDirect);
+}
+
+int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
+ return err;
+
+ return DoCreateContext(cl, req->context, req->shareList,
+ config, pGlxScreen, req->isDirect);
+}
+int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
+ struct glx_context *glxc;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
+
+ if (!validGlxContext(cl->client, req->context, DixDestroyAccess,
+ &glxc, &err))
+ return err;
+
+ FreeResourceByType(req->context, __glXContextRes, FALSE);
+ return Success;
+}
+
+/*****************************************************************************/
+
+/*
+** For each client, the server keeps a table of all the contexts that are
+** current for that client (each thread of a client may have its own current
+** context). These routines add, change, and lookup contexts in the table.
+*/
+
+/*
+** Add a current context, and return the tag that will be used to refer to it.
+*/
+static int AddCurrentContext(__GLXclientState *cl, struct glx_context *glxc)
+{
+ int i;
+ int num = cl->numCurrentContexts;
+ struct glx_context **table = cl->currentContexts;
+
+ if (!glxc) return -1;
+
+ /*
+ ** Try to find an empty slot and use it.
+ */
+ for (i=0; i < num; i++) {
+ if (!table[i]) {
+ table[i] = glxc;
+ return i+1;
+ }
+ }
+ /*
+ ** Didn't find a free slot, so we'll have to grow the table.
+ */
+ if (!num) {
+ table = (struct glx_context **) malloc(sizeof(struct glx_context *));
+ } else {
+ table = (struct glx_context **) realloc(table,
+ (num+1)*sizeof(struct glx_context *));
+ }
+ table[num] = glxc;
+ cl->currentContexts = table;
+ cl->numCurrentContexts++;
+ return num+1;
+}
+
+/*
+** Given a tag, change the current context for the corresponding entry.
+*/
+static void ChangeCurrentContext(__GLXclientState *cl, struct glx_context *glxc,
+ GLXContextTag tag)
+{
+ struct glx_context **table = cl->currentContexts;
+ table[tag-1] = glxc;
+}
+
+/*
+** For this implementation we have chosen to simply use the index of the
+** context's entry in the table as the context tag. A tag must be greater
+** than 0.
+*/
+struct glx_context *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
+{
+ int num = cl->numCurrentContexts;
+
+ if (tag < 1 || tag > num) {
+ return 0;
+ } else {
+ return cl->currentContexts[tag-1];
+ }
+}
+
+/*****************************************************************************/
+
+static void StopUsingContext(struct glx_context *glxc)
+{
+ if (glxc) {
+ if (glxc == __glXLastContext) {
+ /* Tell server GL library */
+ __glXLastContext = 0;
+ }
+ glxc->isCurrent = GL_FALSE;
+ if (!glxc->idExists) {
+ __glXFreeContext(glxc);
+ }
+ }
+}
+
+static void StartUsingContext(__GLXclientState *cl, struct glx_context *glxc)
+{
+ glxc->isCurrent = GL_TRUE;
+ __glXLastContext = glxc;
+}
+
+/**
+ * This is a helper function to handle the legacy (pre GLX 1.3) cases
+ * where passing an X window to glXMakeCurrent is valid. Given a
+ * resource ID, look up the GLX drawable if available, otherwise, make
+ * sure it's an X window and create a GLX drawable one the fly.
+ */
+static __GLXdrawable *
+__glXGetDrawable(struct glx_context *glxc, GLXDrawable drawId, ClientPtr client,
+ int *error)
+{
+ DrawablePtr pDraw;
+ __GLXdrawable *pGlxDraw;
+ int rc;
+
+ if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
+ DixWriteAccess, &pGlxDraw, &rc)) {
+ if (glxc != NULL && pGlxDraw->config != glxc->config) {
+ client->errorValue = drawId;
+ *error = BadMatch;
+ return NULL;
+ }
+
+ return pGlxDraw;
+ }
+
+ /* No active context and an unknown drawable, bail. */
+ if (glxc == NULL) {
+ client->errorValue = drawId;
+ *error = BadMatch;
+ return NULL;
+ }
+
+ /* The drawId wasn't a GLX drawable. Make sure it's a window and
+ * create a GLXWindow for it. Check that the drawable screen
+ * matches the context screen and that the context fbconfig is
+ * compatible with the window visual. */
+
+ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
+ if (rc != Success || pDraw->type != DRAWABLE_WINDOW) {
+ client->errorValue = drawId;
+ *error = __glXError(GLXBadDrawable);
+ return NULL;
+ }
+
+ if (!glxc || pDraw->pScreen != glxc->pGlxScreen->pScreen) {
+ client->errorValue = pDraw->pScreen->myNum;
+ *error = BadMatch;
+ return NULL;
+ }
+
+ if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error))
+ return NULL;
+
+ pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen,
+ pDraw, drawId,
+ GLX_DRAWABLE_WINDOW,
+ drawId, glxc->config);
+
+ /* since we are creating the drawablePrivate, drawId should be new */
+ if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
+ pGlxDraw->destroy (pGlxDraw);
+ *error = BadAlloc;
+ return NULL;
+ }
+
+ return pGlxDraw;
+}
+
+/*****************************************************************************/
+/*
+** Make an OpenGL context and drawable current.
+*/
+
+static int
+DoMakeCurrent(__GLXclientState *cl,
+ GLXDrawable drawId, GLXDrawable readId,
+ GLXContextID contextId, GLXContextTag tag)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeCurrentReply reply;
+ struct glx_context *glxc, *prevglxc;
+ __GLXdrawable *drawPriv = NULL;
+ __GLXdrawable *readPriv = NULL;
+ int error;
+ GLuint mask;
+
+ /*
+ ** If one is None and the other isn't, it's a bad match.
+ */
+
+ mask = (drawId == None) ? (1 << 0) : 0;
+ mask |= (readId == None) ? (1 << 1) : 0;
+ mask |= (contextId == None) ? (1 << 2) : 0;
+
+ if ( (mask != 0x00) && (mask != 0x07) ) {
+ return BadMatch;
+ }
+
+ /*
+ ** Lookup old context. If we have one, it must be in a usable state.
+ */
+ if (tag != 0) {
+ prevglxc = __glXLookupContextByTag(cl, tag);
+ if (!prevglxc) {
+ /*
+ ** Tag for previous context is invalid.
+ */
+ return __glXError(GLXBadContextTag);
+ }
+ if (prevglxc->renderMode != GL_RENDER) {
+ /* Oops. Not in render mode render. */
+ client->errorValue = prevglxc->id;
+ return __glXError(GLXBadContextState);
+ }
+ } else {
+ prevglxc = 0;
+ }
+
+ /*
+ ** Lookup new context. It must not be current for someone else.
+ */
+ if (contextId != None) {
+ int status;
+
+ if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error))
+ return error;
+ if ((glxc != prevglxc) && glxc->isCurrent) {
+ /* Context is current to somebody else */
+ return BadAccess;
+ }
+
+ assert( drawId != None );
+ assert( readId != None );
+
+ drawPriv = __glXGetDrawable(glxc, drawId, client, &status);
+ if (drawPriv == NULL)
+ return status;
+
+ readPriv = __glXGetDrawable(glxc, readId, client, &status);
+ if (readPriv == NULL)
+ return status;
+
+ } else {
+ /* Switching to no context. Ignore new drawable. */
+ glxc = 0;
+ drawPriv = 0;
+ readPriv = 0;
+ }
+
+
+ if (prevglxc) {
+ /*
+ ** Flush the previous context if needed.
+ */
+ if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) {
+ if (__glXForceCurrent(cl, tag, (int *)&error)) {
+ CALL_Flush( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(prevglxc);
+ } else {
+ return error;
+ }
+ }
+
+ /*
+ ** Make the previous context not current.
+ */
+ if (!(*prevglxc->loseCurrent)(prevglxc)) {
+ return __glXError(GLXBadContext);
+ }
+ __glXFlushContextCache();
+ if (!prevglxc->isDirect) {
+ prevglxc->drawPriv = NULL;
+ prevglxc->readPriv = NULL;
+ }
+ }
+
+
+ if ((glxc != 0) && !glxc->isDirect) {
+
+ glxc->drawPriv = drawPriv;
+ glxc->readPriv = readPriv;
+
+ /* make the context current */
+ if (!(*glxc->makeCurrent)(glxc)) {
+ glxc->drawPriv = NULL;
+ glxc->readPriv = NULL;
+ return __glXError(GLXBadContext);
+ }
+
+ glxc->isCurrent = GL_TRUE;
+ }
+
+ if (prevglxc) {
+ ChangeCurrentContext(cl, glxc, tag);
+ StopUsingContext(prevglxc);
+ } else {
+ tag = AddCurrentContext(cl, glxc);
+ }
+
+ if (glxc) {
+ StartUsingContext(cl, glxc);
+ reply.contextTag = tag;
+ } else {
+ reply.contextTag = 0;
+ }
+
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapMakeCurrentReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply);
+ }
+ return Success;
+}
+
+int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
+
+ return DoMakeCurrent( cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
+
+ return DoMakeCurrent( cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag );
+}
+
+int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
+
+ return DoMakeCurrent( cl, req->drawable, req->readable,
+ req->context, req->oldContextTag );
+}
+
+int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
+ xGLXIsDirectReply reply;
+ struct glx_context *glxc;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXIsDirectReq);
+
+ if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
+ return err;
+
+ reply.isDirect = glxc->isDirect;
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapIsDirectReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
+ }
+
+ return Success;
+}
+
+int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
+ xGLXQueryVersionReply reply;
+ GLuint major, minor;
+
+ REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
+
+ major = req->majorVersion;
+ minor = req->minorVersion;
+ (void)major;
+ (void)minor;
+
+ /*
+ ** Server should take into consideration the version numbers sent by the
+ ** client if it wants to work with older clients; however, in this
+ ** implementation the server just returns its version number.
+ */
+ reply.majorVersion = glxMajorVersion;
+ reply.minorVersion = glxMinorVersion;
+ reply.length = 0;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __glXSwapQueryVersionReply(client, &reply);
+ } else {
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply);
+ }
+ return Success;
+}
+
+int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
+ GLXContextTag tag;
+ struct glx_context *glxc = NULL;
+ int error;
+
+ REQUEST_SIZE_MATCH(xGLXWaitGLReq);
+
+ tag = req->contextTag;
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc)
+ return __glXError(GLXBadContextTag);
+
+ if (!__glXForceCurrent(cl, req->contextTag, &error))
+ return error;
+
+ CALL_Finish( GET_DISPATCH(), () );
+ }
+
+ if (glxc && glxc->drawPriv->waitGL)
+ (*glxc->drawPriv->waitGL)(glxc->drawPriv);
+
+ return Success;
+}
+
+int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
+ GLXContextTag tag;
+ struct glx_context *glxc = NULL;
+ int error;
+
+ REQUEST_SIZE_MATCH(xGLXWaitXReq);
+
+ tag = req->contextTag;
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc)
+ return __glXError(GLXBadContextTag);
+
+ if (!__glXForceCurrent(cl, req->contextTag, &error))
+ return error;
+ }
+
+ if (glxc && glxc->drawPriv->waitX)
+ (*glxc->drawPriv->waitX)(glxc->drawPriv);
+
+ return Success;
+}
+
+int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
+ GLXContextID source;
+ GLXContextID dest;
+ GLXContextTag tag;
+ unsigned long mask;
+ struct glx_context *src, *dst;
+ int error;
+
+ REQUEST_SIZE_MATCH(xGLXCopyContextReq);
+
+ source = req->source;
+ dest = req->dest;
+ tag = req->contextTag;
+ mask = req->mask;
+ if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error))
+ return error;
+ if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error))
+ return error;
+
+ /*
+ ** They must be in the same address space, and same screen.
+ ** NOTE: no support for direct rendering contexts here.
+ */
+ if (src->isDirect || dst->isDirect ||
+ (src->pGlxScreen != dst->pGlxScreen)) {
+ client->errorValue = source;
+ return BadMatch;
+ }
+
+ /*
+ ** The destination context must not be current for any client.
+ */
+ if (dst->isCurrent) {
+ client->errorValue = dest;
+ return BadAccess;
+ }
+
+ if (tag) {
+ struct glx_context *tagcx = __glXLookupContextByTag(cl, tag);
+
+ if (!tagcx) {
+ return __glXError(GLXBadContextTag);
+ }
+ if (tagcx != src) {
+ /*
+ ** This would be caused by a faulty implementation of the client
+ ** library.
+ */
+ return BadMatch;
+ }
+ /*
+ ** In this case, glXCopyContext is in both GL and X streams, in terms
+ ** of sequentiality.
+ */
+ if (__glXForceCurrent(cl, tag, &error)) {
+ /*
+ ** Do whatever is needed to make sure that all preceding requests
+ ** in both streams are completed before the copy is executed.
+ */
+ CALL_Finish( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(tagcx);
+ } else {
+ return error;
+ }
+ }
+ /*
+ ** Issue copy. The only reason for failure is a bad mask.
+ */
+ if (!(*dst->copy)(dst, src, mask)) {
+ client->errorValue = mask;
+ return BadValue;
+ }
+ return Success;
+}
+
+enum {
+ GLX_VIS_CONFIG_UNPAIRED = 18,
+ GLX_VIS_CONFIG_PAIRED = 20
+};
+
+enum {
+ GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED
+};
+
+int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
+ ClientPtr client = cl->client;
+ xGLXGetVisualConfigsReply reply;
+ __GLXscreen *pGlxScreen;
+ __GLXconfig *modes;
+ CARD32 buf[GLX_VIS_CONFIG_TOTAL];
+ int p, i, err;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+
+ reply.numVisuals = pGlxScreen->numVisuals;
+ reply.numProps = GLX_VIS_CONFIG_TOTAL;
+ reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numVisuals);
+ __GLX_SWAP_INT(&reply.numProps);
+ }
+
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
+
+ for (i = 0; i < pGlxScreen->numVisuals; i++) {
+ modes = pGlxScreen->visuals[i];
+
+ p = 0;
+ buf[p++] = modes->visualID;
+ buf[p++] = glxConvertToXVisualType( modes->visualType );
+ buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE;
+
+ buf[p++] = modes->redBits;
+ buf[p++] = modes->greenBits;
+ buf[p++] = modes->blueBits;
+ buf[p++] = modes->alphaBits;
+ buf[p++] = modes->accumRedBits;
+ buf[p++] = modes->accumGreenBits;
+ buf[p++] = modes->accumBlueBits;
+ buf[p++] = modes->accumAlphaBits;
+
+ buf[p++] = modes->doubleBufferMode;
+ buf[p++] = modes->stereoMode;
+
+ buf[p++] = modes->rgbBits;
+ buf[p++] = modes->depthBits;
+ buf[p++] = modes->stencilBits;
+ buf[p++] = modes->numAuxBuffers;
+ buf[p++] = modes->level;
+
+ assert(p == GLX_VIS_CONFIG_UNPAIRED);
+ /*
+ ** Add token/value pairs for extensions.
+ */
+ buf[p++] = GLX_VISUAL_CAVEAT_EXT;
+ buf[p++] = modes->visualRating;
+ buf[p++] = GLX_TRANSPARENT_TYPE;
+ buf[p++] = modes->transparentPixel;
+ buf[p++] = GLX_TRANSPARENT_RED_VALUE;
+ buf[p++] = modes->transparentRed;
+ buf[p++] = GLX_TRANSPARENT_GREEN_VALUE;
+ buf[p++] = modes->transparentGreen;
+ buf[p++] = GLX_TRANSPARENT_BLUE_VALUE;
+ buf[p++] = modes->transparentBlue;
+ buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE;
+ buf[p++] = modes->transparentAlpha;
+ buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
+ buf[p++] = modes->transparentIndex;
+ buf[p++] = GLX_SAMPLES_SGIS;
+ buf[p++] = modes->samples;
+ buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
+ buf[p++] = modes->sampleBuffers;
+ buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
+ buf[p++] = 0;
+
+ assert(p == GLX_VIS_CONFIG_TOTAL);
+ if (client->swapped) {
+ __GLX_SWAP_INT_ARRAY(buf, p);
+ }
+ WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *)buf);
+ }
+ return Success;
+}
+
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)
+#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
+/**
+ * Send the set of GLXFBConfigs to the client. There is not currently
+ * and interface into the driver on the server-side to get GLXFBConfigs,
+ * so we "invent" some based on the \c __GLXvisualConfig structures that
+ * the driver does supply.
+ *
+ * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX
+ * is the same, so this routine pulls double duty.
+ */
+
+static int
+DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsReply reply;
+ __GLXscreen *pGlxScreen;
+ CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH];
+ int p, err;
+ __GLXconfig *modes;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err))
+ return err;
+
+ reply.numFBConfigs = pGlxScreen->numFBConfigs;
+ reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS;
+ reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs);
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+
+ if (client->swapped) {
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numFBConfigs);
+ __GLX_SWAP_INT(&reply.numAttribs);
+ }
+
+ WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply);
+
+ for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) {
+ p = 0;
+
+#define WRITE_PAIR(tag,value) \
+ do { buf[p++] = tag ; buf[p++] = value ; } while( 0 )
+
+ WRITE_PAIR( GLX_VISUAL_ID, modes->visualID );
+ WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID );
+ WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE );
+
+ WRITE_PAIR( GLX_RGBA,
+ (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE );
+ WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType );
+ WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode );
+ WRITE_PAIR( GLX_STEREO, modes->stereoMode );
+
+ WRITE_PAIR( GLX_BUFFER_SIZE, modes->rgbBits );
+ WRITE_PAIR( GLX_LEVEL, modes->level );
+ WRITE_PAIR( GLX_AUX_BUFFERS, modes->numAuxBuffers );
+ WRITE_PAIR( GLX_RED_SIZE, modes->redBits );
+ WRITE_PAIR( GLX_GREEN_SIZE, modes->greenBits );
+ WRITE_PAIR( GLX_BLUE_SIZE, modes->blueBits );
+ WRITE_PAIR( GLX_ALPHA_SIZE, modes->alphaBits );
+ WRITE_PAIR( GLX_ACCUM_RED_SIZE, modes->accumRedBits );
+ WRITE_PAIR( GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits );
+ WRITE_PAIR( GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits );
+ WRITE_PAIR( GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits );
+ WRITE_PAIR( GLX_DEPTH_SIZE, modes->depthBits );
+ WRITE_PAIR( GLX_STENCIL_SIZE, modes->stencilBits );
+ WRITE_PAIR( GLX_X_VISUAL_TYPE, modes->visualType );
+ WRITE_PAIR( GLX_CONFIG_CAVEAT, modes->visualRating );
+ WRITE_PAIR( GLX_TRANSPARENT_TYPE, modes->transparentPixel );
+ WRITE_PAIR( GLX_TRANSPARENT_RED_VALUE, modes->transparentRed );
+ WRITE_PAIR( GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen );
+ WRITE_PAIR( GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue );
+ WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
+ WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
+ WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
+ WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples );
+ WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers );
+ /* GLX_VISUAL_SELECT_GROUP_SGIX ? */
+ WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType );
+ WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb );
+ WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba );
+ WRITE_PAIR( GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture );
+ WRITE_PAIR( GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets );
+
+ if (client->swapped) {
+ __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);
+ }
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH,
+ (char *)buf);
+ }
+ return Success;
+}
+
+
+int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
+ REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
+ return DoGetFBConfigs(cl, req->screen);
+}
+
+int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ REQUEST_SIZE_MATCH(xGLXGetFBConfigsSGIXReq);
+ return DoGetFBConfigs(cl, req->screen);
+}
+
+GLboolean
+__glXDrawableInit(__GLXdrawable *drawable,
+ __GLXscreen *screen, DrawablePtr pDraw, int type,
+ XID drawId, __GLXconfig *config)
+{
+ drawable->pDraw = pDraw;
+ drawable->type = type;
+ drawable->drawId = drawId;
+ drawable->config = config;
+ drawable->eventMask = 0;
+
+ return GL_TRUE;
+}
+
+void
+__glXDrawableRelease(__GLXdrawable *drawable)
+{
+}
+
+static int
+DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen,
+ __GLXconfig *config, DrawablePtr pDraw, XID drawableId,
+ XID glxDrawableId, int type)
+{
+ __GLXdrawable *pGlxDraw;
+
+ if (pGlxScreen->pScreen != pDraw->pScreen)
+ return BadMatch;
+
+ pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw,
+ drawableId, type,
+ glxDrawableId, config);
+ if (pGlxDraw == NULL)
+ return BadAlloc;
+
+ if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) {
+ pGlxDraw->destroy (pGlxDraw);
+ return BadAlloc;
+ }
+
+ /* Add the glx drawable under the XID of the underlying X drawable
+ * too. That way we'll get a callback in DrawableGone and can
+ * clean up properly when the drawable is destroyed. */
+ if (drawableId != glxDrawableId &&
+ !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
+ pGlxDraw->destroy (pGlxDraw);
+ return BadAlloc;
+ }
+
+ return Success;
+}
+
+static int
+DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config,
+ XID drawableId, XID glxDrawableId)
+{
+ DrawablePtr pDraw;
+ int err;
+
+ LEGAL_NEW_RESOURCE(glxDrawableId, client);
+
+ err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess);
+ if (err != Success) {
+ client->errorValue = drawableId;
+ return err;
+ }
+ if (pDraw->type != DRAWABLE_PIXMAP) {
+ client->errorValue = drawableId;
+ return BadPixmap;
+ }
+
+ err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId,
+ glxDrawableId, GLX_DRAWABLE_PIXMAP);
+
+ return err;
+}
+
+static void
+determineTextureTarget(ClientPtr client, XID glxDrawableID,
+ CARD32 *attribs, CARD32 numAttribs)
+{
+ GLenum target = 0;
+ GLenum format = 0;
+ int i, err;
+ __GLXdrawable *pGlxDraw;
+
+ if (!validGlxDrawable(client, glxDrawableID, GLX_DRAWABLE_PIXMAP,
+ DixWriteAccess, &pGlxDraw, &err))
+ /* We just added it in CreatePixmap, so we should never get here. */
+ return;
+
+ for (i = 0; i < numAttribs; i++) {
+ if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) {
+ switch (attribs[2 * i + 1]) {
+ case GLX_TEXTURE_2D_EXT:
+ target = GL_TEXTURE_2D;
+ break;
+ case GLX_TEXTURE_RECTANGLE_EXT:
+ target = GL_TEXTURE_RECTANGLE_ARB;
+ break;
+ }
+ }
+
+ if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
+ format = attribs[2 * i + 1];
+ }
+
+ if (!target) {
+ int w = pGlxDraw->pDraw->width, h = pGlxDraw->pDraw->height;
+
+ if (h & (h - 1) || w & (w - 1))
+ target = GL_TEXTURE_RECTANGLE_ARB;
+ else
+ target = GL_TEXTURE_2D;
+ }
+
+ pGlxDraw->target = target;
+ pGlxDraw->format = format;
+}
+
+int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
+ return err;
+
+ return DoCreateGLXPixmap(cl->client, pGlxScreen, config,
+ req->pixmap, req->glxpixmap);
+}
+
+int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq);
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
+ return err;
+
+ err = DoCreateGLXPixmap(cl->client, pGlxScreen, config,
+ req->pixmap, req->glxpixmap);
+ if (err != Success)
+ return err;
+
+ determineTextureTarget(cl->client, req->glxpixmap,
+ (CARD32*) (req + 1), req->numAttribs);
+
+ return Success;
+}
+
+int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPixmapWithConfigSGIXReq *req =
+ (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq);
+
+ if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
+ return err;
+
+ return DoCreateGLXPixmap(cl->client, pGlxScreen,
+ config, req->pixmap, req->glxpixmap);
+}
+
+
+static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
+{
+ __GLXdrawable *pGlxDraw;
+ int err;
+
+ if (!validGlxDrawable(cl->client, glxdrawable, type,
+ DixDestroyAccess, &pGlxDraw, &err))
+ return err;
+
+ FreeResource(glxdrawable, FALSE);
+
+ return Success;
+}
+
+int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
+
+ return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
+}
+
+int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyPixmapReq);
+
+ return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
+}
+
+static int
+DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
+ int width, int height, XID glxDrawableId)
+{
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ PixmapPtr pPixmap;
+ int err;
+
+ LEGAL_NEW_RESOURCE(glxDrawableId, client);
+
+ if (!validGlxScreen(client, screenNum, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err))
+ return err;
+
+ __glXenterServer(GL_FALSE);
+ pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen,
+ width, height, config->rgbBits, 0);
+ __glXleaveServer(GL_FALSE);
+
+ /* Assign the pixmap the same id as the pbuffer and add it as a
+ * resource so it and the DRI2 drawable will be reclaimed when the
+ * pbuffer is destroyed. */
+ pPixmap->drawable.id = glxDrawableId;
+ if (!AddResource(pPixmap->drawable.id, RT_PIXMAP, pPixmap))
+ return BadAlloc;
+
+ return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable,
+ glxDrawableId, glxDrawableId,
+ GLX_DRAWABLE_PBUFFER);
+}
+
+int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
+ CARD32 *attrs;
+ int width, height, i;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq);
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3);
+
+ attrs = (CARD32 *) (req + 1);
+ width = 0;
+ height = 0;
+
+ for (i = 0; i < req->numAttribs; i++) {
+ switch (attrs[i * 2]) {
+ case GLX_PBUFFER_WIDTH:
+ width = attrs[i * 2 + 1];
+ break;
+ case GLX_PBUFFER_HEIGHT:
+ height = attrs[i * 2 + 1];
+ break;
+ case GLX_LARGEST_PBUFFER:
+ case GLX_PRESERVED_CONTENTS:
+ /* FIXME: huh... */
+ break;
+ }
+ }
+
+ return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
+ width, height, req->pbuffer);
+}
+
+int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPbufferSGIXReq);
+
+ return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
+ req->width, req->height, req->pbuffer);
+}
+
+int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
+
+ return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
+}
+
+int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq);
+
+ return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
+}
+
+static int
+DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable,
+ int numAttribs, CARD32 *attribs)
+{
+ __GLXdrawable *pGlxDraw;
+ int i, err;
+
+ if (!validGlxDrawable(client, glxdrawable, GLX_DRAWABLE_ANY,
+ DixSetAttrAccess, &pGlxDraw, &err))
+ return err;
+
+ for (i = 0; i < numAttribs; i++) {
+ switch(attribs[i * 2]) {
+ case GLX_EVENT_MASK:
+ /* All we do is to record the event mask so we can send it
+ * back when queried. We never actually clobber the
+ * pbuffers, so we never need to send out the event. */
+ pGlxDraw->eventMask = attribs[i * 2 + 1];
+ break;
+ }
+ }
+
+ return Success;
+}
+
+int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) pc;
+
+ REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq);
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3);
+
+ return DoChangeDrawableAttributes(cl->client, req->drawable,
+ req->numAttribs, (CARD32 *) (req + 1));
+}
+
+int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXChangeDrawableAttributesSGIXReq *req =
+ (xGLXChangeDrawableAttributesSGIXReq *)pc;
+
+ REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq);
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3);
+
+ return DoChangeDrawableAttributes(cl->client, req->drawable,
+ req->numAttribs, (CARD32 *) (req + 1));
+}
+
+int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+ __GLXconfig *config;
+ __GLXscreen *pGlxScreen;
+ ClientPtr client = cl->client;
+ DrawablePtr pDraw;
+ int err;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq);
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3);
+
+ LEGAL_NEW_RESOURCE(req->glxwindow, client);
+
+ if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
+ return err;
+ if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err))
+ return err;
+
+ err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess);
+ if (err != Success || pDraw->type != DRAWABLE_WINDOW) {
+ client->errorValue = req->window;
+ return BadWindow;
+ }
+
+ if (!validGlxFBConfigForWindow(client, config, pDraw, &err))
+ return err;
+
+ return DoCreateGLXDrawable(client, pGlxScreen, config,
+ pDraw, req->window,
+ req->glxwindow, GLX_DRAWABLE_WINDOW);
+}
+
+int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyWindowReq);
+
+ return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW);
+}
+
+
+/*****************************************************************************/
+
+/*
+** NOTE: There is no portable implementation for swap buffers as of
+** this time that is of value. Consequently, this code must be
+** implemented by somebody other than SGI.
+*/
+int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
+ GLXContextTag tag;
+ XID drawId;
+ struct glx_context *glxc = NULL;
+ __GLXdrawable *pGlxDraw;
+ int error;
+
+ REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
+
+ tag = req->contextTag;
+ drawId = req->drawable;
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc) {
+ return __glXError(GLXBadContextTag);
+ }
+ /*
+ ** The calling thread is swapping its current drawable. In this case,
+ ** glxSwapBuffers is in both GL and X streams, in terms of
+ ** sequentiality.
+ */
+ if (__glXForceCurrent(cl, tag, &error)) {
+ /*
+ ** Do whatever is needed to make sure that all preceding requests
+ ** in both streams are completed before the swap is executed.
+ */
+ CALL_Finish( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(glxc);
+ } else {
+ return error;
+ }
+ }
+
+ pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error);
+ if (pGlxDraw == NULL)
+ return error;
+
+ if (pGlxDraw->type == DRAWABLE_WINDOW &&
+ (*pGlxDraw->swapBuffers)(cl->client, pGlxDraw) == GL_FALSE)
+ return __glXError(GLXBadDrawable);
+
+ return Success;
+}
+
+
+static int
+DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
+{
+ ClientPtr client = cl->client;
+ struct glx_context *ctx;
+ xGLXQueryContextInfoEXTReply reply;
+ int nProps;
+ int *sendBuf, *pSendBuf;
+ int nReplyBytes;
+ int err;
+
+ if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err))
+ return err;
+
+ nProps = 3;
+ reply.length = nProps << 1;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.n = nProps;
+
+ nReplyBytes = reply.length << 2;
+ sendBuf = (int *)malloc((size_t)nReplyBytes);
+ if (sendBuf == NULL) {
+ return __glXError(GLXBadContext); /* XXX: Is this correct? */
+ }
+ pSendBuf = sendBuf;
+ *pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
+ *pSendBuf++ = (int)(ctx->share_id);
+ *pSendBuf++ = GLX_VISUAL_ID_EXT;
+ *pSendBuf++ = (int)(ctx->config->visualID);
+ *pSendBuf++ = GLX_SCREEN_EXT;
+ *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum);
+
+ if (client->swapped) {
+ __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
+ WriteToClient(client, nReplyBytes, (char *)sendBuf);
+ }
+ free((char *)sendBuf);
+
+ return Success;
+}
+
+int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq);
+
+ return DoQueryContext(cl, req->context);
+}
+
+int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
+
+ REQUEST_SIZE_MATCH(xGLXQueryContextReq);
+
+ return DoQueryContext(cl, req->context);
+}
+
+int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ ClientPtr client = cl->client;
+ struct glx_context *context;
+ __GLXdrawable *pGlxDraw;
+ GLXDrawable drawId;
+ int buffer;
+ int error;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ drawId = *((CARD32 *) (pc));
+ buffer = *((INT32 *) (pc + 4));
+
+ if (buffer != GLX_FRONT_LEFT_EXT)
+ return __glXError(GLXBadPixmap);
+
+ context = __glXForceCurrent (cl, req->contextTag, &error);
+ if (!context)
+ return error;
+
+ if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP,
+ DixReadAccess, &pGlxDraw, &error))
+ return error;
+
+ if (!context->textureFromPixmap)
+ return __glXError(GLXUnsupportedPrivateRequest);
+
+ return context->textureFromPixmap->bindTexImage(context,
+ buffer,
+ pGlxDraw);
+}
+
+int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ ClientPtr client = cl->client;
+ __GLXdrawable *pGlxDraw;
+ struct glx_context *context;
+ GLXDrawable drawId;
+ int buffer;
+ int error;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ drawId = *((CARD32 *) (pc));
+ buffer = *((INT32 *) (pc + 4));
+
+ context = __glXForceCurrent (cl, req->contextTag, &error);
+ if (!context)
+ return error;
+
+ if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP,
+ DixReadAccess, &pGlxDraw, &error))
+ return error;
+
+ if (!context->textureFromPixmap)
+ return __glXError(GLXUnsupportedPrivateRequest);
+
+ return context->textureFromPixmap->releaseTexImage(context,
+ buffer,
+ pGlxDraw);
+}
+
+int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLXContextTag tag = req->contextTag;
+ struct glx_context *glxc = NULL;
+ __GLXdrawable *pGlxDraw;
+ ClientPtr client = cl->client;
+ GLXDrawable drawId;
+ int error;
+ int x, y, width, height;
+
+ (void) client;
+ (void) req;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20);
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ drawId = *((CARD32 *) (pc));
+ x = *((INT32 *) (pc + 4));
+ y = *((INT32 *) (pc + 8));
+ width = *((INT32 *) (pc + 12));
+ height = *((INT32 *) (pc + 16));
+
+ if (tag) {
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc) {
+ return __glXError(GLXBadContextTag);
+ }
+ /*
+ ** The calling thread is swapping its current drawable. In this case,
+ ** glxSwapBuffers is in both GL and X streams, in terms of
+ ** sequentiality.
+ */
+ if (__glXForceCurrent(cl, tag, &error)) {
+ /*
+ ** Do whatever is needed to make sure that all preceding requests
+ ** in both streams are completed before the swap is executed.
+ */
+ CALL_Finish( GET_DISPATCH(), () );
+ __GLX_NOTE_FLUSHED_CMDS(glxc);
+ } else {
+ return error;
+ }
+ }
+
+ pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error);
+ if (!pGlxDraw)
+ return error;
+
+ if (pGlxDraw == NULL ||
+ pGlxDraw->type != GLX_DRAWABLE_WINDOW ||
+ pGlxDraw->copySubBuffer == NULL)
+ return __glXError(GLXBadDrawable);
+
+ (*pGlxDraw->copySubBuffer)(pGlxDraw, x, y, width, height);
+
+ return Success;
+}
+
+/*
+** Get drawable attributes
+*/
+static int
+DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
+{
+ ClientPtr client = cl->client;
+ xGLXGetDrawableAttributesReply reply;
+ __GLXdrawable *pGlxDraw;
+ CARD32 attributes[6];
+ int numAttribs, error;
+
+ if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
+ DixGetAttrAccess, &pGlxDraw, &error))
+ return error;
+
+ numAttribs = 3;
+ reply.length = numAttribs << 1;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.numAttribs = numAttribs;
+
+ attributes[0] = GLX_TEXTURE_TARGET_EXT;
+ attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
+ GLX_TEXTURE_RECTANGLE_EXT;
+ attributes[2] = GLX_Y_INVERTED_EXT;
+ attributes[3] = GL_FALSE;
+ attributes[4] = GLX_EVENT_MASK;
+ attributes[5] = pGlxDraw->eventMask;
+
+ if (client->swapped) {
+ __glXSwapGetDrawableAttributesReply(client, &reply, attributes);
+ } else {
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
+ (char *)&reply);
+ WriteToClient(client, reply.length * sizeof (CARD32),
+ (char *)attributes);
+ }
+
+ return Success;
+}
+
+int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
+
+ REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesReq);
+
+ return DoGetDrawableAttributes(cl, req->drawable);
+}
+
+int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetDrawableAttributesSGIXReq *req =
+ (xGLXGetDrawableAttributesSGIXReq *)pc;
+
+ REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq);
+
+ return DoGetDrawableAttributes(cl, req->drawable);
+}
+
+/************************************************************************/
+
+/*
+** Render and Renderlarge are not in the GLX API. They are used by the GLX
+** client library to send batches of GL rendering commands.
+*/
+
+/*
+** Execute all the drawing commands in a request.
+*/
+int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderReq *req;
+ ClientPtr client= cl->client;
+ int left, cmdlen, error;
+ int commandsDone;
+ CARD16 opcode;
+ __GLXrenderHeader *hdr;
+ struct glx_context *glxc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_AT_LEAST_SIZE(xGLXRenderReq);
+
+ req = (xGLXRenderReq *) pc;
+ if (client->swapped) {
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ }
+
+ glxc = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!glxc) {
+ return error;
+ }
+
+ commandsDone = 0;
+ pc += sz_xGLXRenderReq;
+ left = (req->length << 2) - sz_xGLXRenderReq;
+ while (left > 0) {
+ __GLXrenderSizeData entry;
+ int extra;
+ __GLXdispatchRenderProcPtr proc;
+ int err;
+
+ if (left < sizeof(__GLXrenderHeader))
+ return BadLength;
+
+ /*
+ ** Verify that the header length and the overall length agree.
+ ** Also, each command must be word aligned.
+ */
+ hdr = (__GLXrenderHeader *) pc;
+ if (client->swapped) {
+ __GLX_SWAP_SHORT(&hdr->length);
+ __GLX_SWAP_SHORT(&hdr->opcode);
+ }
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ /*
+ ** Check for core opcodes and grab entry data.
+ */
+ err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry);
+ proc = (__GLXdispatchRenderProcPtr)
+ __glXGetProtocolDecodeFunction(& Render_dispatch_info,
+ opcode, client->swapped);
+
+ if ((err < 0) || (proc == NULL)) {
+ client->errorValue = commandsDone;
+ return __glXError(GLXBadRenderRequest);
+ }
+
+ if (entry.varsize) {
+ /* variable size command */
+ extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE,
+ client->swapped);
+ if (extra < 0) {
+ extra = 0;
+ }
+ if (cmdlen != __GLX_PAD(entry.bytes + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry.bytes)) {
+ return BadLength;
+ }
+ }
+ if (left < cmdlen) {
+ return BadLength;
+ }
+
+ /*
+ ** Skip over the header and execute the command. We allow the
+ ** caller to trash the command memory. This is useful especially
+ ** for things that require double alignment - they can just shift
+ ** the data towards lower memory (trashing the header) by 4 bytes
+ ** and achieve the required alignment.
+ */
+ (*proc)(pc + __GLX_RENDER_HDR_SIZE);
+ pc += cmdlen;
+ left -= cmdlen;
+ commandsDone++;
+ }
+ __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+ return Success;
+}
+
+
+/*
+** Execute a large rendering request (one that spans multiple X requests).
+*/
+int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXRenderLargeReq *req;
+ ClientPtr client= cl->client;
+ size_t dataBytes;
+ __GLXrenderLargeHeader *hdr;
+ struct glx_context *glxc;
+ int error;
+ CARD16 opcode;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ req = (xGLXRenderLargeReq *) pc;
+ if (client->swapped) {
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->dataBytes);
+ __GLX_SWAP_SHORT(&req->requestNumber);
+ __GLX_SWAP_SHORT(&req->requestTotal);
+ }
+
+ glxc = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!glxc) {
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return error;
+ }
+ dataBytes = req->dataBytes;
+
+ /*
+ ** Check the request length.
+ */
+ if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) {
+ client->errorValue = req->length;
+ /* Reset in case this isn't 1st request. */
+ __glXResetLargeCommandStatus(cl);
+ return BadLength;
+ }
+ pc += sz_xGLXRenderLargeReq;
+
+ if (cl->largeCmdRequestsSoFar == 0) {
+ __GLXrenderSizeData entry;
+ int extra;
+ size_t cmdlen;
+ int err;
+
+ /*
+ ** This is the first request of a multi request command.
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (req->requestNumber != 1) {
+ client->errorValue = req->requestNumber;
+ return __glXError(GLXBadLargeRequest);
+ }
+
+ hdr = (__GLXrenderLargeHeader *) pc;
+ if (client->swapped) {
+ __GLX_SWAP_INT(&hdr->length);
+ __GLX_SWAP_INT(&hdr->opcode);
+ }
+ cmdlen = hdr->length;
+ opcode = hdr->opcode;
+
+ /*
+ ** Check for core opcodes and grab entry data.
+ */
+ err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry);
+ if (err < 0) {
+ client->errorValue = opcode;
+ return __glXError(GLXBadLargeRequest);
+ }
+
+ if (entry.varsize) {
+ /*
+ ** If it's a variable-size command (a command whose length must
+ ** be computed from its parameters), all the parameters needed
+ ** will be in the 1st request, so it's okay to do this.
+ */
+ extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE,
+ client->swapped);
+ if (extra < 0) {
+ extra = 0;
+ }
+ /* large command's header is 4 bytes longer, so add 4 */
+ if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) {
+ return BadLength;
+ }
+ } else {
+ /* constant size command */
+ if (cmdlen != __GLX_PAD(entry.bytes + 4)) {
+ return BadLength;
+ }
+ }
+ /*
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (cl->largeCmdBufSize < cmdlen) {
+ if (!cl->largeCmdBuf) {
+ cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
+ } else {
+ cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
+ }
+ if (!cl->largeCmdBuf) {
+ return BadAlloc;
+ }
+ cl->largeCmdBufSize = cmdlen;
+ }
+ memcpy(cl->largeCmdBuf, pc, dataBytes);
+
+ cl->largeCmdBytesSoFar = dataBytes;
+ cl->largeCmdBytesTotal = cmdlen;
+ cl->largeCmdRequestsSoFar = 1;
+ cl->largeCmdRequestsTotal = req->requestTotal;
+ return Success;
+
+ } else {
+ /*
+ ** We are receiving subsequent (i.e. not the first) requests of a
+ ** multi request command.
+ */
+
+ /*
+ ** Check the request number and the total request count.
+ */
+ if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
+ client->errorValue = req->requestNumber;
+ __glXResetLargeCommandStatus(cl);
+ return __glXError(GLXBadLargeRequest);
+ }
+ if (req->requestTotal != cl->largeCmdRequestsTotal) {
+ client->errorValue = req->requestTotal;
+ __glXResetLargeCommandStatus(cl);
+ return __glXError(GLXBadLargeRequest);
+ }
+
+ /*
+ ** Check that we didn't get too much data.
+ */
+ if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXError(GLXBadLargeRequest);
+ }
+ memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
+ cl->largeCmdBytesSoFar += dataBytes;
+ cl->largeCmdRequestsSoFar++;
+
+ if (req->requestNumber == cl->largeCmdRequestsTotal) {
+ __GLXdispatchRenderProcPtr proc;
+
+ /*
+ ** This is the last request; it must have enough bytes to complete
+ ** the command.
+ */
+ /* NOTE: the two pad macros have been added below; they are needed
+ ** because the client library pads the total byte count, but not
+ ** the per-request byte counts. The Protocol Encoding says the
+ ** total byte count should not be padded, so a proposal will be
+ ** made to the ARB to relax the padding constraint on the total
+ ** byte count, thus preserving backward compatibility. Meanwhile,
+ ** the padding done below fixes a bug that did not allow
+ ** large commands of odd sizes to be accepted by the server.
+ */
+ if (__GLX_PAD(cl->largeCmdBytesSoFar) !=
+ __GLX_PAD(cl->largeCmdBytesTotal)) {
+ client->errorValue = dataBytes;
+ __glXResetLargeCommandStatus(cl);
+ return __glXError(GLXBadLargeRequest);
+ }
+ hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
+ /*
+ ** The opcode and length field in the header had already been
+ ** swapped when the first request was received.
+ **
+ ** Use the opcode to index into the procedure table.
+ */
+ opcode = hdr->opcode;
+
+ proc = (__GLXdispatchRenderProcPtr)
+ __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode,
+ client->swapped);
+ if (proc == NULL) {
+ client->errorValue = opcode;
+ return __glXError(GLXBadLargeRequest);
+ }
+
+ /*
+ ** Skip over the header and execute the command.
+ */
+ (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
+ __GLX_NOTE_UNFLUSHED_CMDS(glxc);
+
+ /*
+ ** Reset for the next RenderLarge series.
+ */
+ __glXResetLargeCommandStatus(cl);
+ } else {
+ /*
+ ** This is neither the first nor the last request.
+ */
+ }
+ return Success;
+ }
+}
+
+/************************************************************************/
+
+/*
+** No support is provided for the vendor-private requests other than
+** allocating the entry points in the dispatch table.
+*/
+
+int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLint vendorcode = req->vendorCode;
+ __GLXdispatchVendorPrivProcPtr proc;
+
+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
+
+ proc = (__GLXdispatchVendorPrivProcPtr)
+ __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
+ vendorcode, 0);
+ if (proc != NULL) {
+ (*proc)(cl, (GLbyte*)req);
+ return Success;
+ }
+
+ cl->client->errorValue = req->vendorCode;
+ return __glXError(GLXUnsupportedPrivateRequest);
+}
+
+int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLint vendorcode = req->vendorCode;
+ __GLXdispatchVendorPrivProcPtr proc;
+
+ REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
+
+ proc = (__GLXdispatchVendorPrivProcPtr)
+ __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
+ vendorcode, 0);
+ if (proc != NULL) {
+ return (*proc)(cl, (GLbyte*)req);
+ }
+
+ cl->client->errorValue = vendorcode;
+ return __glXError(GLXUnsupportedPrivateRequest);
+}
+
+int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
+ xGLXQueryExtensionsStringReply reply;
+ __GLXscreen *pGlxScreen;
+ size_t n, length;
+ char *buf;
+ int err;
+
+ REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
+
+ if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
+ return err;
+
+ n = strlen(pGlxScreen->GLXextensions) + 1;
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+
+ /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/
+ buf = (char *) malloc(length << 2);
+ if (buf == NULL)
+ return BadAlloc;
+ memcpy(buf, pGlxScreen->GLXextensions, n);
+
+ if (client->swapped) {
+ glxSwapQueryExtensionsStringReply(client, &reply, buf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply);
+ WriteToClient(client, (int)(length << 2), (char *)buf);
+ }
+
+ free(buf);
+ return Success;
+}
+
+int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
+ xGLXQueryServerStringReply reply;
+ size_t n, length;
+ const char *ptr;
+ char *buf;
+ __GLXscreen *pGlxScreen;
+ int err;
+ char ver_str[16];
+
+ REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
+
+ if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
+ return err;
+
+ switch(req->name) {
+ case GLX_VENDOR:
+ ptr = pGlxScreen->GLXvendor;
+ break;
+ case GLX_VERSION:
+ /* Return to the server version rather than the screen version
+ * to prevent confusion when they do not match.
+ */
+ snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
+ ptr = ver_str;
+ break;
+ case GLX_EXTENSIONS:
+ ptr = pGlxScreen->GLXextensions;
+ break;
+ default:
+ return BadValue;
+ }
+
+ n = strlen(ptr) + 1;
+ length = __GLX_PAD(n) >> 2;
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.length = length;
+ reply.n = n;
+
+ buf = (char *) malloc(length << 2);
+ if (buf == NULL) {
+ return BadAlloc;
+ }
+ memcpy(buf, ptr, n);
+
+ if (client->swapped) {
+ glxSwapQueryServerStringReply(client, &reply, buf);
+ } else {
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply);
+ WriteToClient(client, (int)(length << 2), buf);
+ }
+
+ free(buf);
+ return Success;
+}
+
+int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
+ const char *buf;
+
+ REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq);
+
+ buf = (const char *)(req+1);
+ if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq)))
+ return BadLength;
+
+ cl->GLClientmajorVersion = req->major;
+ cl->GLClientminorVersion = req->minor;
+ free(cl->GLClientextensions);
+ cl->GLClientextensions = strdup(buf);
+
+ return Success;
+}
diff --git a/xorg-server/glx/glxcmdsswap.c b/xorg-server/glx/glxcmdsswap.c
index 765a46eb6..f053b1ad5 100644
--- a/xorg-server/glx/glxcmdsswap.c
+++ b/xorg-server/glx/glxcmdsswap.c
@@ -1,775 +1,920 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * 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 including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * 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
- * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-
-#include "glheader.h"
-
-#endif
-
-#include <string.h>
-#include "glxserver.h"
-#include "glxutil.h"
-#include <GL/glxtokens.h>
-#include <unpack.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include "glxext.h"
-#include "GL/gl.h"
-#include "glapitable.h"
-#include "glapi.h"
-#include "glthread.h"
-#include "dispatch.h"
-#include "indirect_dispatch.h"
-#include "indirect_table.h"
-#include "indirect_util.h"
-
-
-/************************************************************************/
-
-/*
-** Byteswapping versions of GLX commands. In most cases they just swap
-** the incoming arguments and then call the unswapped routine. For commands
-** that have replies, a separate swapping routine for the reply is provided;
-** it is called at the end of the unswapped routine.
-*/
-
-int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->visual);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->shareList);
-
- return __glXDisp_CreateContext(cl, pc);
-}
-
-int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->renderType);
- __GLX_SWAP_INT(&req->shareList);
-
- return __glXDisp_CreateNewContext(cl, pc);
-}
-
-int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateContextWithConfigSGIXReq *req =
- (xGLXCreateContextWithConfigSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->renderType);
- __GLX_SWAP_INT(&req->shareList);
-
- return __glXDisp_CreateContextWithConfigSGIX(cl, pc);
-}
-
-int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXDisp_DestroyContext(cl, pc);
-}
-
-int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXDisp_MakeCurrent(cl, pc);
-}
-
-int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->readdrawable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXDisp_MakeContextCurrent(cl, pc);
-}
-
-int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->readable);
- __GLX_SWAP_INT(&req->context);
- __GLX_SWAP_INT(&req->oldContextTag);
-
- return __glXDisp_MakeCurrentReadSGI(cl, pc);
-}
-
-int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXDisp_IsDirect(cl, pc);
-}
-
-int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->majorVersion);
- __GLX_SWAP_INT(&req->minorVersion);
-
- return __glXDisp_QueryVersion(cl, pc);
-}
-
-int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- return __glXDisp_WaitGL(cl, pc);
-}
-
-int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- return __glXDisp_WaitX(cl, pc);
-}
-
-int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->source);
- __GLX_SWAP_INT(&req->dest);
- __GLX_SWAP_INT(&req->mask);
-
- return __glXDisp_CopyContext(cl, pc);
-}
-
-int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->screen);
- return __glXDisp_GetVisualConfigs(cl, pc);
-}
-
-int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->screen);
- return __glXDisp_GetFBConfigs(cl, pc);
-}
-
-int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->screen);
- return __glXDisp_GetFBConfigsSGIX(cl, pc);
-}
-
-int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->visual);
- __GLX_SWAP_INT(&req->pixmap);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXDisp_CreateGLXPixmap(cl, pc);
-}
-
-int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
- CARD32 *attribs;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->pixmap);
- __GLX_SWAP_INT(&req->glxpixmap);
- __GLX_SWAP_INT(&req->numAttribs);
- attribs = (CARD32*)(req + 1);
- __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
-
- return __glXDisp_CreatePixmap(cl, pc);
-}
-
-int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPixmapWithConfigSGIXReq *req =
- (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->pixmap);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc);
-}
-
-int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXDisp_DestroyGLXPixmap(cl, pc);
-}
-
-int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->glxpixmap);
-
- return __glXDisp_DestroyGLXPixmap(cl, pc);
-}
-
-int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->context);
-
- return __glXDisp_QueryContext(cl, pc);
-}
-
-int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- CARD32 *attribs;
-
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->pbuffer);
- __GLX_SWAP_INT(&req->numAttribs);
- attribs = (CARD32*)(req + 1);
- __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
-
- return __glXDisp_CreatePbuffer(cl, pc);
-}
-
-int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->pbuffer);
- __GLX_SWAP_INT(&req->width);
- __GLX_SWAP_INT(&req->height);
-
- return __glXDisp_CreateGLXPbufferSGIX(cl, pc);
-}
-
-int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->pbuffer);
-
- return __glXDisp_DestroyPbuffer(cl, pc);
-}
-
-int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->pbuffer);
-
- return __glXDisp_DestroyGLXPbufferSGIX(cl, pc);
-}
-
-int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXChangeDrawableAttributesReq *req =
- (xGLXChangeDrawableAttributesReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- CARD32 *attribs;
-
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->numAttribs);
- attribs = (CARD32*)(req + 1);
- __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
-
- return __glXDisp_ChangeDrawableAttributes(cl, pc);
-}
-
-int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
- GLbyte *pc)
-{
- xGLXChangeDrawableAttributesSGIXReq *req =
- (xGLXChangeDrawableAttributesSGIXReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- CARD32 *attribs;
-
- __GLX_SWAP_INT(&req->drawable);
- __GLX_SWAP_INT(&req->numAttribs);
- attribs = (CARD32*)(req + 1);
- __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
-
- return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc);
-}
-
-int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- CARD32 *attribs;
-
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->fbconfig);
- __GLX_SWAP_INT(&req->window);
- __GLX_SWAP_INT(&req->glxwindow);
- __GLX_SWAP_INT(&req->numAttribs);
- attribs = (CARD32*)(req + 1);
- __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs);
-
- return __glXDisp_CreateWindow(cl, pc);
-}
-
-int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_INT(&req->glxwindow);
-
- return __glXDisp_DestroyWindow(cl, pc);
-}
-
-int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->drawable);
-
- return __glXDisp_SwapBuffers(cl, pc);
-}
-
-int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(&req->font);
- __GLX_SWAP_INT(&req->first);
- __GLX_SWAP_INT(&req->count);
- __GLX_SWAP_INT(&req->listBase);
-
- return __glXDisp_UseXFont(cl, pc);
-}
-
-
-int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
-
- return __glXDisp_QueryExtensionsString(cl, pc);
-}
-
-int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->screen);
- __GLX_SWAP_INT(&req->name);
-
- return __glXDisp_QueryServerString(cl, pc);
-}
-
-int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->major);
- __GLX_SWAP_INT(&req->minor);
- __GLX_SWAP_INT(&req->numbytes);
-
- return __glXDisp_ClientInfo(cl, pc);
-}
-
-int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->context);
-
- return __glXDisp_QueryContextInfoEXT(cl, pc);
-}
-
-int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLXDrawable *drawId;
- int *buffer;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- drawId = ((GLXDrawable *) (pc));
- buffer = ((int *) (pc + 4));
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(drawId);
- __GLX_SWAP_INT(buffer);
-
- return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc);
-}
-
-int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLXDrawable *drawId;
- int *buffer;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- drawId = ((GLXDrawable *) (pc));
- buffer = ((int *) (pc + 4));
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(drawId);
- __GLX_SWAP_INT(buffer);
-
- return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *)pc);
-}
-
-int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- GLXDrawable *drawId;
- int *buffer;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- (void) drawId;
- (void) buffer;
-
- pc += __GLX_VENDPRIV_HDR_SIZE;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(pc);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
-
- return __glXDisp_CopySubBufferMESA(cl, pc);
-
-}
-
-int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc;
- CARD32 *data;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- data = (CARD32 *) (req + 1);
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
- __GLX_SWAP_INT(data);
-
- return __glXDisp_GetDrawableAttributesSGIX(cl, pc);
-}
-
-int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->drawable);
-
- return __glXDisp_GetDrawableAttributes(cl, pc);
-}
-
-
-/************************************************************************/
-
-/*
-** Swap replies.
-*/
-
-void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->contextTag);
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
-}
-
-void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
-}
-
-void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
-{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->majorVersion);
- __GLX_SWAP_INT(&reply->minorVersion);
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
-}
-
-void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, buf);
-}
-
-void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
- /** no swap is needed for an array of chars **/
- /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
- WriteToClient(client, length << 2, buf);
-}
-
-void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, (char *)buf);
-}
-
-void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *reply, CARD32 *buf)
-{
- int length = reply->length;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->numAttribs);
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, (char *)buf);
-}
-
-/************************************************************************/
-
-/*
-** Render and Renderlarge are not in the GLX API. They are used by the GLX
-** client library to send batches of GL rendering commands.
-*/
-
-int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc)
-{
- return __glXDisp_Render(cl, pc);
-}
-
-/*
-** Execute a large rendering request (one that spans multiple X requests).
-*/
-int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
-{
- return __glXDisp_RenderLarge(cl, pc);
-}
-
-/************************************************************************/
-
-/*
-** No support is provided for the vendor-private requests other than
-** allocating these entry points in the dispatch table.
-*/
-
-int __glXDispSwap_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateReq *req;
- GLint vendorcode;
- __GLXdispatchVendorPrivProcPtr proc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXVendorPrivateReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
-
- vendorcode = req->vendorCode;
-
- proc = (__GLXdispatchVendorPrivProcPtr)
- __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
- vendorcode, 1);
- if (proc != NULL) {
- (*proc)(cl, (GLbyte*)req);
- return Success;
- }
-
- cl->client->errorValue = req->vendorCode;
- return __glXError(GLXUnsupportedPrivateRequest);
-}
-
-
-int __glXDispSwap_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
-{
- xGLXVendorPrivateWithReplyReq *req;
- GLint vendorcode;
- __GLXdispatchVendorPrivProcPtr proc;
-
- __GLX_DECLARE_SWAP_VARIABLES;
-
- req = (xGLXVendorPrivateWithReplyReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
-
- vendorcode = req->vendorCode;
-
- proc = (__GLXdispatchVendorPrivProcPtr)
- __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
- vendorcode, 1);
- if (proc != NULL) {
- return (*proc)(cl, (GLbyte*)req);
- }
-
- cl->client->errorValue = req->vendorCode;
- return __glXError(GLXUnsupportedPrivateRequest);
-}
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
+
+#include <string.h>
+#include "glxserver.h"
+#include "glxutil.h"
+#include <GL/glxtokens.h>
+#include <unpack.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include "glxext.h"
+#include "GL/gl.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+#include "indirect_dispatch.h"
+#include "indirect_table.h"
+#include "indirect_util.h"
+
+
+/************************************************************************/
+
+/*
+** Byteswapping versions of GLX commands. In most cases they just swap
+** the incoming arguments and then call the unswapped routine. For commands
+** that have replies, a separate swapping routine for the reply is provided;
+** it is called at the end of the unswapped routine.
+*/
+
+int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateContextReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->visual);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return __glXDisp_CreateContext(cl, pc);
+}
+
+int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->renderType);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return __glXDisp_CreateNewContext(cl, pc);
+}
+
+int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->renderType);
+ __GLX_SWAP_INT(&req->shareList);
+
+ return __glXDisp_CreateContextWithConfigSGIX(cl, pc);
+}
+
+int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXDisp_DestroyContext(cl, pc);
+}
+
+int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return __glXDisp_MakeCurrent(cl, pc);
+}
+
+int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readdrawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return __glXDisp_MakeContextCurrent(cl, pc);
+}
+
+int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return __glXDisp_MakeCurrentReadSGI(cl, pc);
+}
+
+int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXIsDirectReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXDisp_IsDirect(cl, pc);
+}
+
+int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->majorVersion);
+ __GLX_SWAP_INT(&req->minorVersion);
+
+ return __glXDisp_QueryVersion(cl, pc);
+}
+
+int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXWaitGLReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ return __glXDisp_WaitGL(cl, pc);
+}
+
+int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXWaitXReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ return __glXDisp_WaitX(cl, pc);
+}
+
+int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCopyContextReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->source);
+ __GLX_SWAP_INT(&req->dest);
+ __GLX_SWAP_INT(&req->mask);
+
+ return __glXDisp_CopyContext(cl, pc);
+}
+
+int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ return __glXDisp_GetVisualConfigs(cl, pc);
+}
+
+int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ return __glXDisp_GetFBConfigs(cl, pc);
+}
+
+int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetFBConfigsSGIXReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ return __glXDisp_GetFBConfigsSGIX(cl, pc);
+}
+
+int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->visual);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDisp_CreateGLXPixmap(cl, pc);
+}
+
+int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+ CARD32 *attribs;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+ __GLX_SWAP_INT(&req->numAttribs);
+
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3);
+ attribs = (CARD32*)(req + 1);
+ __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
+
+ return __glXDisp_CreatePixmap(cl, pc);
+}
+
+int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPixmapWithConfigSGIXReq *req =
+ (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pixmap);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc);
+}
+
+int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDisp_DestroyGLXPixmap(cl, pc);
+}
+
+int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->glxpixmap);
+
+ return __glXDisp_DestroyGLXPixmap(cl, pc);
+}
+
+int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXQueryContextReq);
+
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXDisp_QueryContext(cl, pc);
+}
+
+int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ CARD32 *attribs;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pbuffer);
+ __GLX_SWAP_INT(&req->numAttribs);
+
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3);
+ attribs = (CARD32*)(req + 1);
+ __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
+
+ return __glXDisp_CreatePbuffer(cl, pc);
+}
+
+int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXCreateGLXPbufferSGIXReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->pbuffer);
+ __GLX_SWAP_INT(&req->width);
+ __GLX_SWAP_INT(&req->height);
+
+ return __glXDisp_CreateGLXPbufferSGIX(cl, pc);
+}
+
+int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
+
+ __GLX_SWAP_INT(&req->pbuffer);
+
+ return __glXDisp_DestroyPbuffer(cl, pc);
+}
+
+int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq);
+
+ __GLX_SWAP_INT(&req->pbuffer);
+
+ return __glXDisp_DestroyGLXPbufferSGIX(cl, pc);
+}
+
+int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ CARD32 *attribs;
+
+ REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq);
+
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->numAttribs);
+
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3);
+ attribs = (CARD32*)(req + 1);
+ __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
+
+ return __glXDisp_ChangeDrawableAttributes(cl, pc);
+}
+
+int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
+ GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXChangeDrawableAttributesSGIXReq *req =
+ (xGLXChangeDrawableAttributesSGIXReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ CARD32 *attribs;
+
+ REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq);
+
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->numAttribs);
+
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3);
+ attribs = (CARD32*)(req + 1);
+ __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
+
+ return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc);
+}
+
+int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ CARD32 *attribs;
+
+ REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq);
+
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->fbconfig);
+ __GLX_SWAP_INT(&req->window);
+ __GLX_SWAP_INT(&req->glxwindow);
+ __GLX_SWAP_INT(&req->numAttribs);
+
+ if (req->numAttribs > (UINT32_MAX >> 3)) {
+ client->errorValue = req->numAttribs;
+ return BadValue;
+ }
+ REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3);
+ attribs = (CARD32*)(req + 1);
+ __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1);
+
+ return __glXDisp_CreateWindow(cl, pc);
+}
+
+int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXDestroyWindowReq);
+
+ __GLX_SWAP_INT(&req->glxwindow);
+
+ return __glXDisp_DestroyWindow(cl, pc);
+}
+
+int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->drawable);
+
+ return __glXDisp_SwapBuffers(cl, pc);
+}
+
+int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXUseXFontReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->font);
+ __GLX_SWAP_INT(&req->first);
+ __GLX_SWAP_INT(&req->count);
+ __GLX_SWAP_INT(&req->listBase);
+
+ return __glXDisp_UseXFont(cl, pc);
+}
+
+
+int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+
+ return __glXDisp_QueryExtensionsString(cl, pc);
+}
+
+int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->screen);
+ __GLX_SWAP_INT(&req->name);
+
+ return __glXDisp_QueryServerString(cl, pc);
+}
+
+int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->major);
+ __GLX_SWAP_INT(&req->minor);
+ __GLX_SWAP_INT(&req->numbytes);
+
+ return __glXDisp_ClientInfo(cl, pc);
+}
+
+int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->context);
+
+ return __glXDisp_QueryContextInfoEXT(cl, pc);
+}
+
+int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLXDrawable *drawId;
+ int *buffer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ drawId = ((GLXDrawable *) (pc));
+ buffer = ((int *) (pc + 4));
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(drawId);
+ __GLX_SWAP_INT(buffer);
+
+ return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc);
+}
+
+int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLXDrawable *drawId;
+ int *buffer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ drawId = ((GLXDrawable *) (pc));
+ buffer = ((int *) (pc + 4));
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(drawId);
+ __GLX_SWAP_INT(buffer);
+
+ return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *)pc);
+}
+
+int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ GLXDrawable *drawId;
+ int *buffer;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20);
+
+ (void) drawId;
+ (void) buffer;
+
+ pc += __GLX_VENDPRIV_HDR_SIZE;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(pc);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+
+ return __glXDisp_CopySubBufferMESA(cl, pc);
+
+}
+
+int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc;
+ CARD32 *data;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq);
+
+ data = (CARD32 *) (req + 1);
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(data);
+
+ return __glXDisp_GetDrawableAttributesSGIX(cl, pc);
+}
+
+int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesReq);
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->drawable);
+
+ return __glXDisp_GetDrawableAttributes(cl, pc);
+}
+
+
+/************************************************************************/
+
+/*
+** Swap replies.
+*/
+
+void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->contextTag);
+ WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply);
+}
+
+void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
+}
+
+void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
+{
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->majorVersion);
+ __GLX_SWAP_INT(&reply->minorVersion);
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
+}
+
+void glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply *reply, char *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
+ __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, length << 2, buf);
+}
+
+void glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply *reply, char *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
+ /** no swap is needed for an array of chars **/
+ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
+ WriteToClient(client, length << 2, buf);
+}
+
+void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->n);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
+ __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, length << 2, (char *)buf);
+}
+
+void __glXSwapGetDrawableAttributesReply(ClientPtr client,
+ xGLXGetDrawableAttributesReply *reply, CARD32 *buf)
+{
+ int length = reply->length;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->numAttribs);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply);
+ __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, length << 2, (char *)buf);
+}
+
+/************************************************************************/
+
+/*
+** Render and Renderlarge are not in the GLX API. They are used by the GLX
+** client library to send batches of GL rendering commands.
+*/
+
+int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc)
+{
+ return __glXDisp_Render(cl, pc);
+}
+
+/*
+** Execute a large rendering request (one that spans multiple X requests).
+*/
+int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc)
+{
+ return __glXDisp_RenderLarge(cl, pc);
+}
+
+/************************************************************************/
+
+/*
+** No support is provided for the vendor-private requests other than
+** allocating these entry points in the dispatch table.
+*/
+
+int __glXDispSwap_VendorPrivate(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateReq *req;
+ GLint vendorcode;
+ __GLXdispatchVendorPrivProcPtr proc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ req = (xGLXVendorPrivateReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+
+ vendorcode = req->vendorCode;
+
+ proc = (__GLXdispatchVendorPrivProcPtr)
+ __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
+ vendorcode, 1);
+ if (proc != NULL) {
+ (*proc)(cl, (GLbyte*)req);
+ return Success;
+ }
+
+ cl->client->errorValue = req->vendorCode;
+ return __glXError(GLXUnsupportedPrivateRequest);
+}
+
+
+int __glXDispSwap_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+{
+ xGLXVendorPrivateWithReplyReq *req;
+ GLint vendorcode;
+ __GLXdispatchVendorPrivProcPtr proc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ req = (xGLXVendorPrivateWithReplyReq *) pc;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+
+ vendorcode = req->vendorCode;
+
+ proc = (__GLXdispatchVendorPrivProcPtr)
+ __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info,
+ vendorcode, 1);
+ if (proc != NULL) {
+ return (*proc)(cl, (GLbyte*)req);
+ }
+
+ cl->client->errorValue = req->vendorCode;
+ return __glXError(GLXUnsupportedPrivateRequest);
+}
diff --git a/xorg-server/glx/xfont.c b/xorg-server/glx/xfont.c
index 26a93a8ed..393c2a2a0 100644
--- a/xorg-server/glx/xfont.c
+++ b/xorg-server/glx/xfont.c
@@ -1,188 +1,190 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * 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 including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * 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
- * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-
-#include "glheader.h"
-
-#endif
-
-#include "glxserver.h"
-#include "glxutil.h"
-#include "unpack.h"
-#include "glapitable.h"
-#include "glapi.h"
-#include "glthread.h"
-#include "dispatch.h"
-#include "indirect_dispatch.h"
-#include <GL/gl.h>
-#include <pixmapstr.h>
-#include <windowstr.h>
-#include <dixfontstr.h>
-
-/*
-** Make a single GL bitmap from a single X glyph
-*/
-static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
-{
- int i, j;
- int widthPadded; /* width of glyph in bytes, as padded by X */
- int allocBytes; /* bytes to allocate to store bitmap */
- int w; /* width of glyph in bits */
- int h; /* height of glyph */
- register unsigned char *pglyph;
- register unsigned char *p;
- unsigned char *allocbuf;
-#define __GL_CHAR_BUF_SIZE 2048
- unsigned char buf[__GL_CHAR_BUF_SIZE];
-
- w = GLYPHWIDTHPIXELS(pci);
- h = GLYPHHEIGHTPIXELS(pci);
- widthPadded = GLYPHWIDTHBYTESPADDED(pci);
-
- /*
- ** Use the local buf if possible, otherwise malloc.
- */
- allocBytes = widthPadded * h;
- if (allocBytes <= __GL_CHAR_BUF_SIZE) {
- p = buf;
- allocbuf = 0;
- } else {
- p = (unsigned char *) malloc(allocBytes);
- if (!p)
- return BadAlloc;
- allocbuf = p;
- }
-
- /*
- ** We have to reverse the picture, top to bottom
- */
-
- pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
- for (j=0; j < h; j++) {
- for (i=0; i < widthPadded; i++) {
- p[i] = pglyph[i];
- }
- pglyph -= widthPadded;
- p += widthPadded;
- }
- CALL_Bitmap( GET_DISPATCH(), (w, h, -pci->metrics.leftSideBearing,
- pci->metrics.descent,
- pci->metrics.characterWidth, 0,
- allocbuf ? allocbuf : buf) );
-
- free(allocbuf);
- return Success;
-#undef __GL_CHAR_BUF_SIZE
-}
-
-/*
-** Create a GL bitmap for each character in the X font. The bitmap is stored
-** in a display list.
-*/
-
-static int
-MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
-{
- unsigned long i, nglyphs;
- CARD8 chs[2]; /* the font index we are going after */
- CharInfoPtr pci;
- int rv; /* return value */
- int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
-
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, FALSE) );
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst) );
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, 0) );
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
- CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, GLYPHPADBYTES) );
- for (i=0; i < count; i++) {
- chs[0] = (first + i) >> 8; /* high byte is first byte */
- chs[1] = first + i;
-
- (*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
- &nglyphs, &pci);
-
- /*
- ** Define a display list containing just a glBitmap() call.
- */
- CALL_NewList( GET_DISPATCH(), (list_base + i, GL_COMPILE) );
- if (nglyphs ) {
- rv = __glXMakeBitmapFromGlyph(pFont, pci);
- if (rv) {
- return rv;
- }
- }
- CALL_EndList( GET_DISPATCH(), () );
- }
- return Success;
-}
-
-/************************************************************************/
-
-int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
-{
- ClientPtr client = cl->client;
- xGLXUseXFontReq *req;
- FontPtr pFont;
- GLuint currentListIndex;
- struct glx_context *cx;
- int error;
-
- req = (xGLXUseXFontReq *) pc;
- cx = __glXForceCurrent(cl, req->contextTag, &error);
- if (!cx) {
- return error;
- }
-
- CALL_GetIntegerv( GET_DISPATCH(), (GL_LIST_INDEX, (GLint*) &currentListIndex) );
- if (currentListIndex != 0) {
- /*
- ** A display list is currently being made. It is an error
- ** to try to make a font during another lists construction.
- */
- client->errorValue = cx->id;
- return __glXError(GLXBadContextState);
- }
-
- /*
- ** Font can actually be either the ID of a font or the ID of a GC
- ** containing a font.
- */
-
- error = dixLookupFontable(&pFont, req->font, client, DixReadAccess);
- if (error != Success)
- return error;
-
- return MakeBitmapsFromFont(pFont, req->first, req->count,
- req->listBase);
-}
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * 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 including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * 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
+ * SILICON GRAPHICS, INC. 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 Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
+
+#include "glxserver.h"
+#include "glxutil.h"
+#include "unpack.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+#include "indirect_dispatch.h"
+#include <GL/gl.h>
+#include <pixmapstr.h>
+#include <windowstr.h>
+#include <dixfontstr.h>
+
+/*
+** Make a single GL bitmap from a single X glyph
+*/
+static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
+{
+ int i, j;
+ int widthPadded; /* width of glyph in bytes, as padded by X */
+ int allocBytes; /* bytes to allocate to store bitmap */
+ int w; /* width of glyph in bits */
+ int h; /* height of glyph */
+ register unsigned char *pglyph;
+ register unsigned char *p;
+ unsigned char *allocbuf;
+#define __GL_CHAR_BUF_SIZE 2048
+ unsigned char buf[__GL_CHAR_BUF_SIZE];
+
+ w = GLYPHWIDTHPIXELS(pci);
+ h = GLYPHHEIGHTPIXELS(pci);
+ widthPadded = GLYPHWIDTHBYTESPADDED(pci);
+
+ /*
+ ** Use the local buf if possible, otherwise malloc.
+ */
+ allocBytes = widthPadded * h;
+ if (allocBytes <= __GL_CHAR_BUF_SIZE) {
+ p = buf;
+ allocbuf = 0;
+ } else {
+ p = (unsigned char *) malloc(allocBytes);
+ if (!p)
+ return BadAlloc;
+ allocbuf = p;
+ }
+
+ /*
+ ** We have to reverse the picture, top to bottom
+ */
+
+ pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
+ for (j=0; j < h; j++) {
+ for (i=0; i < widthPadded; i++) {
+ p[i] = pglyph[i];
+ }
+ pglyph -= widthPadded;
+ p += widthPadded;
+ }
+ CALL_Bitmap( GET_DISPATCH(), (w, h, -pci->metrics.leftSideBearing,
+ pci->metrics.descent,
+ pci->metrics.characterWidth, 0,
+ allocbuf ? allocbuf : buf) );
+
+ free(allocbuf);
+ return Success;
+#undef __GL_CHAR_BUF_SIZE
+}
+
+/*
+** Create a GL bitmap for each character in the X font. The bitmap is stored
+** in a display list.
+*/
+
+static int
+MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
+{
+ unsigned long i, nglyphs;
+ CARD8 chs[2]; /* the font index we are going after */
+ CharInfoPtr pci;
+ int rv; /* return value */
+ int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
+
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, FALSE) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, 0) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
+ CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, GLYPHPADBYTES) );
+ for (i=0; i < count; i++) {
+ chs[0] = (first + i) >> 8; /* high byte is first byte */
+ chs[1] = first + i;
+
+ (*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
+ &nglyphs, &pci);
+
+ /*
+ ** Define a display list containing just a glBitmap() call.
+ */
+ CALL_NewList( GET_DISPATCH(), (list_base + i, GL_COMPILE) );
+ if (nglyphs ) {
+ rv = __glXMakeBitmapFromGlyph(pFont, pci);
+ if (rv) {
+ return rv;
+ }
+ }
+ CALL_EndList( GET_DISPATCH(), () );
+ }
+ return Success;
+}
+
+/************************************************************************/
+
+int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
+{
+ ClientPtr client = cl->client;
+ xGLXUseXFontReq *req;
+ FontPtr pFont;
+ GLuint currentListIndex;
+ struct glx_context *cx;
+ int error;
+
+ REQUEST_SIZE_MATCH(xGLXUseXFontReq);
+
+ req = (xGLXUseXFontReq *) pc;
+ cx = __glXForceCurrent(cl, req->contextTag, &error);
+ if (!cx) {
+ return error;
+ }
+
+ CALL_GetIntegerv( GET_DISPATCH(), (GL_LIST_INDEX, (GLint*) &currentListIndex) );
+ if (currentListIndex != 0) {
+ /*
+ ** A display list is currently being made. It is an error
+ ** to try to make a font during another lists construction.
+ */
+ client->errorValue = cx->id;
+ return __glXError(GLXBadContextState);
+ }
+
+ /*
+ ** Font can actually be either the ID of a font or the ID of a GC
+ ** containing a font.
+ */
+
+ error = dixLookupFontable(&pFont, req->font, client, DixReadAccess);
+ if (error != Success)
+ return error;
+
+ return MakeBitmapsFromFont(pFont, req->first, req->count,
+ req->listBase);
+}
diff --git a/xorg-server/hw/dmx/Makefile.am b/xorg-server/hw/dmx/Makefile.am
index 2a87c3966..e0b201b82 100644
--- a/xorg-server/hw/dmx/Makefile.am
+++ b/xorg-server/hw/dmx/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = input config examples doc
+SUBDIRS = input config examples doc man
bin_PROGRAMS = Xdmx
if XINERAMA
@@ -85,28 +85,5 @@ Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
Xdmx_DEPENDENCIES= $(XDMX_LIBS)
Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
-# Man page
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = Xdmx.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-CLEANFILES = $(appman_DATA)
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
-
-MAN_SUBSTS = \
- -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
- -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g'
-
-SUFFIXES = .$(APP_MAN_SUFFIX) .man
-
-.man.$(APP_MAN_SUFFIX):
- $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
-
-EXTRA_DIST = $(appman_PRE)
-
relink:
$(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
diff --git a/xorg-server/hw/dmx/config/Makefile.am b/xorg-server/hw/dmx/config/Makefile.am
index 25a814e79..de4ce315d 100644
--- a/xorg-server/hw/dmx/config/Makefile.am
+++ b/xorg-server/hw/dmx/config/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = man
+
noinst_LIBRARIES = libdmxconfig.a
LIBSRCS = parser.y \
@@ -53,26 +55,7 @@ dmxtodmx_DEPENDENCIES = libdmxconfig.a
dmxtodmx_SOURCES = dmxtodmx.c
dmxtodmx_LDADD = -L. -ldmxconfig
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = xdmxconfig.man vdltodmx.man dmxtodmx.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-CLEANFILES = $(appman_DATA)
-
-SUFFIXES = .$(APP_MAN_SUFFIX) .man
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
-
-MAN_SUBSTS = -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|'
-
-.man.$(APP_MAN_SUFFIX):
- $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
-
EXTRA_DIST = \
- $(appman_PRE) \
test-a.in test-a.out \
test-b.in test-b.out \
test-c.in test-c.out \
diff --git a/xorg-server/hw/dmx/config/man/Makefile.am b/xorg-server/hw/dmx/config/man/Makefile.am
new file mode 100644
index 000000000..9bb62a4c6
--- /dev/null
+++ b/xorg-server/hw/dmx/config/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = xdmxconfig.man vdltodmx.man dmxtodmx.man
diff --git a/xorg-server/hw/dmx/config/dmxtodmx.man b/xorg-server/hw/dmx/config/man/dmxtodmx.man
index 68c7f5b40..68c7f5b40 100644
--- a/xorg-server/hw/dmx/config/dmxtodmx.man
+++ b/xorg-server/hw/dmx/config/man/dmxtodmx.man
diff --git a/xorg-server/hw/dmx/config/vdltodmx.man b/xorg-server/hw/dmx/config/man/vdltodmx.man
index b733db7ab..b733db7ab 100644
--- a/xorg-server/hw/dmx/config/vdltodmx.man
+++ b/xorg-server/hw/dmx/config/man/vdltodmx.man
diff --git a/xorg-server/hw/dmx/config/xdmxconfig.man b/xorg-server/hw/dmx/config/man/xdmxconfig.man
index dcceea0e3..dcceea0e3 100644
--- a/xorg-server/hw/dmx/config/xdmxconfig.man
+++ b/xorg-server/hw/dmx/config/man/xdmxconfig.man
diff --git a/xorg-server/hw/dmx/man/Makefile.am b/xorg-server/hw/dmx/man/Makefile.am
new file mode 100644
index 000000000..e717aefe2
--- /dev/null
+++ b/xorg-server/hw/dmx/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xdmx.man
diff --git a/xorg-server/hw/dmx/Xdmx.man b/xorg-server/hw/dmx/man/Xdmx.man
index 9c8bdea00..9c8bdea00 100644
--- a/xorg-server/hw/dmx/Xdmx.man
+++ b/xorg-server/hw/dmx/man/Xdmx.man
diff --git a/xorg-server/hw/kdrive/ephyr/Makefile.am b/xorg-server/hw/kdrive/ephyr/Makefile.am
index 8646703ad..9d9b64ee5 100644
--- a/xorg-server/hw/kdrive/ephyr/Makefile.am
+++ b/xorg-server/hw/kdrive/ephyr/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = man
+
INCLUDES = \
@KDRIVE_INCS@ \
@KDRIVE_CFLAGS@ \
@@ -83,20 +85,6 @@ Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
relink:
$(AM_V_at)rm -f $(bin_PROGRAMS) && $(MAKE) $(bin_PROGRAMS)
-MAN_SRCS = Xephyr.man.pre
-
-appmandir = $(APP_MAN_DIR)
-appman_DATA = Xephyr.$(APP_MAN_SUFFIX)
-
-Xephyr.$(APP_MAN_SUFFIX): Xephyr.man
- -$(AM_V_at)rm -f Xephyr.$(APP_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) Xephyr.man Xephyr.$(APP_MAN_SUFFIX)
-
-include $(top_srcdir)/cpprules.in
-
-CLEANFILES = $(appman_DATA) Xephyr.man
-
EXTRA_DIST = \
$(HOSTVIDEO_SRCS) \
- $(HOSTDRI_SRCS) \
- $(MAN_SRCS)
+ $(HOSTDRI_SRCS)
diff --git a/xorg-server/hw/kdrive/ephyr/man/Makefile.am b/xorg-server/hw/kdrive/ephyr/man/Makefile.am
new file mode 100644
index 000000000..e8a372143
--- /dev/null
+++ b/xorg-server/hw/kdrive/ephyr/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xephyr.man
diff --git a/xorg-server/hw/kdrive/ephyr/Xephyr.man.pre b/xorg-server/hw/kdrive/ephyr/man/Xephyr.man
index eb80b96b0..8e7bfd550 100644
--- a/xorg-server/hw/kdrive/ephyr/Xephyr.man.pre
+++ b/xorg-server/hw/kdrive/ephyr/man/Xephyr.man
@@ -46,9 +46,9 @@ sets the screen size.
.BI -parent " id"
uses exiting window
.I id .
-If a
-.BI -screen
-argument follows a
+If a
+.BI -screen
+argument follows a
.BI -parent
argument, this screen is embedded into the given window.
.TP 8
@@ -85,5 +85,3 @@ Mouse button 5 probably won't work.
X(__miscmansuffix__), Xserver(__appmansuffix__)
.SH AUTHOR
Matthew Allum <mallum@o-hand.com> 2004
-
-
diff --git a/xorg-server/hw/vfb/Makefile.am b/xorg-server/hw/vfb/Makefile.am
index f7a8c24af..ed46dbbc1 100644
--- a/xorg-server/hw/vfb/Makefile.am
+++ b/xorg-server/hw/vfb/Makefile.am
@@ -1,51 +1,34 @@
-bin_PROGRAMS = Xvfb
-noinst_LIBRARIES = libfbcmap.a
-
-AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
- -DNO_HW_ONLY_EXTS \
- -DNO_MODULE_EXTS \
- $(XVFBMODULES_CFLAGS) \
- $(DIX_CFLAGS)
-
-SRCS = InitInput.c \
- InitOutput.c \
- $(top_srcdir)/Xext/dpmsstubs.c \
- $(top_srcdir)/Xi/stubs.c \
- $(top_srcdir)/mi/miinitext.c
-
-libfbcmap_a_CFLAGS = $(AM_CFLAGS)
-libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
-
-Xvfb_SOURCES = $(SRCS)
-
-XVFB_LIBS = \
- @XVFB_LIBS@ \
- libfbcmap.a \
- $(MAIN_LIB) \
- $(XSERVER_LIBS)
-
-Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS)
-Xvfb_DEPENDENCIES = $(XVFB_LIBS)
-Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
-
-# Man page
-include $(top_srcdir)/cpprules.in
-
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = Xvfb.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-BUILT_SOURCES = $(appman_PRE)
-CLEANFILES = $(appman_PRE) $(appman_DATA)
-
-SUFFIXES += .$(APP_MAN_SUFFIX) .man
-
-.man.$(APP_MAN_SUFFIX):
- -$(AM_V_at)rm -f $@
- $(AM_V_at)$(LN_S) $< $@
-
-EXTRA_DIST = Xvfb.man.pre
-
-relink:
- $(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
+SUBDIRS = man
+
+bin_PROGRAMS = Xvfb
+noinst_LIBRARIES = libfbcmap.a
+
+AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
+ -DNO_HW_ONLY_EXTS \
+ -DNO_MODULE_EXTS \
+ $(XVFBMODULES_CFLAGS) \
+ $(DIX_CFLAGS)
+
+SRCS = InitInput.c \
+ InitOutput.c \
+ $(top_srcdir)/Xext/dpmsstubs.c \
+ $(top_srcdir)/Xi/stubs.c \
+ $(top_srcdir)/mi/miinitext.c
+
+libfbcmap_a_CFLAGS = $(AM_CFLAGS)
+libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c
+
+Xvfb_SOURCES = $(SRCS)
+
+XVFB_LIBS = \
+ @XVFB_LIBS@ \
+ libfbcmap.a \
+ $(MAIN_LIB) \
+ $(XSERVER_LIBS)
+
+Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS)
+Xvfb_DEPENDENCIES = $(XVFB_LIBS)
+Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+
+relink:
+ $(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
diff --git a/xorg-server/hw/vfb/man/Makefile.am b/xorg-server/hw/vfb/man/Makefile.am
new file mode 100644
index 000000000..93941882a
--- /dev/null
+++ b/xorg-server/hw/vfb/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xvfb.man
diff --git a/xorg-server/hw/vfb/Xvfb.man.pre b/xorg-server/hw/vfb/man/Xvfb.man
index 569afe175..95b4dd4c1 100644
--- a/xorg-server/hw/vfb/Xvfb.man.pre
+++ b/xorg-server/hw/vfb/man/Xvfb.man
@@ -1,16 +1,16 @@
.\" $XdotOrg: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.3 2005/03/23 20:49:52 gisburn Exp $
.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $
.\" Copyright 1993, 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.
@@ -18,7 +18,7 @@
.\" 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
@@ -66,7 +66,7 @@ have values from 1 to 32.
.B "\-fbdir \fIframebuffer-directory\fP"
This option specifies the directory in which the memory mapped files
containing the framebuffer memory should be created.
-See FILES.
+See FILES.
This option only exists on machines that have the mmap and msync system
calls.
.TP 4
@@ -113,7 +113,7 @@ Xvfb -pixdepths 3 27 -fbdir /var/tmp
The server will listen for connections as server number 0, will have the
default screen configuration (one screen, 1280x1024x8),
will also support pixmap
-depths of 3 and 27,
+depths of 3 and 27,
and will use memory mapped files in /var/tmp for the framebuffer.
.TP 8
xwud -in /var/tmp/Xvfb_screen0
diff --git a/xorg-server/hw/xfree86/Makefile.am b/xorg-server/hw/xfree86/Makefile.am
index c948afdcf..c23b1fd6c 100644
--- a/xorg-server/hw/xfree86/Makefile.am
+++ b/xorg-server/hw/xfree86/Makefile.am
@@ -1,120 +1,120 @@
-include $(top_srcdir)/cpprules.in
-
-if DRI
-DRI_SUBDIR = dri
-endif
-
-if DRI2
-DRI2_SUBDIR = dri2
-endif
-
-if XF86UTILS
-XF86UTILS_SUBDIR = utils
-endif
-
-if XAA
-XAA_SUBDIR = xaa
-endif
-
-if VGAHW
-VGAHW_SUBDIR = vgahw
-endif
-
-if VBE
-VBE_SUBDIR = vbe
-endif
-
-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)
-
-DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
- parser ramdac shadowfb vbe vgahw xaa \
- loader dixmods dri dri2 exa modes \
- utils doc
-
-bin_PROGRAMS = Xorg
-Xorg_SOURCES = xorg.c
-
-AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@
-
-noinst_LTLIBRARIES = libxorg.la
-libxorg_la_SOURCES = libxorg.c
-libxorg_la_LIBADD = \
- $(XSERVER_LIBS) \
- loader/libloader.la \
- os-support/libxorgos.la \
- common/libcommon.la \
- parser/libxf86config_internal.la \
- dixmods/libdixmods.la \
- modes/libxf86modes.la \
- ramdac/libramdac.la \
- ddc/libddc.la \
- i2c/libi2c.la \
- dixmods/libxorgxkb.la \
- $(top_builddir)/mi/libmi.la \
- $(top_builddir)/os/libos.la \
- @XORG_LIBS@
-
-libxorg_la_DEPENDENCIES = $(libxorg_la_LIBADD)
-
-libxorg.c xorg.c:
- touch $@
-
-DISTCLEANFILES = libxorg.c xorg.c
-
-Xorg_DEPENDENCIES = libxorg.la
-Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
-
-Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
-
-BUILT_SOURCES = xorg.conf.example
-DISTCLEANFILES += xorg.conf.example xorg.conf.example.pre
-EXTRA_DIST = xorgconf.cpp
-
-if SPECIAL_DTRACE_OBJECTS
-# Re-add dtrace object code that gets lost when building static libraries
-Xorg_LDADD += $(XSERVER_LIBS)
-endif
-
-if SOLARIS_ASM_INLINE
-# Needs to be built before any files are compiled when using Sun compilers
-# so in*/out* inline definitions are properly processed.
-
-BUILT_SOURCES += os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il
-
-os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il:
- cd os-support/solaris ; \
- $(MAKE) $(AM_MAKEFLAGS) solaris-@SOLARIS_INOUT_ARCH@.il
-endif
-
-# do not use $(mkdir_p) if you want automake 1.7 to work
-install-data-local:
- mkdir -p $(DESTDIR)$(logdir)
-
-
-install-exec-local: install-binPROGRAMS
- (cd $(DESTDIR)$(bindir) && rm -f X && ln -s Xorg X)
-if INSTALL_SETUID
- chown root $(DESTDIR)$(bindir)/Xorg
- chmod u+s $(DESTDIR)$(bindir)/Xorg
-endif
-
-CPP_FILES_FLAGS = \
- $(MANDEFS) \
- -DDEFAULTFONTPATH="\"$(COMPILEDDEFAULTFONTPATH)\"" \
- -DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\"
-
-relink:
- $(AM_V_at)rm -f Xorg && $(MAKE) Xorg
-
-xorg.conf.example.pre: xorgconf.cpp
- cp $(srcdir)/xorgconf.cpp $@
+
+if DRI
+DRI_SUBDIR = dri
+endif
+
+if DRI2
+DRI2_SUBDIR = dri2
+endif
+
+if XF86UTILS
+XF86UTILS_SUBDIR = utils
+endif
+
+if XAA
+XAA_SUBDIR = xaa
+endif
+
+if VGAHW
+VGAHW_SUBDIR = vgahw
+endif
+
+if VBE
+VBE_SUBDIR = vbe
+endif
+
+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)
+
+DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
+ parser ramdac shadowfb vbe vgahw xaa \
+ loader dixmods dri dri2 exa modes \
+ utils doc
+
+bin_PROGRAMS = Xorg
+Xorg_SOURCES = xorg.c
+
+AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
+INCLUDES = @XORG_INCS@
+
+noinst_LTLIBRARIES = libxorg.la
+libxorg_la_SOURCES = libxorg.c
+libxorg_la_LIBADD = \
+ $(XSERVER_LIBS) \
+ loader/libloader.la \
+ os-support/libxorgos.la \
+ common/libcommon.la \
+ parser/libxf86config_internal.la \
+ dixmods/libdixmods.la \
+ modes/libxf86modes.la \
+ ramdac/libramdac.la \
+ ddc/libddc.la \
+ i2c/libi2c.la \
+ dixmods/libxorgxkb.la \
+ $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/os/libos.la \
+ @XORG_LIBS@
+
+libxorg_la_DEPENDENCIES = $(libxorg_la_LIBADD)
+
+libxorg.c xorg.c:
+ touch $@
+
+DISTCLEANFILES = libxorg.c xorg.c
+
+Xorg_DEPENDENCIES = libxorg.la
+Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
+
+Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+
+BUILT_SOURCES = xorg.conf.example
+DISTCLEANFILES += xorg.conf.example
+EXTRA_DIST = xorgconf.cpp
+
+if SPECIAL_DTRACE_OBJECTS
+# Re-add dtrace object code that gets lost when building static libraries
+Xorg_LDADD += $(XSERVER_LIBS)
+endif
+
+if SOLARIS_ASM_INLINE
+# Needs to be built before any files are compiled when using Sun compilers
+# so in*/out* inline definitions are properly processed.
+
+BUILT_SOURCES += os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il
+
+os-support/solaris/solaris-@SOLARIS_INOUT_ARCH@.il:
+ cd os-support/solaris ; \
+ $(MAKE) $(AM_MAKEFLAGS) solaris-@SOLARIS_INOUT_ARCH@.il
+endif
+
+# do not use $(mkdir_p) if you want automake 1.7 to work
+install-data-local:
+ mkdir -p $(DESTDIR)$(logdir)
+
+
+install-exec-local: install-binPROGRAMS
+ (cd $(DESTDIR)$(bindir) && rm -f X && ln -s Xorg X)
+if INSTALL_SETUID
+ chown root $(DESTDIR)$(bindir)/Xorg
+ chmod u+s $(DESTDIR)$(bindir)/Xorg
+endif
+
+# Use variables from XORG_MANPAGE_SECTIONS and X Server configuration
+# Do not include manpages.am as values are not appropriate for rc files
+CONF_SUBSTS = -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' \
+ -e 's|MODULEPATH|$(DEFAULT_MODULE_PATH)|g' \
+ -e 's|DEFAULTFONTPATH|$(COMPILEDDEFAULTFONTPATH)|g'
+
+xorg.conf.example: xorgconf.cpp
+ $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $< > $@
+
+relink:
+ $(AM_V_at)rm -f Xorg && $(MAKE) Xorg
diff --git a/xorg-server/hw/xfree86/doc/man/Makefile.am b/xorg-server/hw/xfree86/doc/man/Makefile.am
index 737166b51..fe330a72c 100644
--- a/xorg-server/hw/xfree86/doc/man/Makefile.am
+++ b/xorg-server/hw/xfree86/doc/man/Makefile.am
@@ -1,24 +1,3 @@
-# Xserver.man covers options generic to all X servers built in this tree
-MAN_SRCS = Xorg.man.pre xorg.conf.man.pre
-
-appmandir = $(APP_MAN_DIR)
-appman_DATA = Xorg.$(APP_MAN_SUFFIX)
-
-filemandir = $(FILE_MAN_DIR)
-fileman_DATA = xorg.conf.$(FILE_MAN_SUFFIX)
-
-Xorg.$(APP_MAN_SUFFIX): Xorg.man
- -$(AM_V_at)rm -f Xorg.$(APP_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) Xorg.man Xorg.$(APP_MAN_SUFFIX)
-
-xorg.conf.$(FILE_MAN_SUFFIX): xorg.conf.man
- -$(AM_V_at)rm -f xorg.conf.$(FILE_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) xorg.conf.man xorg.conf.$(FILE_MAN_SUFFIX)
-
-include $(top_srcdir)/cpprules.in
-
-EXTRAMANDEFS = -D__logdir__=$(logdir)
-
-CLEANFILES = $(appman_DATA) $(fileman_DATA) xorg.conf.man Xorg.man
-
-EXTRA_DIST = $(MAN_SRCS)
+include $(top_srcdir)/manpages.am
+appman_PRE = Xorg.man
+fileman_PRE = xorg.conf.man
diff --git a/xorg-server/hw/xfree86/doc/man/Xorg.man.pre b/xorg-server/hw/xfree86/doc/man/Xorg.man
index c497a0e8c..6fa334cc3 100644
--- a/xorg-server/hw/xfree86/doc/man/Xorg.man.pre
+++ b/xorg-server/hw/xfree86/doc/man/Xorg.man
@@ -1,689 +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@metrolink.com\fP
-Doug Anson \fIdanson@lgc.com\fP
-Gertjan Akkerman \fIakkerman@dutiba.twi.tudelft.nl\fP
-Mike Bernson \fImike@mbsun.mlb.org\fP
-Robin Cutshaw \fIrobin@XFree86.org\fP
-David Dawes \fIdawes@XFree86.org\fP
-Marc Evans \fImarc@XFree86.org\fP
-Pascal Haible \fIhaible@izfm.uni-stuttgart.de\fP
-Matthieu Herrb \fIMatthieu.Herrb@laas.fr\fP
-Dirk Hohndel \fIhohndel@XFree86.org\fP
-David Holland \fIdavidh@use.com\fP
-Alan Hourihane \fIalanh@fairlite.demon.co.uk\fP
-Jeffrey Hsu \fIhsu@soda.berkeley.edu\fP
-Glenn Lai \fIglenn@cs.utexas.edu\fP
-Ted Lemon \fImellon@ncd.com\fP
-Rich Murphey \fIrich@XFree86.org\fP
-Hans Nasten \fInasten@everyware.se\fP
-Mark Snitily \fImark@sgcs.com\fP
-Randy Terbush \fIrandyt@cse.unl.edu\fP
-Jon Tombs \fItombs@XFree86.org\fP
-Kees Verstoep \fIversto@cs.vu.nl\fP
-Paul Vixie \fIpaul@vix.com\fP
-Mark Weaver \fIMark_Weaver@brown.edu\fP
-David Wexelblat \fIdwex@XFree86.org\fP
-Philip Wheatley \fIPhilip.Wheatley@ColumbiaSC.NCR.COM\fP
-Thomas Wolfram \fIwolf@prz.tu-berlin.de\fP
-Orest Zborowski \fIorestz@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.
+.\" $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@metrolink.com\fP
+Doug Anson \fIdanson@lgc.com\fP
+Gertjan Akkerman \fIakkerman@dutiba.twi.tudelft.nl\fP
+Mike Bernson \fImike@mbsun.mlb.org\fP
+Robin Cutshaw \fIrobin@XFree86.org\fP
+David Dawes \fIdawes@XFree86.org\fP
+Marc Evans \fImarc@XFree86.org\fP
+Pascal Haible \fIhaible@izfm.uni-stuttgart.de\fP
+Matthieu Herrb \fIMatthieu.Herrb@laas.fr\fP
+Dirk Hohndel \fIhohndel@XFree86.org\fP
+David Holland \fIdavidh@use.com\fP
+Alan Hourihane \fIalanh@fairlite.demon.co.uk\fP
+Jeffrey Hsu \fIhsu@soda.berkeley.edu\fP
+Glenn Lai \fIglenn@cs.utexas.edu\fP
+Ted Lemon \fImellon@ncd.com\fP
+Rich Murphey \fIrich@XFree86.org\fP
+Hans Nasten \fInasten@everyware.se\fP
+Mark Snitily \fImark@sgcs.com\fP
+Randy Terbush \fIrandyt@cse.unl.edu\fP
+Jon Tombs \fItombs@XFree86.org\fP
+Kees Verstoep \fIversto@cs.vu.nl\fP
+Paul Vixie \fIpaul@vix.com\fP
+Mark Weaver \fIMark_Weaver@brown.edu\fP
+David Wexelblat \fIdwex@XFree86.org\fP
+Philip Wheatley \fIPhilip.Wheatley@ColumbiaSC.NCR.COM\fP
+Thomas Wolfram \fIwolf@prz.tu-berlin.de\fP
+Orest Zborowski \fIorestz@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/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre b/xorg-server/hw/xfree86/doc/man/xorg.conf.man
index 2267a0a1a..e3fd0eadf 100644
--- a/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/xorg-server/hw/xfree86/doc/man/xorg.conf.man
@@ -1,2478 +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@xfree86.org> .
+.\" 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@xfree86.org> .
diff --git a/xorg-server/hw/xfree86/exa/Makefile.am b/xorg-server/hw/xfree86/exa/Makefile.am
index da9b720d7..39f7a9057 100644
--- a/xorg-server/hw/xfree86/exa/Makefile.am
+++ b/xorg-server/hw/xfree86/exa/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = man
+
module_LTLIBRARIES = libexa.la
libexa_la_LDFLAGS = -avoid-version
@@ -14,15 +16,3 @@ libexa_la_SOURCES = \
libexa_la_LIBADD = \
../../../exa/libexa.la
-
-include $(top_srcdir)/cpprules.in
-
-drivermandir = $(DRIVER_MAN_DIR)
-driverman_DATA = exa.$(DRIVER_MAN_SUFFIX)
-CLEANFILES = $(driverman_DATA) exa.man
-
-exa.$(DRIVER_MAN_SUFFIX): exa.man
- -$(AM_V_at)rm -f exa.$(DRIVER_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) exa.man exa.$(DRIVER_MAN_SUFFIX)
-
-EXTRA_DIST = exa.man.pre
diff --git a/xorg-server/hw/xfree86/exa/man/Makefile.am b/xorg-server/hw/xfree86/exa/man/Makefile.am
new file mode 100644
index 000000000..51da4fd50
--- /dev/null
+++ b/xorg-server/hw/xfree86/exa/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+driverman_PRE = exa.man
diff --git a/xorg-server/hw/xfree86/exa/exa.man.pre b/xorg-server/hw/xfree86/exa/man/exa.man
index 5c953e256..30d01824d 100644
--- a/xorg-server/hw/xfree86/exa/exa.man.pre
+++ b/xorg-server/hw/xfree86/exa/man/exa.man
@@ -7,7 +7,7 @@ exa \- new 2D acceleration architecture for X.Org
.B EXA
provides a simple API for video drivers to implement for 2D acceleration. It
is a module loaded by drivers, and is not intended to be loaded on its own.
-See your driver's manual page for how to enable
+See your driver's manual page for how to enable
.BR EXA .
.PP
The
@@ -25,7 +25,7 @@ the Render extension. Not related to the Composite extension. Default: No.
Disables acceleration of uploading pixmap data to the framebuffer. Default: No.
.TP
.BI "Option \*qEXANoDownloadFromScreen\*q \*q" boolean \*q
-Disables acceleration of downloading of pixmap data from the framebuffer.
+Disables acceleration of downloading of pixmap data from the framebuffer.
.B NOTE:
Not usable with drivers which rely on DownloadFromScreen succeeding.
Default: No.
diff --git a/xorg-server/hw/xfree86/fbdevhw/Makefile.am b/xorg-server/hw/xfree86/fbdevhw/Makefile.am
index 076b9741f..2a038905e 100644
--- a/xorg-server/hw/xfree86/fbdevhw/Makefile.am
+++ b/xorg-server/hw/xfree86/fbdevhw/Makefile.am
@@ -1,27 +1,19 @@
-module_LTLIBRARIES = libfbdevhw.la
-
-libfbdevhw_la_LDFLAGS = -avoid-version
-
-if FBDEVHW
-libfbdevhw_la_SOURCES = fbdevhw.c
-else
-libfbdevhw_la_SOURCES = fbdevhwstub.c
-endif
-
-INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c
-
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
-
-sdk_HEADERS = fbdevhw.h
-
-include $(top_srcdir)/cpprules.in
-
-drivermandir = $(DRIVER_MAN_DIR)
-driverman_DATA = fbdevhw.$(DRIVER_MAN_SUFFIX)
-CLEANFILES = $(driverman_DATA) fbdevhw.man
-
-fbdevhw.$(DRIVER_MAN_SUFFIX): fbdevhw.man
- -$(AM_V_at)rm -f fbdevhw.$(DRIVER_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) fbdevhw.man fbdevhw.$(DRIVER_MAN_SUFFIX)
-
-EXTRA_DIST = fbpriv.h fbdevhw.man.pre README
+SUBDIRS = man
+
+module_LTLIBRARIES = libfbdevhw.la
+
+libfbdevhw_la_LDFLAGS = -avoid-version
+
+if FBDEVHW
+libfbdevhw_la_SOURCES = fbdevhw.c
+else
+libfbdevhw_la_SOURCES = fbdevhwstub.c
+endif
+
+INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c
+
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
+
+sdk_HEADERS = fbdevhw.h
+
+EXTRA_DIST = fbpriv.h README
diff --git a/xorg-server/hw/xfree86/fbdevhw/man/Makefile.am b/xorg-server/hw/xfree86/fbdevhw/man/Makefile.am
new file mode 100644
index 000000000..7f22a12b9
--- /dev/null
+++ b/xorg-server/hw/xfree86/fbdevhw/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+driverman_PRE = fbdevhw.man
diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.man.pre b/xorg-server/hw/xfree86/fbdevhw/man/fbdevhw.man
index deeced860..fe5d1e17b 100644
--- a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.man.pre
+++ b/xorg-server/hw/xfree86/fbdevhw/man/fbdevhw.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.1 2001/01/24 00:06:34 dawes Exp $
.TH FBDEVHW __drivermansuffix__ __vendorversion__
.SH NAME
fbdevhw \- os-specific submodule for framebuffer device access
@@ -14,7 +14,7 @@ fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the
fbdevhw module. fbdevhw can be used by other drivers too, this
is usually activated with `Option "UseFBDev"' in the device section.
.SH "SEE ALSO"
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__),
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__),
xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
fbdev(__drivermansuffix__)
.SH AUTHORS
diff --git a/xorg-server/hw/xfree86/utils/Makefile.am b/xorg-server/hw/xfree86/utils/Makefile.am
index d27861b03..71f979048 100644
--- a/xorg-server/hw/xfree86/utils/Makefile.am
+++ b/xorg-server/hw/xfree86/utils/Makefile.am
@@ -1,3 +1,4 @@
SUBDIRS = \
gtf \
- cvt
+ cvt \
+ man
diff --git a/xorg-server/hw/xfree86/utils/cvt/Makefile.am b/xorg-server/hw/xfree86/utils/cvt/Makefile.am
index 7f8364f86..4ebcedf39 100644
--- a/xorg-server/hw/xfree86/utils/cvt/Makefile.am
+++ b/xorg-server/hw/xfree86/utils/cvt/Makefile.am
@@ -1,42 +1,34 @@
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-#
-# 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.
-#
-
-bin_PROGRAMS = cvt
-
-INCLUDES = $(XORG_INCS) \
- -I$(top_srcdir)/hw/xfree86/ddc \
- -I$(top_srcdir)/hw/xfree86/parser
-
-# gah
-cvt_SOURCES = cvt.c \
- $(top_srcdir)/hw/xfree86/modes/xf86cvt.c \
- $(top_srcdir)/os/xprintf.c
-
-cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
-
-man1_MANS = cvt.man
-
-CLEANFILES = $(man1_MANS)
-
-include $(top_srcdir)/cpprules.in
-
-EXTRA_DIST = cvt.man.pre
+# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+#
+# 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.
+#
+
+bin_PROGRAMS = cvt
+
+INCLUDES = $(XORG_INCS) \
+ -I$(top_srcdir)/hw/xfree86/ddc \
+ -I$(top_srcdir)/hw/xfree86/parser
+
+# gah
+cvt_SOURCES = cvt.c \
+ $(top_srcdir)/hw/xfree86/modes/xf86cvt.c \
+ $(top_srcdir)/os/xprintf.c
+
+cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/xorg-server/hw/xfree86/utils/gtf/Makefile.am b/xorg-server/hw/xfree86/utils/gtf/Makefile.am
index 0852541bd..f77bf608e 100644
--- a/xorg-server/hw/xfree86/utils/gtf/Makefile.am
+++ b/xorg-server/hw/xfree86/utils/gtf/Makefile.am
@@ -1,44 +1,27 @@
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-#
-# 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.
-#
-
-bin_PROGRAMS = gtf
-
-gtf_SOURCES = gtf.c
-gtf_CFLAGS = $(XORG_CFLAGS)
-gtf_LDADD = -lm
-
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = gtf.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-include $(top_srcdir)/cpprules.in
-
-EXTRA_DIST = gtf.man.pre
-BUILT_SOURCES = $(appman_PRE)
-CLEANFILES = $(appman_PRE) $(appman_DATA)
-
-SUFFIXES += .$(APP_MAN_SUFFIX) .man
-
-.man.$(APP_MAN_SUFFIX):
- -$(AM_V_at)rm -f $@
- $(AM_V_at)$(LN_S) $< $@
+# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+#
+# 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.
+#
+
+bin_PROGRAMS = gtf
+
+gtf_SOURCES = gtf.c
+gtf_CFLAGS = $(XORG_CFLAGS)
+gtf_LDADD = -lm
diff --git a/xorg-server/hw/xfree86/utils/man/Makefile.am b/xorg-server/hw/xfree86/utils/man/Makefile.am
new file mode 100644
index 000000000..7afc5bcca
--- /dev/null
+++ b/xorg-server/hw/xfree86/utils/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = cvt.man gtf.man
diff --git a/xorg-server/hw/xfree86/utils/cvt/cvt.man.pre b/xorg-server/hw/xfree86/utils/man/cvt.man
index 8a292eed8..b380171ee 100644
--- a/xorg-server/hw/xfree86/utils/cvt/cvt.man.pre
+++ b/xorg-server/hw/xfree86/utils/man/cvt.man
@@ -13,7 +13,7 @@ cvt - calculate VESA CVT mode lines
.I Cvt
is a utility for calculating VESA Coordinated Video Timing modes. Given the
desired horizontal and vertical resolutions, a modeline adhering to the CVT
-standard is printed. This modeline can be included in __xservername__
+standard is printed. This modeline can be included in __xservername__
.B __xconfigfile__(__filemansuffix__)
.
diff --git a/xorg-server/hw/xfree86/utils/gtf/gtf.man.pre b/xorg-server/hw/xfree86/utils/man/gtf.man
index 74ade74cb..74ade74cb 100644
--- a/xorg-server/hw/xfree86/utils/gtf/gtf.man.pre
+++ b/xorg-server/hw/xfree86/utils/man/gtf.man
diff --git a/xorg-server/hw/xfree86/xorgconf.cpp b/xorg-server/hw/xfree86/xorgconf.cpp
index 8f0c83014..cd6d4a983 100644
--- a/xorg-server/hw/xfree86/xorgconf.cpp
+++ b/xorg-server/hw/xfree86/xorgconf.cpp
@@ -1,73 +1,73 @@
-XCOMM
-XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc.
-XCOMM
-XCOMM Permission is hereby granted, free of charge, to any person obtaining a
-XCOMM copy of this software and associated documentation files (the "Software"),
-XCOMM to deal in the Software without restriction, including without limitation
-XCOMM the rights to use, copy, modify, merge, publish, distribute, sublicense,
-XCOMM and/or sell copies of the Software, and to permit persons to whom the
-XCOMM Software is furnished to do so, subject to the following conditions:
-XCOMM
-XCOMM The above copyright notice and this permission notice shall be included in
-XCOMM all copies or substantial portions of the Software.
-XCOMM
-XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-XCOMM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-XCOMM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-XCOMM THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-XCOMM WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-XCOMM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-XCOMM SOFTWARE.
-XCOMM
-XCOMM Except as contained in this notice, the name of the XFree86 Project shall
-XCOMM not be used in advertising or otherwise to promote the sale, use or other
-XCOMM dealings in this Software without prior written authorization from the
-XCOMM XFree86 Project.
-XCOMM
-XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $
-
-XCOMM **********************************************************************
-XCOMM This is a sample configuration file only, intended to illustrate
-XCOMM what a config file might look like. Refer to the __xconfigfile__(__filemansuffix__)
-XCOMM man page for details about the format of this file.
-XCOMM **********************************************************************
-
-XCOMM The ordering of sections is not important in XFree86 4.0 and later,
-XCOMM nor in any Xorg release.
-
-XCOMM **********************************************************************
-XCOMM Files section. This allows default font and module paths to be set
-XCOMM **********************************************************************
+#
+# Copyright (c) 1994-1998 by The XFree86 Project, 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 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 XFREE86 PROJECT 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 XFree86 Project 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
+# XFree86 Project.
+#
+# $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $
+
+# **********************************************************************
+# This is a sample configuration file only, intended to illustrate
+# what a config file might look like. Refer to the xorg.conf(__filemansuffix__)
+# man page for details about the format of this file.
+# **********************************************************************
+
+# The ordering of sections is not important in XFree86 4.0 and later,
+# nor in any Xorg release.
+
+# **********************************************************************
+# Files section. This allows default font and module paths to be set
+# **********************************************************************
Section "Files"
-XCOMM Multiple FontPath entries are allowed (which are concatenated together),
-XCOMM as well as specifying multiple comma-separated entries in one FontPath
-XCOMM command (or a combination of both methods).
-XCOMM The default path is shown here.
+# Multiple FontPath entries are allowed (which are concatenated together),
+# as well as specifying multiple comma-separated entries in one FontPath
+# command (or a combination of both methods).
+# The default path is shown here.
-XCOMM FontPath DEFAULTFONTPATH
+# FontPath DEFAULTFONTPATH
-XCOMM ModulePath can be used to set a search path for the X server modules.
-XCOMM The default path is shown here.
+# ModulePath can be used to set a search path for the X server modules.
+# The default path is shown here.
-XCOMM ModulePath MODULEPATH
+# ModulePath MODULEPATH
EndSection
-XCOMM **********************************************************************
-XCOMM Module section -- this is an optional section which is used to specify
-XCOMM which run-time loadable modules to load when the X server starts up.
-XCOMM **********************************************************************
+# **********************************************************************
+# Module section -- this is an optional section which is used to specify
+# which run-time loadable modules to load when the X server starts up.
+# **********************************************************************
Section "Module"
-XCOMM This loads the DBE extension module.
+# This loads the DBE extension module.
Load "dbe"
-XCOMM This loads the miscellaneous extensions module, and disables
-XCOMM initialisation of the XFree86-DGA extension within that module.
+# This loads the miscellaneous extensions module, and disables
+# initialisation of the XFree86-DGA extension within that module.
SubSection "extmod"
Option "omit xfree86-dga"
@@ -76,53 +76,53 @@ XCOMM initialisation of the XFree86-DGA extension within that module.
EndSection
-XCOMM **********************************************************************
-XCOMM Server flags section. This contains various server-wide Options.
-XCOMM **********************************************************************
+# **********************************************************************
+# Server flags section. This contains various server-wide Options.
+# **********************************************************************
Section "ServerFlags"
-XCOMM Uncomment this to cause a core dump at the spot where a signal is
-XCOMM received. This may leave the console in an unusable state, but may
-XCOMM provide a better stack trace in the core dump to aid in debugging
+# Uncomment this to cause a core dump at the spot where a signal is
+# received. This may leave the console in an unusable state, but may
+# provide a better stack trace in the core dump to aid in debugging
-XCOMM Option "NoTrapSignals"
+# Option "NoTrapSignals"
-XCOMM Uncomment this to disable the <Ctrl><Alt><Fn> VT switch sequence
-XCOMM (where n is 1 through 12). This allows clients to receive these key
-XCOMM events.
+# Uncomment this to disable the <Ctrl><Alt><Fn> VT switch sequence
+# (where n is 1 through 12). This allows clients to receive these key
+# events.
-XCOMM Option "DontVTSwitch"
+# Option "DontVTSwitch"
-XCOMM Uncomment this to disable the <Ctrl><Alt><BS> server abort sequence
-XCOMM This allows clients to receive this key event.
+# Uncomment this to disable the <Ctrl><Alt><BS> server abort sequence
+# This allows clients to receive this key event.
-XCOMM Option "DontZap" "false"
+# Option "DontZap" "false"
-XCOMM Uncomment this to disable the <Ctrl><Alt><KP_+>/<KP_-> mode switching
-XCOMM sequences. This allows clients to receive these key events.
+# Uncomment this to disable the <Ctrl><Alt><KP_+>/<KP_-> mode switching
+# sequences. This allows clients to receive these key events.
-XCOMM Option "DontZoom"
+# Option "DontZoom"
-XCOMM Uncomment this to disable tuning with the xvidtune client. With
-XCOMM it the client can still run and fetch card and monitor attributes,
-XCOMM but it will not be allowed to change them. If it tries it will
-XCOMM receive a protocol error.
+# Uncomment this to disable tuning with the xvidtune client. With
+# it the client can still run and fetch card and monitor attributes,
+# but it will not be allowed to change them. If it tries it will
+# receive a protocol error.
-XCOMM Option "DisableVidModeExtension"
+# Option "DisableVidModeExtension"
-XCOMM Uncomment this to enable the use of a non-local xvidtune client.
+# Uncomment this to enable the use of a non-local xvidtune client.
-XCOMM Option "AllowNonLocalXvidtune"
+# Option "AllowNonLocalXvidtune"
-XCOMM Set the basic blanking screen saver timeout.
+# Set the basic blanking screen saver timeout.
Option "BlankTime" "10" # 10 minutes
-XCOMM Set the DPMS timeouts. These are set here because they are global
-XCOMM rather than screen-specific. These settings alone don't enable DPMS.
-XCOMM It is enabled per-screen (or per-monitor), and even then only when
-XCOMM the driver supports it.
+# Set the DPMS timeouts. These are set here because they are global
+# rather than screen-specific. These settings alone don't enable DPMS.
+# It is enabled per-screen (or per-monitor), and even then only when
+# the driver supports it.
Option "StandbyTime" "10" # 10 minutes
Option "SuspendTime" "10" # 10 minutes
@@ -130,115 +130,115 @@ XCOMM the driver supports it.
EndSection
-XCOMM **********************************************************************
-XCOMM Input devices
-XCOMM **********************************************************************
+# **********************************************************************
+# Input devices
+# **********************************************************************
-XCOMM **********************************************************************
-XCOMM Core keyboard's InputDevice section
-XCOMM **********************************************************************
+# **********************************************************************
+# Core keyboard's InputDevice section
+# **********************************************************************
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
-XCOMM Set the keyboard auto repeat parameters. Not all platforms implement
-XCOMM this.
+# Set the keyboard auto repeat parameters. Not all platforms implement
+# this.
Option "AutoRepeat" "500 5"
-XCOMM Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)).
-
-XCOMM Option "Xleds" "1 2 3"
-
-XCOMM To customise the XKB settings to suit your keyboard, modify the
-XCOMM lines below (which are the defaults). For example, for a European
-XCOMM keyboard, you will probably want to use one of:
-XCOMM
-XCOMM Option "XkbModel" "pc102"
-XCOMM Option "XkbModel" "pc105"
-XCOMM
-XCOMM If you have a Microsoft Natural keyboard, you can use:
-XCOMM
-XCOMM Option "XkbModel" "microsoft"
-XCOMM
-XCOMM If you have a US "windows" keyboard you will want:
-XCOMM
-XCOMM Option "XkbModel" "pc104"
-XCOMM
-XCOMM Then to change the language, change the Layout setting.
-XCOMM For example, a german layout can be obtained with:
-XCOMM
-XCOMM Option "XkbLayout" "de"
-XCOMM
-XCOMM or:
-XCOMM
-XCOMM Option "XkbLayout" "de"
-XCOMM Option "XkbVariant" "nodeadkeys"
-XCOMM
-XCOMM If you'd like to switch the positions of your capslock and
-XCOMM control keys, use:
-XCOMM
-XCOMM Option "XkbOptions" "ctrl:swapcaps"
-
-
-XCOMM These are the default XKB settings for xorg
-XCOMM
-XCOMM Option "XkbRules" "xorg"
-XCOMM Option "XkbModel" "pc105"
-XCOMM Option "XkbLayout" "us"
-XCOMM Option "XkbVariant" ""
-XCOMM Option "XkbOptions" ""
+# Specifiy which keyboard LEDs can be user-controlled (eg, with xset(1)).
+
+# Option "Xleds" "1 2 3"
+
+# To customise the XKB settings to suit your keyboard, modify the
+# lines below (which are the defaults). For example, for a European
+# keyboard, you will probably want to use one of:
+#
+# Option "XkbModel" "pc102"
+# Option "XkbModel" "pc105"
+#
+# If you have a Microsoft Natural keyboard, you can use:
+#
+# Option "XkbModel" "microsoft"
+#
+# If you have a US "windows" keyboard you will want:
+#
+# Option "XkbModel" "pc104"
+#
+# Then to change the language, change the Layout setting.
+# For example, a german layout can be obtained with:
+#
+# Option "XkbLayout" "de"
+#
+# or:
+#
+# Option "XkbLayout" "de"
+# Option "XkbVariant" "nodeadkeys"
+#
+# If you'd like to switch the positions of your capslock and
+# control keys, use:
+#
+# Option "XkbOptions" "ctrl:swapcaps"
+
+
+# These are the default XKB settings for xorg
+#
+# Option "XkbRules" "xorg"
+# Option "XkbModel" "pc105"
+# Option "XkbLayout" "us"
+# Option "XkbVariant" ""
+# Option "XkbOptions" ""
EndSection
-XCOMM **********************************************************************
-XCOMM Core Pointer's InputDevice section
-XCOMM **********************************************************************
+# **********************************************************************
+# Core Pointer's InputDevice section
+# **********************************************************************
Section "InputDevice"
-XCOMM Identifier and driver
+# Identifier and driver
Identifier "Mouse1"
Driver "mouse"
-XCOMM The mouse protocol and device. The device is normally set to /dev/mouse,
-XCOMM which is usually a symbolic link to the real device.
+# The mouse protocol and device. The device is normally set to /dev/mouse,
+# which is usually a symbolic link to the real device.
Option "Protocol" "Microsoft"
Option "Device" "/dev/mouse"
-XCOMM On platforms where PnP mouse detection is supported the following
-XCOMM protocol setting can be used when using a newer PnP mouse:
+# On platforms where PnP mouse detection is supported the following
+# protocol setting can be used when using a newer PnP mouse:
-XCOMM Option "Protocol" "Auto"
+# Option "Protocol" "Auto"
-XCOMM When using mouse connected to a PS/2 port (aka "MousePort"), set the
-XCOMM the protocol as follows. On some platforms some other settings may
-XCOMM be available.
+# When using mouse connected to a PS/2 port (aka "MousePort"), set the
+# the protocol as follows. On some platforms some other settings may
+# be available.
-XCOMM Option "Protocol" "PS/2"
+# Option "Protocol" "PS/2"
-XCOMM Baudrate and SampleRate are only for some older Logitech mice. In
-XCOMM almost every case these lines should be omitted.
+# Baudrate and SampleRate are only for some older Logitech mice. In
+# almost every case these lines should be omitted.
-XCOMM Option "BaudRate" "9600"
-XCOMM Option "SampleRate" "150"
+# Option "BaudRate" "9600"
+# Option "SampleRate" "150"
-XCOMM Emulate3Buttons is an option for 2-button mice
-XCOMM Emulate3Timeout is the timeout in milliseconds (default is 50ms)
+# Emulate3Buttons is an option for 2-button mice
+# Emulate3Timeout is the timeout in milliseconds (default is 50ms)
-XCOMM Option "Emulate3Buttons"
-XCOMM Option "Emulate3Timeout" "50"
+# Option "Emulate3Buttons"
+# Option "Emulate3Timeout" "50"
-XCOMM ChordMiddle is an option for some 3-button Logitech mice, or any
-XCOMM 3-button mouse where the middle button generates left+right button
-XCOMM events.
+# ChordMiddle is an option for some 3-button Logitech mice, or any
+# 3-button mouse where the middle button generates left+right button
+# events.
-XCOMM Option "ChordMiddle"
+# Option "ChordMiddle"
EndSection
@@ -249,91 +249,91 @@ Section "InputDevice"
Option "Device" "/dev/mouse2"
EndSection
-XCOMM Some examples of extended input devices
-
-XCOMM Section "InputDevice"
-XCOMM Identifier "spaceball"
-XCOMM Driver "magellan"
-XCOMM Option "Device" "/dev/cua0"
-XCOMM EndSection
-XCOMM
-XCOMM Section "InputDevice"
-XCOMM Identifier "spaceball2"
-XCOMM Driver "spaceorb"
-XCOMM Option "Device" "/dev/cua0"
-XCOMM EndSection
-XCOMM
-XCOMM Section "InputDevice"
-XCOMM Identifier "touchscreen0"
-XCOMM Driver "microtouch"
-XCOMM Option "Device" "/dev/ttyS0"
-XCOMM Option "MinX" "1412"
-XCOMM Option "MaxX" "15184"
-XCOMM Option "MinY" "15372"
-XCOMM Option "MaxY" "1230"
-XCOMM Option "ScreenNumber" "0"
-XCOMM Option "ReportingMode" "Scaled"
-XCOMM Option "ButtonNumber" "1"
-XCOMM Option "SendCoreEvents"
-XCOMM EndSection
-XCOMM
-XCOMM Section "InputDevice"
-XCOMM Identifier "touchscreen1"
-XCOMM Driver "elo2300"
-XCOMM Option "Device" "/dev/ttyS0"
-XCOMM Option "MinX" "231"
-XCOMM Option "MaxX" "3868"
-XCOMM Option "MinY" "3858"
-XCOMM Option "MaxY" "272"
-XCOMM Option "ScreenNumber" "0"
-XCOMM Option "ReportingMode" "Scaled"
-XCOMM Option "ButtonThreshold" "17"
-XCOMM Option "ButtonNumber" "1"
-XCOMM Option "SendCoreEvents"
-XCOMM EndSection
-
-XCOMM **********************************************************************
-XCOMM Monitor section
-XCOMM **********************************************************************
-
-XCOMM Any number of monitor sections may be present
+# Some examples of extended input devices
+
+# Section "InputDevice"
+# Identifier "spaceball"
+# Driver "magellan"
+# Option "Device" "/dev/cua0"
+# EndSection
+#
+# Section "InputDevice"
+# Identifier "spaceball2"
+# Driver "spaceorb"
+# Option "Device" "/dev/cua0"
+# EndSection
+#
+# Section "InputDevice"
+# Identifier "touchscreen0"
+# Driver "microtouch"
+# Option "Device" "/dev/ttyS0"
+# Option "MinX" "1412"
+# Option "MaxX" "15184"
+# Option "MinY" "15372"
+# Option "MaxY" "1230"
+# Option "ScreenNumber" "0"
+# Option "ReportingMode" "Scaled"
+# Option "ButtonNumber" "1"
+# Option "SendCoreEvents"
+# EndSection
+#
+# Section "InputDevice"
+# Identifier "touchscreen1"
+# Driver "elo2300"
+# Option "Device" "/dev/ttyS0"
+# Option "MinX" "231"
+# Option "MaxX" "3868"
+# Option "MinY" "3858"
+# Option "MaxY" "272"
+# Option "ScreenNumber" "0"
+# Option "ReportingMode" "Scaled"
+# Option "ButtonThreshold" "17"
+# Option "ButtonNumber" "1"
+# Option "SendCoreEvents"
+# EndSection
+
+# **********************************************************************
+# Monitor section
+# **********************************************************************
+
+# Any number of monitor sections may be present
Section "Monitor"
-XCOMM The identifier line must be present.
+# The identifier line must be present.
Identifier "Generic Monitor"
-XCOMM HorizSync is in kHz unless units are specified.
-XCOMM HorizSync may be a comma separated list of discrete values, or a
-XCOMM comma separated list of ranges of values.
-XCOMM NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
-XCOMM USER MANUAL FOR THE CORRECT NUMBERS.
+# HorizSync is in kHz unless units are specified.
+# HorizSync may be a comma separated list of discrete values, or a
+# comma separated list of ranges of values.
+# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
+# USER MANUAL FOR THE CORRECT NUMBERS.
-XCOMM HorizSync 31.5 # typical for a single frequency fixed-sync monitor
-XCOMM HorizSync 30-64 # multisync
-XCOMM HorizSync 31.5, 35.2 # multiple fixed sync frequencies
-XCOMM HorizSync 15-25, 30-50 # multiple ranges of sync frequencies
+# HorizSync 31.5 # typical for a single frequency fixed-sync monitor
+# HorizSync 30-64 # multisync
+# HorizSync 31.5, 35.2 # multiple fixed sync frequencies
+# HorizSync 15-25, 30-50 # multiple ranges of sync frequencies
-XCOMM VertRefresh is in Hz unless units are specified.
-XCOMM VertRefresh may be a comma separated list of discrete values, or a
-XCOMM comma separated list of ranges of values.
-XCOMM NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
-XCOMM USER MANUAL FOR THE CORRECT NUMBERS.
+# VertRefresh is in Hz unless units are specified.
+# VertRefresh may be a comma separated list of discrete values, or a
+# comma separated list of ranges of values.
+# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR'S
+# USER MANUAL FOR THE CORRECT NUMBERS.
-XCOMM VertRefresh 60 # typical for a single frequency fixed-sync monitor
+# VertRefresh 60 # typical for a single frequency fixed-sync monitor
-XCOMM VertRefresh 50-100 # multisync
-XCOMM VertRefresh 60, 65 # multiple fixed sync frequencies
-XCOMM VertRefresh 40-50, 80-100 # multiple ranges of sync frequencies
+# VertRefresh 50-100 # multisync
+# VertRefresh 60, 65 # multiple fixed sync frequencies
+# VertRefresh 40-50, 80-100 # multiple ranges of sync frequencies
-XCOMM Modes can be specified in two formats. A compact one-line format, or
-XCOMM a multi-line format.
+# Modes can be specified in two formats. A compact one-line format, or
+# a multi-line format.
-XCOMM A generic VGA 640x480 mode (hsync = 31.5kHz, refresh = 60Hz)
-XCOMM These two are equivalent
+# A generic VGA 640x480 mode (hsync = 31.5kHz, refresh = 60Hz)
+# These two are equivalent
-XCOMM ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525
+# ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525
Mode "640x480"
DotClock 25.175
@@ -341,75 +341,75 @@ XCOMM ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525
VTimings 480 491 493 525
EndMode
-XCOMM These two are equivalent
+# These two are equivalent
-XCOMM ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace
+# ModeLine "1024x768i" 45 1024 1048 1208 1264 768 776 784 817 Interlace
-XCOMM Mode "1024x768i"
-XCOMM DotClock 45
-XCOMM HTimings 1024 1048 1208 1264
-XCOMM VTimings 768 776 784 817
-XCOMM Flags "Interlace"
-XCOMM EndMode
+# Mode "1024x768i"
+# DotClock 45
+# HTimings 1024 1048 1208 1264
+# VTimings 768 776 784 817
+# Flags "Interlace"
+# EndMode
-XCOMM If a monitor has DPMS support, that can be indicated here. This will
-XCOMM enable DPMS when the monitor is used with drivers that support it.
+# If a monitor has DPMS support, that can be indicated here. This will
+# enable DPMS when the monitor is used with drivers that support it.
-XCOMM Option "dpms"
+# Option "dpms"
-XCOMM If a monitor requires that the sync signals be superimposed on the
-XCOMM green signal, the following option will enable this when used with
-XCOMM drivers that support it. Only a relatively small range of hardware
-XCOMM (and drivers) actually support this.
+# If a monitor requires that the sync signals be superimposed on the
+# green signal, the following option will enable this when used with
+# drivers that support it. Only a relatively small range of hardware
+# (and drivers) actually support this.
-XCOMM Option "sync on green"
+# Option "sync on green"
EndSection
-XCOMM **********************************************************************
-XCOMM Graphics device section
-XCOMM **********************************************************************
+# **********************************************************************
+# Graphics device section
+# **********************************************************************
-XCOMM Any number of graphics device sections may be present
+# Any number of graphics device sections may be present
Section "Device"
-XCOMM The Identifier must be present.
+# The Identifier must be present.
Identifier "Generic VESA"
-XCOMM The Driver line must be present. When using run-time loadable driver
-XCOMM modules, this line instructs the server to load the specified driver
-XCOMM module. Even when not using loadable driver modules, this line
-XCOMM indicates which driver should interpret the information in this section.
+# The Driver line must be present. When using run-time loadable driver
+# modules, this line instructs the server to load the specified driver
+# module. Even when not using loadable driver modules, this line
+# indicates which driver should interpret the information in this section.
Driver "vesa"
-XCOMM The chipset line is optional in most cases. It can be used to override
-XCOMM the driver's chipset detection, and should not normally be specified.
+# The chipset line is optional in most cases. It can be used to override
+# the driver's chipset detection, and should not normally be specified.
-XCOMM Chipset "generic"
+# Chipset "generic"
-XCOMM Various other lines can be specified to override the driver's automatic
-XCOMM detection code. In most cases they are not needed.
+# Various other lines can be specified to override the driver's automatic
+# detection code. In most cases they are not needed.
-XCOMM VideoRam 256
-XCOMM Clocks 25.2 28.3
+# VideoRam 256
+# Clocks 25.2 28.3
-XCOMM The BusID line is used to specify which of possibly multiple devices
-XCOMM this section is intended for. When this line isn't present, a device
-XCOMM section can only match up with the primary video device. For PCI
-XCOMM devices a line like the following could be used. This line should not
-XCOMM normally be included unless there is more than one video device
-XCOMM intalled.
+# The BusID line is used to specify which of possibly multiple devices
+# this section is intended for. When this line isn't present, a device
+# section can only match up with the primary video device. For PCI
+# devices a line like the following could be used. This line should not
+# normally be included unless there is more than one video device
+# intalled.
-XCOMM BusID "PCI:0:10:0"
+# BusID "PCI:0:10:0"
-XCOMM Various option lines can be added here as required. Some options
-XCOMM are more appropriate in Screen sections, Display subsections or even
-XCOMM Monitor sections.
+# Various option lines can be added here as required. Some options
+# are more appropriate in Screen sections, Display subsections or even
+# Monitor sections.
-XCOMM Option "hw cursor" "off"
+# Option "hw cursor" "off"
EndSection
@@ -433,24 +433,24 @@ Section "Device"
EndSection
-XCOMM **********************************************************************
-XCOMM Screen sections.
-XCOMM **********************************************************************
+# **********************************************************************
+# Screen sections.
+# **********************************************************************
-XCOMM Any number of screen sections may be present. Each describes
-XCOMM the configuration of a single screen. A single specific screen section
-XCOMM may be specified from the X server command line with the "-screen"
-XCOMM option.
+# Any number of screen sections may be present. Each describes
+# the configuration of a single screen. A single specific screen section
+# may be specified from the X server command line with the "-screen"
+# option.
Section "Screen"
-XCOMM The Identifier, Device and Monitor lines must be present
+# The Identifier, Device and Monitor lines must be present
Identifier "Screen 1"
Device "Generic VESA"
Monitor "Generic Monitor"
-XCOMM The favoured Depth and/or Bpp may be specified here
+# The favoured Depth and/or Bpp may be specified here
DefaultDepth 8
@@ -480,7 +480,7 @@ Section "Screen"
Monitor "Generic Monitor"
Option "no accel"
DefaultDepth 16
-XCOMM DefaultDepth 24
+# DefaultDepth 24
SubSection "Display"
Depth 8
@@ -514,38 +514,38 @@ Section "Screen"
EndSection
-XCOMM **********************************************************************
-XCOMM ServerLayout sections.
-XCOMM **********************************************************************
+# **********************************************************************
+# ServerLayout sections.
+# **********************************************************************
-XCOMM Any number of ServerLayout sections may be present. Each describes
-XCOMM the way multiple screens are organised. A specific ServerLayout
-XCOMM section may be specified from the X server command line with the
-XCOMM "-layout" option. In the absence of this, the first section is used.
-XCOMM When now ServerLayout section is present, the first Screen section
-XCOMM is used alone.
+# Any number of ServerLayout sections may be present. Each describes
+# the way multiple screens are organised. A specific ServerLayout
+# section may be specified from the X server command line with the
+# "-layout" option. In the absence of this, the first section is used.
+# When now ServerLayout section is present, the first Screen section
+# is used alone.
Section "ServerLayout"
-XCOMM The Identifier line must be present
+# The Identifier line must be present
Identifier "Main Layout"
-XCOMM Each Screen line specifies a Screen section name, and optionally
-XCOMM the relative position of other screens. The four names after
-XCOMM primary screen name are the screens to the top, bottom, left and right
-XCOMM of the primary screen. In this example, screen 2 is located to the
-XCOMM right of screen 1.
+# Each Screen line specifies a Screen section name, and optionally
+# the relative position of other screens. The four names after
+# primary screen name are the screens to the top, bottom, left and right
+# of the primary screen. In this example, screen 2 is located to the
+# right of screen 1.
Screen "Screen MGA 1" "" "" "" "Screen MGA 2"
Screen "Screen MGA 2" "" "" "Screen MGA 1" ""
-XCOMM Each InputDevice line specifies an InputDevice section name and
-XCOMM optionally some options to specify the way the device is to be
-XCOMM used. Those options include "CorePointer", "CoreKeyboard" and
-XCOMM "SendCoreEvents". In this example, "Mouse1" is the core pointer,
-XCOMM and "Mouse2" is an extended input device that also generates core
-XCOMM pointer events (i.e., both mice will move the standard pointer).
+# Each InputDevice line specifies an InputDevice section name and
+# optionally some options to specify the way the device is to be
+# used. Those options include "CorePointer", "CoreKeyboard" and
+# "SendCoreEvents". In this example, "Mouse1" is the core pointer,
+# and "Mouse2" is an extended input device that also generates core
+# pointer events (i.e., both mice will move the standard pointer).
InputDevice "Mouse1" "CorePointer"
InputDevice "Mouse2" "SendCoreEvents"
diff --git a/xorg-server/hw/xnest/Makefile.am b/xorg-server/hw/xnest/Makefile.am
index 666a0f0e6..c395b4dae 100644
--- a/xorg-server/hw/xnest/Makefile.am
+++ b/xorg-server/hw/xnest/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = man
+
bin_PROGRAMS = Xnest
noinst_LIBRARIES = libfbcmap.a
@@ -59,34 +61,12 @@ Xnest_LDADD = $(XNEST_LIBS) $(XNEST_SYS_LIBS) $(XSERVER_SYS_LIBS)
Xnest_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
EXTRA_DIST = icon \
- screensaver \
- Xnest.man.pre
+ screensaver
# -UDPMSExtension for miinitext? can't put into
# OS_DEFINES???
# EXT_DEFINES???
# ICONFIGFILES -- SpecialCObjectRule
-# Man page
-include $(top_srcdir)/cpprules.in
-
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = Xnest.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-EXTRAMANDEFS = \
- -D__XCONFIGFILE__=$(__XCONFIGFILE__) \
- -D__XSERVERNAME__=$(XSERVERNAME)
-
-BUILT_SOURCES = $(appman_PRE)
-CLEANFILES = $(appman_PRE) $(appman_DATA)
-
-SUFFIXES += .$(APP_MAN_SUFFIX) .man
-
-.man.$(APP_MAN_SUFFIX):
- -$(AM_V_at)rm -f $@
- $(AM_V_at)$(LN_S) $< $@
-
relink:
$(AM_V_at)rm -f Xnest$(EXEEXT) && $(MAKE) Xnest$(EXEEXT)
diff --git a/xorg-server/hw/xnest/man/Makefile.am b/xorg-server/hw/xnest/man/Makefile.am
new file mode 100644
index 000000000..30b6370bc
--- /dev/null
+++ b/xorg-server/hw/xnest/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xnest.man
diff --git a/xorg-server/hw/xnest/Xnest.man.pre b/xorg-server/hw/xnest/man/Xnest.man
index 024d88e82..024d88e82 100644
--- a/xorg-server/hw/xnest/Xnest.man.pre
+++ b/xorg-server/hw/xnest/man/Xnest.man
diff --git a/xorg-server/hw/xquartz/Makefile.am b/xorg-server/hw/xquartz/Makefile.am
index 96b1fb0c5..61b04e0e1 100644
--- a/xorg-server/hw/xquartz/Makefile.am
+++ b/xorg-server/hw/xquartz/Makefile.am
@@ -14,9 +14,9 @@ if GLX
GL_DIR = GL
endif
-SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup doc
+SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup man
-DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup doc
+DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup man
libXquartz_la_SOURCES = \
$(top_srcdir)/fb/fbcmap_mi.c \
diff --git a/xorg-server/hw/xquartz/bundle/cpprules.in b/xorg-server/hw/xquartz/bundle/cpprules.in
index f32eafc06..92a987d92 100644
--- a/xorg-server/hw/xquartz/bundle/cpprules.in
+++ b/xorg-server/hw/xquartz/bundle/cpprules.in
@@ -13,25 +13,7 @@ CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
-e '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
-e '/\@\@$$/s/\@\@$$/\\/'
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
-
-MANDEFS = \
- -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
- -D__appmansuffix__=$(APP_MAN_SUFFIX) \
- -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
- -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
- -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
- -D__XSERVERNAME__=Xorg -D__XCONFIGFILE__=xorg.conf \
- -D__xinitdir__=$(XINITDIR) \
- -D__bindir__=$(bindir) \
- -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS)
-
-SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp
+SUFFIXES = .cpp
.cpp:
- $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
-
-.man.$(APP_MAN_SUFFIX):
- $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
+ $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
diff --git a/xorg-server/hw/xquartz/doc/Makefile.am b/xorg-server/hw/xquartz/doc/Makefile.am
deleted file mode 100644
index 6c68c845e..000000000
--- a/xorg-server/hw/xquartz/doc/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-appmandir = $(APP_MAN_DIR)
-appman_PRE = Xquartz.man.pre
-appman_PROCESSED = $(appman_PRE:man.pre=man)
-appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
-
-CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
-
-include $(top_srcdir)/cpprules.in
-
-MANDEFS += -D__laucnd_id_prefix__=$(LAUNCHD_ID_PREFIX)
-
-.man.$(APP_MAN_SUFFIX):
- $(AM_V_at)cp $< $@
-
-EXTRA_DIST = \
- Xquartz.man.pre
diff --git a/xorg-server/hw/xquartz/man/Makefile.am b/xorg-server/hw/xquartz/man/Makefile.am
new file mode 100644
index 000000000..5a0cde7cc
--- /dev/null
+++ b/xorg-server/hw/xquartz/man/Makefile.am
@@ -0,0 +1,2 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = Xquartz.man
diff --git a/xorg-server/hw/xquartz/doc/Xquartz.man.pre b/xorg-server/hw/xquartz/man/Xquartz.man
index 447194740..447194740 100644
--- a/xorg-server/hw/xquartz/doc/Xquartz.man.pre
+++ b/xorg-server/hw/xquartz/man/Xquartz.man
diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am
index 3173fb59d..7d135ca49 100644
--- a/xorg-server/hw/xwin/Makefile.am
+++ b/xorg-server/hw/xwin/Makefile.am
@@ -1,225 +1,204 @@
-bin_PROGRAMS = XWin
-
-if XWIN_CLIPBOARD
-SRCS_CLIPBOARD = \
- winclipboardinit.c \
- winclipboardtextconv.c \
- winclipboardthread.c \
- winclipboardunicode.c \
- winclipboardwndproc.c \
- winclipboardwrappers.c \
- winclipboardxevents.c
-DEFS_CLIPBOARD = -DXWIN_CLIPBOARD
-endif
-
-if XWIN_GLX_WINDOWS
-GLX_DIR = glx
-DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
-XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la
-XWIN_GLX_LINK_FLAGS = -lopengl32
-endif
-
-if XWIN_MULTIWINDOW
-SRCS_MULTIWINDOW = \
- winmultiwindowshape.c \
- winmultiwindowwindow.c \
- winmultiwindowwm.c \
- winmultiwindowwndproc.c
-DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW
-endif
-
-if XWIN_MULTIWINDOWEXTWM
-SRCS_MULTIWINDOWEXTWM = \
- winwin32rootless.c \
- winwin32rootlesswindow.c \
- winwin32rootlesswndproc.c \
- winwindowswm.c
-DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
-MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
-endif
-
-if XWIN_NATIVEGDI
-SRCS_NATIVEGDI = \
- winclip.c \
- winfillsp.c \
- winfont.c \
- wingc.c \
- wingetsp.c \
- winnativegdi.c \
- winpixmap.c \
- winpolyline.c \
- winrop.c \
- winsetsp.c
-DEFS_NATIVEGDI = -DXWIN_NATIVEGDI
-endif
-
-if XWIN_PRIMARYFB
-SRCS_PRIMARYFB = \
- winpfbdd.c
-DEFS_PRIMARYFB = -DXWIN_PRIMARYFB
-endif
-
-if XWIN_RANDR
-SRCS_RANDR = \
- winrandr.c
-DEFS_RANDR = -DXWIN_RANDR
-endif
-
-if XWIN_XV
-SRCS_XV = \
- winvideo.c
-DEFS_XV = -DXWIN_XV
-endif
-
-SRCS = InitInput.c \
- InitOutput.c \
- winallpriv.c \
- winauth.c \
- winblock.c \
- wincmap.c \
- winconfig.c \
- wincreatewnd.c \
- wincursor.c \
- windialogs.c \
- winengine.c \
- winerror.c \
- winglobals.c \
- winkeybd.c \
- winkeyhook.c \
- winmisc.c \
- winmouse.c \
- winmsg.c \
- winmultiwindowclass.c \
- winmultiwindowicons.c \
- winprefs.c \
- winprefsyacc.y \
- winprefslex.l \
- winprocarg.c \
- winregistry.c \
- winscrinit.c \
- winshaddd.c \
- winshadddnl.c \
- winshadgdi.c \
- wintrayicon.c \
- winvalargs.c \
- winwakeup.c \
- winwindow.c \
- winwndproc.c \
- ddraw.h \
- winclipboard.h \
- winconfig.h \
- win.h \
- winkeybd.h \
- winkeynames.h \
- winlayouts.h \
- winmessages.h \
- winmsg.h \
- winms.h \
- winmultiwindowclass.h \
- winprefs.h \
- winresource.h \
- winwindow.h \
- windisplay.c \
- XWin.rc \
- $(top_srcdir)/Xext/dpmsstubs.c \
- $(top_srcdir)/Xi/stubs.c \
- $(top_srcdir)/mi/miinitext.c \
- $(top_srcdir)/fb/fbcmap_mi.c \
- $(SRCS_CLIPBOARD) \
- $(SRCS_MULTIWINDOW) \
- $(SRCS_MULTIWINDOWEXTWM) \
- $(SRCS_NATIVEGDI) \
- $(SRCS_PRIMARYFB) \
- $(SRCS_RANDR) \
- $(SRCS_XV)
-
- DEFS = $(DEFS_CLIPBOARD) \
- $(DEFS_GLX_WINDOWS) \
- $(DEFS_MULTIWINDOW) \
- $(DEFS_MULTIWINDOWEXTWM) \
- $(DEFS_NATIVEGDI) \
- $(DEFS_PRIMARYFB) \
- $(DEFS_RANDR) \
- $(DEFS_XV)
-
-XWin_SOURCES = $(SRCS)
-
-INCLUDES = -I$(top_srcdir)/miext/rootless
-
-XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
-XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
-XWin_LDFLAGS = -mwindows -static
-
-.rc.o:
- $(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
-
-winprefsyacc.h: winprefsyacc.c
-winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
-
-BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c
-CLEANFILES = $(BUILT_SOURCES) $(appman_DATA) $(fileman_DATA) XWin.man XWinrc.man
-
-AM_YFLAGS = -d
-AM_LFLAGS = -i
-AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
- $(XWINMODULES_CFLAGS) \
- -I$(top_srcdir) \
- -Wno-bad-function-cast
-
-MAN_SRCS = XWin.man.pre XWinrc.man.pre
-
-appmandir = $(APP_MAN_DIR)
-appman_DATA = XWin.$(APP_MAN_SUFFIX)
-
-filemandir = $(FILE_MAN_DIR)
-fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX)
-
-XWin.$(APP_MAN_SUFFIX): XWin.man
- -$(AM_V_at)rm -f XWin.$(APP_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX)
-
-XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man
- -$(AM_V_at)rm -f XWinrc.$(FILE_MAN_SUFFIX)
- $(AM_V_at)$(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX)
-
-EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir)
-
-xwinconfigdir = $(sysconfdir)/X11
-xwinconfig_DATA = system.XWinrc
-
-include $(top_srcdir)/cpprules.in
-
-install-exec-hook:
- (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) XWin$(EXEEXT) X)
-
-EXTRA_DIST = \
- $(MAN_SRCS) \
- $(xwinconfig_DATA) \
- X.ico \
- XWin.rc \
- xlaunch/config.cc \
- xlaunch/COPYING \
- xlaunch/main.cc \
- xlaunch/resources/dialog.rc \
- xlaunch/resources/fullscreen.bmp \
- xlaunch/resources/images.rc \
- xlaunch/resources/multiwindow.bmp \
- xlaunch/resources/nodecoration.bmp \
- xlaunch/resources/resources.h \
- xlaunch/resources/resources.rc \
- xlaunch/resources/strings.rc \
- xlaunch/resources/windowed.bmp \
- xlaunch/window/dialog.cc \
- xlaunch/window/dialog.h \
- xlaunch/window/util.cc \
- xlaunch/window/util.h \
- xlaunch/window/window.cc \
- xlaunch/window/window.h \
- xlaunch/window/wizard.cc \
- xlaunch/window/wizard.h
-
-relink:
- $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT)
-
-SUBDIRS = $(GLX_DIR) .
-DIST_SUBDIRS = glx .
+bin_PROGRAMS = XWin
+
+if XWIN_CLIPBOARD
+SRCS_CLIPBOARD = \
+ winclipboardinit.c \
+ winclipboardtextconv.c \
+ winclipboardthread.c \
+ winclipboardunicode.c \
+ winclipboardwndproc.c \
+ winclipboardwrappers.c \
+ winclipboardxevents.c
+DEFS_CLIPBOARD = -DXWIN_CLIPBOARD
+endif
+
+if XWIN_GLX_WINDOWS
+GLX_DIR = glx
+DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
+XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la
+XWIN_GLX_LINK_FLAGS = -lopengl32
+endif
+
+if XWIN_MULTIWINDOW
+SRCS_MULTIWINDOW = \
+ winmultiwindowshape.c \
+ winmultiwindowwindow.c \
+ winmultiwindowwm.c \
+ winmultiwindowwndproc.c
+DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW
+endif
+
+if XWIN_MULTIWINDOWEXTWM
+SRCS_MULTIWINDOWEXTWM = \
+ winwin32rootless.c \
+ winwin32rootlesswindow.c \
+ winwin32rootlesswndproc.c \
+ winwindowswm.c
+DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
+MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
+endif
+
+if XWIN_NATIVEGDI
+SRCS_NATIVEGDI = \
+ winclip.c \
+ winfillsp.c \
+ winfont.c \
+ wingc.c \
+ wingetsp.c \
+ winnativegdi.c \
+ winpixmap.c \
+ winpolyline.c \
+ winrop.c \
+ winsetsp.c
+DEFS_NATIVEGDI = -DXWIN_NATIVEGDI
+endif
+
+if XWIN_PRIMARYFB
+SRCS_PRIMARYFB = \
+ winpfbdd.c
+DEFS_PRIMARYFB = -DXWIN_PRIMARYFB
+endif
+
+if XWIN_RANDR
+SRCS_RANDR = \
+ winrandr.c
+DEFS_RANDR = -DXWIN_RANDR
+endif
+
+if XWIN_XV
+SRCS_XV = \
+ winvideo.c
+DEFS_XV = -DXWIN_XV
+endif
+
+SRCS = InitInput.c \
+ InitOutput.c \
+ winallpriv.c \
+ winauth.c \
+ winblock.c \
+ wincmap.c \
+ winconfig.c \
+ wincreatewnd.c \
+ wincursor.c \
+ windialogs.c \
+ winengine.c \
+ winerror.c \
+ winglobals.c \
+ winkeybd.c \
+ winkeyhook.c \
+ winmisc.c \
+ winmouse.c \
+ winmsg.c \
+ winmultiwindowclass.c \
+ winmultiwindowicons.c \
+ winprefs.c \
+ winprefsyacc.y \
+ winprefslex.l \
+ winprocarg.c \
+ winregistry.c \
+ winscrinit.c \
+ winshaddd.c \
+ winshadddnl.c \
+ winshadgdi.c \
+ wintrayicon.c \
+ winvalargs.c \
+ winwakeup.c \
+ winwindow.c \
+ winwndproc.c \
+ ddraw.h \
+ winclipboard.h \
+ winconfig.h \
+ win.h \
+ winkeybd.h \
+ winkeynames.h \
+ winlayouts.h \
+ winmessages.h \
+ winmsg.h \
+ winms.h \
+ winmultiwindowclass.h \
+ winprefs.h \
+ winresource.h \
+ winwindow.h \
+ windisplay.c \
+ XWin.rc \
+ $(top_srcdir)/Xext/dpmsstubs.c \
+ $(top_srcdir)/Xi/stubs.c \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/fb/fbcmap_mi.c \
+ $(SRCS_CLIPBOARD) \
+ $(SRCS_MULTIWINDOW) \
+ $(SRCS_MULTIWINDOWEXTWM) \
+ $(SRCS_NATIVEGDI) \
+ $(SRCS_PRIMARYFB) \
+ $(SRCS_RANDR) \
+ $(SRCS_XV)
+
+ DEFS = $(DEFS_CLIPBOARD) \
+ $(DEFS_GLX_WINDOWS) \
+ $(DEFS_MULTIWINDOW) \
+ $(DEFS_MULTIWINDOWEXTWM) \
+ $(DEFS_NATIVEGDI) \
+ $(DEFS_PRIMARYFB) \
+ $(DEFS_RANDR) \
+ $(DEFS_XV)
+
+XWin_SOURCES = $(SRCS)
+
+INCLUDES = -I$(top_srcdir)/miext/rootless
+
+XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
+XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
+XWin_LDFLAGS = -mwindows -static
+
+.rc.o:
+ $(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
+
+winprefsyacc.h: winprefsyacc.c
+winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
+
+BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c
+CLEANFILES = $(BUILT_SOURCES)
+
+AM_YFLAGS = -d
+AM_LFLAGS = -i
+AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
+ $(XWINMODULES_CFLAGS) \
+ -I$(top_srcdir) \
+ -Wno-bad-function-cast
+
+xwinconfigdir = $(sysconfdir)/X11
+xwinconfig_DATA = system.XWinrc
+
+install-exec-hook:
+ (cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) XWin$(EXEEXT) X)
+
+EXTRA_DIST = \
+ $(xwinconfig_DATA) \
+ X.ico \
+ XWin.rc \
+ xlaunch/config.cc \
+ xlaunch/COPYING \
+ xlaunch/main.cc \
+ xlaunch/resources/dialog.rc \
+ xlaunch/resources/fullscreen.bmp \
+ xlaunch/resources/images.rc \
+ xlaunch/resources/multiwindow.bmp \
+ xlaunch/resources/nodecoration.bmp \
+ xlaunch/resources/resources.h \
+ xlaunch/resources/resources.rc \
+ xlaunch/resources/strings.rc \
+ xlaunch/resources/windowed.bmp \
+ xlaunch/window/dialog.cc \
+ xlaunch/window/dialog.h \
+ xlaunch/window/util.cc \
+ xlaunch/window/util.h \
+ xlaunch/window/window.cc \
+ xlaunch/window/window.h \
+ xlaunch/window/wizard.cc \
+ xlaunch/window/wizard.h
+
+relink:
+ $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT)
+
+SUBDIRS = man $(GLX_DIR) .
+DIST_SUBDIRS = man glx .
diff --git a/xorg-server/hw/xwin/XWin.exe.manifest b/xorg-server/hw/xwin/XWin.exe.manifest
new file mode 100644
index 000000000..5668383a9
--- /dev/null
+++ b/xorg-server/hw/xwin/XWin.exe.manifest
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <description>The XWin X Windows server for Cygwin.</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="X86"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/xorg-server/hw/xwin/man/Makefile.am b/xorg-server/hw/xwin/man/Makefile.am
new file mode 100644
index 000000000..d19c2729f
--- /dev/null
+++ b/xorg-server/hw/xwin/man/Makefile.am
@@ -0,0 +1,3 @@
+include $(top_srcdir)/manpages.am
+appman_PRE = XWin.man
+fileman_PRE = XWinrc.man
diff --git a/xorg-server/hw/xwin/XWin.man.pre b/xorg-server/hw/xwin/man/XWin.man
index 356eb625d..51268f69a 100644
--- a/xorg-server/hw/xwin/XWin.man.pre
+++ b/xorg-server/hw/xwin/man/XWin.man
@@ -1,346 +1,346 @@
-.TH XWIN 1 __vendorversion__
-.SH NAME
-XWin \- X Server for the Cygwin environment on Microsoft Windows
-
-
-.SH SYNOPSIS
-.B XWin
-[ options ] ...
-
-
-.SH DESCRIPTION
-\fIXWin\fP is an X Server for the X Window System on the Cygwin environment
-running on Microsoft Windows.
-
-
-.SH MODES
-\fIXWin\fP can operate in 3 different modes:
-.br
-* \fISingle Window\fP: This is the default mode. Each X screen
-appears as a single \fIWindows\fP window and all X windows are contained
-within this window.
-(In X terminology, the \fIWindows\fP window contains the root window for
-the screen)
-.br
-* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated
-window manager in order to handle the top-level X windows, in such a
-way that they appear as normal \fIWindows\fP windows.
-.br
-* \fIRootless\fP: In this mode the X server works in a window
-containing the whole screen but this root window (traditionally covered with an X hatch
-pattern) is hidden from view, so only top-level X windows are seen.
-
-.SH OPTIONS
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXWin\fP accepts the following command line switches,
-\fIall\fP of which are optional:
-
-.SH OPTIONS CONTROLLING WINDOWING MODE
-Only one of these options may be specified.
-.TP 8
-.B (default)
-Windowed or rooted mode.
-Each X screen appears as a single \fIWindows\fP window and all X windows are
-contained within those windows.
-.TP 8
-.B \-multiwindow
-Each top-level X window appears in its own \fIWindows\fP window.
-Also start the integrated \fIWindows\fP-based window manager.
-.TP 8
-.B \-rootless
-Run the server in rootless mode.
-The X server works on a window covering the whole screen but the root window
-is hidden from view.
-.TP 8
-.B \-mwextwm
-Experimental.
-The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
-window frames managed by the experimental external window manager \fIxwinwm\fP.
-.PP
-\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
-All other modes require an external window manager in order to move, resize, and perform other
-operations on the individual X windows.
-
-.SH OPTIONS FOR SPECIFYING X SCREENS
-An X display may be composed of multiple screens.
-The default behaviour is to create a single screen 0 that is roughly the
-size of useful area of the primary monitor (allowing for any window
-decorations and the task-bar).
-
-Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a
-default to all screens by placing those screen specific parameters
-before any \fB\-screen\fP parameter. Screen specific parameters placed after
-the first \fB\-screen\fP parameter will apply only to the immediately
-preceeding \fB\-screen\fP parameter.
-.TP 8
-.B \-[no]multimonitors or \-[no]multiplemonitors
-Create a screen 0 that covers all monitors [the primary monitor] on a system with
-multiple monitors.
-This option is currently enabled by default in \fB\-multiwindow\fP mode.
-.TP 8
-.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "
-Create screen number
-.I screen_number
-and optionally specify it's
-.I height,
-.I width
-and
-.I initial position.
-Additionally a
-.I
-monitor number
-(which count from 1) can be specified to place the screen on,
-at which point, all coordinates become relative to that monitor.
-Screen numbers must be contiguous starting from zero and cannot be duplicated.
-
-Examples:
-
-.I " -screen 0 @1 ; on 1st monitor using its full resolution (the default)"
-
-.I " -screen 0 800x600+100+100@2 ; on 2nd monitor offset 100,100 size 800x600"
-
-.I " -screen 0 1024x768@3 ; on 3rd monitor size 1024x768"
-
-.SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS
-These parameters only apply to windowed mode screens i.e. not
-in \fB-multwindow\fP or \fB-rootless\fP mode
-.TP 8
-.B "\-fullscreen"
-The X server window takes the full screen, covering completely the
-\fIWindows\fP desktop.
-.TP 8
-.B \-nodecoration
-Do not give the Cygwin/X window a \fIWindows\fP window border, title bar,
-etc.
-This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
-.TP 8
-.B \-scrollbars
-In windowed mode, allow screens bigger than the \fIWindows\fP desktop.
-Moreover, if the window has decorations, one can now resize it.
-This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
-
-
-.SH OPTIONS CONTROLLING WINDOWS INTEGRATION
-.TP 8
-.B \-[no]clipboard
-Enables [disables] the integration between the Cygwin/X clipboard and
-\fIWindows\fP clipboard. The default is enabled.
-.TP 8
-.B "\-emulate3buttons [\fItimeout\fP]"
-Emulate a three button mouse; pressing both buttons within
-.I timeout
-milliseconds causes an emulated middle button press. The default
-.I timeout
-is 50 milliseconds. Note that most mice with scroll wheel have middle
-button functionality, usually you will need this option only if you have
-a two button mouse without scroll wheel.
-.TP 8
-.B \-[no]keyhook
-Enable [disable] a low-level keyboard hook for catching
-special keypresses like Menu and Alt+Tab and passing them to the X
-Server instead of letting \fIWindows\fP handle them.
-.TP 8
-.B \-lesspointer
-Normally the \fIWindows\fP mouse cursor is hidden when the mouse is
-over an active Cygwin/X window. This option causes the mouse cursor
-also to be hidden when it is over an inactive Cygwin/X window. This
-prevents the \fIWindows\fP mouse cursor from being drawn on top of the X
-cursor.
-This parameter has no effect unless \fB-swcursor\fP is also specified.
-.TP 8
-.B \-swcursor
-Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead.
-.TP 8
-.B \-[no]trayicon
-Do not create a tray icon. Default is to create one
-icon per screen. You can globally disable tray icons with
-\fB\-notrayicon\fP, then enable it for specific screens with
-\fB\-trayicon\fP for those screens.
-.TP 8
-.B \-nounicodeclipboard
-Do not use Unicode clipboard even if on a NT-based platform.
-.TP 8
-.B \-[no]unixkill
-Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
-signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination
-is disabled by default.
-.TP 8
-.B \-[no]winkill
-Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
-X Server.
-The \fIAlt-F4\fP key combination is enabled by default.
-
-.SH DRAWING ENGINE OPTIONS
-.TP 8
-.B "\-clipupdates \fInum_boxes\fP"
-Specify an optional threshold, above which the regions in a shadow
-update operation will be collected into a GDI clipping region. The
-clipping region is then used to do a single bit block transfer that is
-constrained to the updated area by the clipping region. There is some
-overhead involved in creating, installing, destroying, and removing
-the clipping region, thus there may not be much benefit for a small
-number of boxes (less than 10). It is even possible that this
-functionality does not provide a benefit at any number of boxes; we
-can only determine the usefulness of this feature through testing.
-This option probably has limited effect on current \fIWindows\fP versions
-as they already perform GDI batching.
-This parameter works in conjunction with engines 1, 2, and 4 (Shadow
-GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
-respectively).
-.TP 8
-.B "\-engine \fIengine_type_id\fP"
-This option, which is intended for Cygwin/X developers,
-overrides the server's automatically selected engine type. This
-parameter will be ignored if the specified engine type is not
-supported on the current system. The supported engine type ids are 1
-- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw Non-Locking.
-Additionally, there are engines with type ids
-8 - Primary DirectDraw (obsolete) and 16 - Native GDI (experimental and barely functional).
-Default behavior is to determine the engine with optimum performance that
-supports the specified depth and window configuration.
-
-.SH FULLSCREEN OPTIONS
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specify the color depth, in bits per pixel, to use when running in
-fullscreen with a DirectDraw engine. This parameter is ignored if
-\fB\-fullscreen\fP is not specified.
-.TP 8
-.B "\-refresh \fIrate_in_Hz\fP"
-Specify an optional refresh rate to use when running in
-fullscreen with a DirectDraw engine. This parameter is ignored if
-\fB\-fullscreen\fP is not specified.
-
-.SH MISCELLANEOUS OPTIONS
-See also the normal server options described in the \fIXserver(1)\fP
-manual page
-
-.TP 8
-.B \-help
-Write a help text listing supported command line options and their description to the console.
-.TP 8
-.B \-ignoreinput
-Ignore keyboard and mouse input. This is usually only used for testing
-and debugging purposes.
-.TP 8
-.B "\-logfile \fIfilename\fP"
-Change the server log file from the default of \fI
-__logdir__/XWin.n.log\fP,
-where \fIn\fP is the display number of the XWin server, to \fIfilename\fP.
-.TP 8
-.B "\-logverbose \fIlevel\fP"
-Control the degree of verbosity of the log messages with the integer
-parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are
-reported, for \fIlevel\fP=1 simple information about
-configuration is also given, for \fIlevel\fP=2 (default)
-additional runtime information is recorded
-and for \fIlevel\fP=3 detailed log
-information (including trace and debug output) is produced. Bigger
-values will yield a still more detailed debug output.
-.TP 8
-.B \-silent-dup-error
-If another instance of \fIXWin\fP with the same display number is found running,
-exit silently and don't display any error message.
-.TP 8
-.B "\-xkblayout \fIlayout\fP"
-.TP 8
-.B "\-xkbmodel \fImodel\fP"
-.TP 8
-.B "\-xkboptions \fIoption\fP"
-.TP 8
-.B "\-xkbrules \fIrule\fP"
-.TP 8
-.B "\-xkbvariant \fIvariant\fp"
-These options configure the xkeyboard extension to load
-a particular keyboard map as the X server starts. The behavior is similar
-to the \fIsetxkbmap\fP program. The layout data is located at \fI
-__datadir__/X11/xkb/\fP. Additional information is found in the
-README files therein and in the man page of \fIsetxkbmap\fP. For example
-in order to load a German layout for a pc105 keyboard one uses
-the options:
-.br
-.I " \-xkblayout de \-xkbmodel pc105"
-
-Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
-running.
-
-The default is to select a configuration matching your current layout as
-reported by \fIWindows\fP, if known, or the default X server configuration
-if no matching keyboard configuration was found.
-
-.SH UNDOCUMENTED OPTIONS
-These options are undocumented. Do not use them.
-
-.TP 8
-.B \-emulatepseudo
-Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
-or 32, collectively known as TrueColor depths.
-Color map manipulation is not supported, so the PseudoColor visual will
-not have the correct colors.
-This option is intended to allow applications which only work with a depth 8
-visual to operate in TrueColor modes.
-.TP 8
-.B \-internalwm
-Run the internal window manager.
-
-.SH LOG FILE
-As it runs \fIXWin\fP writes messages indicating the most relevant events
-to the console
-from which it was called and to a log file that by default is located at \fI
-__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes.
-
-
-.SH PREFERENCES FILE
-On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if
-the previous file does not exist, \fI
-__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting
-preferences for the following:
-.br
-* To include items into the menu associated with the \fIXWin\fP icon
-which is in the \fIWindows\fP system tray. This functions in all
-modes that have a tray icon.
-.br
-* To include items in the system menu which is associated with the \fIWindows\fP
-window that \fIXWin -multiwindow\fP produces for each top-level X
-window, in both the generic case and for particular programs.
-.br
-* To change the icon that is associated to the \fIWindows\fP window that
-\fIXWin -multiwindow\fP produces for each top-level X-window.
-.br
-* To change the style that is associated to the \fIWindows\fP window that
-\fXWin I-multiwindow\fP produces for each top-level X window.
-.PP
-The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
-
-.SH EXAMPLES
-Need some examples
-
-
-.SH "SEE ALSO"
-X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), setxkbmap(1)
-
-
-.SH BUGS
-.I XWin
-and this man page still have many limitations. Some of the more obvious
-ones are:
-.br
-- The display mode can not be changed once the X server has started.
-.br
-- The \fIXWin\fP software is continuously developing; it is therefore possible that
-this man page is not up to date. It is always prudent to
-look also at the output of \fIXWin -help\fP in order to
-check the options that are operative.
-
-
-.SH AUTHORS
-This list is by no means complete, but direct contributors to the
-Cygwin/X project include (in alphabetical order by last name): Stuart
-Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G
-C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor,
-John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf
-Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A
-Humblet, Harold L Hunt II, Dakshinamurthy Karra, Joe Krahn,
-Paul Loewenstein, Kensuke Matsuzaki,
-Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Yaakov Selkowitz,
-Suhaib Siddiqi, Jack Tanner, Jon Turney and Nicholas Wourms.
+.TH XWIN 1 __vendorversion__
+.SH NAME
+XWin \- X Server for the Cygwin environment on Microsoft Windows
+
+
+.SH SYNOPSIS
+.B XWin
+[ options ] ...
+
+
+.SH DESCRIPTION
+\fIXWin\fP is an X Server for the X Window System on the Cygwin environment
+running on Microsoft Windows.
+
+
+.SH MODES
+\fIXWin\fP can operate in 3 different modes:
+.br
+* \fISingle Window\fP: This is the default mode. Each X screen
+appears as a single \fIWindows\fP window and all X windows are contained
+within this window.
+(In X terminology, the \fIWindows\fP window contains the root window for
+the screen)
+.br
+* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated
+window manager in order to handle the top-level X windows, in such a
+way that they appear as normal \fIWindows\fP windows.
+.br
+* \fIRootless\fP: In this mode the X server works in a window
+containing the whole screen but this root window (traditionally covered with an X hatch
+pattern) is hidden from view, so only top-level X windows are seen.
+
+.SH OPTIONS
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXWin\fP accepts the following command line switches,
+\fIall\fP of which are optional:
+
+.SH OPTIONS CONTROLLING WINDOWING MODE
+Only one of these options may be specified.
+.TP 8
+.B (default)
+Windowed or rooted mode.
+Each X screen appears as a single \fIWindows\fP window and all X windows are
+contained within those windows.
+.TP 8
+.B \-multiwindow
+Each top-level X window appears in its own \fIWindows\fP window.
+Also start the integrated \fIWindows\fP-based window manager.
+.TP 8
+.B \-rootless
+Run the server in rootless mode.
+The X server works on a window covering the whole screen but the root window
+is hidden from view.
+.TP 8
+.B \-mwextwm
+Experimental.
+The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
+window frames managed by the experimental external window manager \fIxwinwm\fP.
+.PP
+\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
+All other modes require an external window manager in order to move, resize, and perform other
+operations on the individual X windows.
+
+.SH OPTIONS FOR SPECIFYING X SCREENS
+An X display may be composed of multiple screens.
+The default behaviour is to create a single screen 0 that is roughly the
+size of useful area of the primary monitor (allowing for any window
+decorations and the task-bar).
+
+Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a
+default to all screens by placing those screen specific parameters
+before any \fB\-screen\fP parameter. Screen specific parameters placed after
+the first \fB\-screen\fP parameter will apply only to the immediately
+preceeding \fB\-screen\fP parameter.
+.TP 8
+.B \-[no]multimonitors or \-[no]multiplemonitors
+Create a screen 0 that covers all monitors [the primary monitor] on a system with
+multiple monitors.
+This option is currently enabled by default in \fB\-multiwindow\fP mode.
+.TP 8
+.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "
+Create screen number
+.I screen_number
+and optionally specify it's
+.I height,
+.I width
+and
+.I initial position.
+Additionally a
+.I
+monitor number
+(which count from 1) can be specified to place the screen on,
+at which point, all coordinates become relative to that monitor.
+Screen numbers must be contiguous starting from zero and cannot be duplicated.
+
+Examples:
+
+.I " -screen 0 @1 ; on 1st monitor using its full resolution (the default)"
+
+.I " -screen 0 800x600+100+100@2 ; on 2nd monitor offset 100,100 size 800x600"
+
+.I " -screen 0 1024x768@3 ; on 3rd monitor size 1024x768"
+
+.SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS
+These parameters only apply to windowed mode screens i.e. not
+in \fB-multwindow\fP or \fB-rootless\fP mode
+.TP 8
+.B "\-fullscreen"
+The X server window takes the full screen, covering completely the
+\fIWindows\fP desktop.
+.TP 8
+.B \-nodecoration
+Do not give the Cygwin/X window a \fIWindows\fP window border, title bar,
+etc.
+This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
+.TP 8
+.B \-scrollbars
+In windowed mode, allow screens bigger than the \fIWindows\fP desktop.
+Moreover, if the window has decorations, one can now resize it.
+This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
+
+
+.SH OPTIONS CONTROLLING WINDOWS INTEGRATION
+.TP 8
+.B \-[no]clipboard
+Enables [disables] the integration between the Cygwin/X clipboard and
+\fIWindows\fP clipboard. The default is enabled.
+.TP 8
+.B "\-emulate3buttons [\fItimeout\fP]"
+Emulate a three button mouse; pressing both buttons within
+.I timeout
+milliseconds causes an emulated middle button press. The default
+.I timeout
+is 50 milliseconds. Note that most mice with scroll wheel have middle
+button functionality, usually you will need this option only if you have
+a two button mouse without scroll wheel.
+.TP 8
+.B \-[no]keyhook
+Enable [disable] a low-level keyboard hook for catching
+special keypresses like Menu and Alt+Tab and passing them to the X
+Server instead of letting \fIWindows\fP handle them.
+.TP 8
+.B \-lesspointer
+Normally the \fIWindows\fP mouse cursor is hidden when the mouse is
+over an active Cygwin/X window. This option causes the mouse cursor
+also to be hidden when it is over an inactive Cygwin/X window. This
+prevents the \fIWindows\fP mouse cursor from being drawn on top of the X
+cursor.
+This parameter has no effect unless \fB-swcursor\fP is also specified.
+.TP 8
+.B \-swcursor
+Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead.
+.TP 8
+.B \-[no]trayicon
+Do not create a tray icon. Default is to create one
+icon per screen. You can globally disable tray icons with
+\fB\-notrayicon\fP, then enable it for specific screens with
+\fB\-trayicon\fP for those screens.
+.TP 8
+.B \-nounicodeclipboard
+Do not use Unicode clipboard even if on a NT-based platform.
+.TP 8
+.B \-[no]unixkill
+Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
+signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination
+is disabled by default.
+.TP 8
+.B \-[no]winkill
+Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
+X Server.
+The \fIAlt-F4\fP key combination is enabled by default.
+
+.SH DRAWING ENGINE OPTIONS
+.TP 8
+.B "\-clipupdates \fInum_boxes\fP"
+Specify an optional threshold, above which the regions in a shadow
+update operation will be collected into a GDI clipping region. The
+clipping region is then used to do a single bit block transfer that is
+constrained to the updated area by the clipping region. There is some
+overhead involved in creating, installing, destroying, and removing
+the clipping region, thus there may not be much benefit for a small
+number of boxes (less than 10). It is even possible that this
+functionality does not provide a benefit at any number of boxes; we
+can only determine the usefulness of this feature through testing.
+This option probably has limited effect on current \fIWindows\fP versions
+as they already perform GDI batching.
+This parameter works in conjunction with engines 1, 2, and 4 (Shadow
+GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
+respectively).
+.TP 8
+.B "\-engine \fIengine_type_id\fP"
+This option, which is intended for Cygwin/X developers,
+overrides the server's automatically selected engine type. This
+parameter will be ignored if the specified engine type is not
+supported on the current system. The supported engine type ids are 1
+- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw Non-Locking.
+Additionally, there are engines with type ids
+8 - Primary DirectDraw (obsolete) and 16 - Native GDI (experimental and barely functional).
+Default behavior is to determine the engine with optimum performance that
+supports the specified depth and window configuration.
+
+.SH FULLSCREEN OPTIONS
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specify the color depth, in bits per pixel, to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+.TP 8
+.B "\-refresh \fIrate_in_Hz\fP"
+Specify an optional refresh rate to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+
+.SH MISCELLANEOUS OPTIONS
+See also the normal server options described in the \fIXserver(1)\fP
+manual page
+
+.TP 8
+.B \-help
+Write a help text listing supported command line options and their description to the console.
+.TP 8
+.B \-ignoreinput
+Ignore keyboard and mouse input. This is usually only used for testing
+and debugging purposes.
+.TP 8
+.B "\-logfile \fIfilename\fP"
+Change the server log file from the default of \fI
+__logdir__/XWin.n.log\fP,
+where \fIn\fP is the display number of the XWin server, to \fIfilename\fP.
+.TP 8
+.B "\-logverbose \fIlevel\fP"
+Control the degree of verbosity of the log messages with the integer
+parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are
+reported, for \fIlevel\fP=1 simple information about
+configuration is also given, for \fIlevel\fP=2 (default)
+additional runtime information is recorded
+and for \fIlevel\fP=3 detailed log
+information (including trace and debug output) is produced. Bigger
+values will yield a still more detailed debug output.
+.TP 8
+.B \-silent-dup-error
+If another instance of \fIXWin\fP with the same display number is found running,
+exit silently and don't display any error message.
+.TP 8
+.B "\-xkblayout \fIlayout\fP"
+.TP 8
+.B "\-xkbmodel \fImodel\fP"
+.TP 8
+.B "\-xkboptions \fIoption\fP"
+.TP 8
+.B "\-xkbrules \fIrule\fP"
+.TP 8
+.B "\-xkbvariant \fIvariant\fp"
+These options configure the xkeyboard extension to load
+a particular keyboard map as the X server starts. The behavior is similar
+to the \fIsetxkbmap\fP program. The layout data is located at \fI
+__datadir__/X11/xkb/\fP. Additional information is found in the
+README files therein and in the man page of \fIsetxkbmap\fP. For example
+in order to load a German layout for a pc105 keyboard one uses
+the options:
+.br
+.I " \-xkblayout de \-xkbmodel pc105"
+
+Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
+running.
+
+The default is to select a configuration matching your current layout as
+reported by \fIWindows\fP, if known, or the default X server configuration
+if no matching keyboard configuration was found.
+
+.SH UNDOCUMENTED OPTIONS
+These options are undocumented. Do not use them.
+
+.TP 8
+.B \-emulatepseudo
+Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
+or 32, collectively known as TrueColor depths.
+Color map manipulation is not supported, so the PseudoColor visual will
+not have the correct colors.
+This option is intended to allow applications which only work with a depth 8
+visual to operate in TrueColor modes.
+.TP 8
+.B \-internalwm
+Run the internal window manager.
+
+.SH LOG FILE
+As it runs \fIXWin\fP writes messages indicating the most relevant events
+to the console
+from which it was called and to a log file that by default is located at \fI
+__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes.
+
+
+.SH PREFERENCES FILE
+On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if
+the previous file does not exist, \fI
+__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting
+preferences for the following:
+.br
+* To include items into the menu associated with the \fIXWin\fP icon
+which is in the \fIWindows\fP system tray. This functions in all
+modes that have a tray icon.
+.br
+* To include items in the system menu which is associated with the \fIWindows\fP
+window that \fIXWin -multiwindow\fP produces for each top-level X
+window, in both the generic case and for particular programs.
+.br
+* To change the icon that is associated to the \fIWindows\fP window that
+\fIXWin -multiwindow\fP produces for each top-level X-window.
+.br
+* To change the style that is associated to the \fIWindows\fP window that
+\fXWin I-multiwindow\fP produces for each top-level X window.
+.PP
+The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+
+.SH EXAMPLES
+Need some examples
+
+
+.SH "SEE ALSO"
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), setxkbmap(1)
+
+
+.SH BUGS
+.I XWin
+and this man page still have many limitations. Some of the more obvious
+ones are:
+.br
+- The display mode can not be changed once the X server has started.
+.br
+- The \fIXWin\fP software is continuously developing; it is therefore possible that
+this man page is not up to date. It is always prudent to
+look also at the output of \fIXWin -help\fP in order to
+check the options that are operative.
+
+
+.SH AUTHORS
+This list is by no means complete, but direct contributors to the
+Cygwin/X project include (in alphabetical order by last name): Stuart
+Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G
+C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor,
+John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf
+Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A
+Humblet, Harold L Hunt II, Dakshinamurthy Karra, Joe Krahn,
+Paul Loewenstein, Kensuke Matsuzaki,
+Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Yaakov Selkowitz,
+Suhaib Siddiqi, Jack Tanner, Jon Turney and Nicholas Wourms.
diff --git a/xorg-server/hw/xwin/XWinrc.man.pre b/xorg-server/hw/xwin/man/XWinrc.man
index 5c1fb979b..5c1fb979b 100644
--- a/xorg-server/hw/xwin/XWinrc.man.pre
+++ b/xorg-server/hw/xwin/man/XWinrc.man
diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h
index 055354ee4..aa796978d 100644
--- a/xorg-server/include/scrnintstr.h
+++ b/xorg-server/include/scrnintstr.h
@@ -1,573 +1,577 @@
-/***********************************************************
-
-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.
-
-******************************************************************/
-
-#ifndef SCREENINTSTRUCT_H
-#define SCREENINTSTRUCT_H
-
-#include "screenint.h"
-#include "regionstr.h"
-#include "colormap.h"
-#include "cursor.h"
-#include "validate.h"
-#include <X11/Xproto.h>
-#include "dix.h"
-#include "privates.h"
-
-typedef struct _PixmapFormat {
- unsigned char depth;
- unsigned char bitsPerPixel;
- unsigned char scanlinePad;
- } PixmapFormatRec;
-
-typedef struct _Visual {
- VisualID vid;
- short class;
- short bitsPerRGBValue;
- long ColormapEntries;
- short nplanes;/* = log2 (ColormapEntries). This does not
- * imply that the screen has this many planes.
- * it may have more or fewer */
- unsigned long redMask, greenMask, blueMask;
- int offsetRed, offsetGreen, offsetBlue;
- } VisualRec;
-
-typedef struct _Depth {
- unsigned char depth;
- short numVids;
- VisualID *vids; /* block of visual ids for this depth */
- } DepthRec;
-
-typedef struct _ScreenSaverStuff {
- WindowPtr pWindow;
- XID wid;
- char blanked;
- Bool (*ExternalScreenSaver)(
- ScreenPtr /*pScreen*/,
- int /*xstate*/,
- Bool /*force*/);
-} ScreenSaverStuffRec;
-
-
-/*
- * There is a typedef for each screen function pointer so that code that
- * needs to declare a screen function pointer (e.g. in a screen private
- * or as a local variable) can easily do so and retain full type checking.
- */
-
-typedef Bool (* CloseScreenProcPtr)(
- int /*index*/,
- ScreenPtr /*pScreen*/);
-
-typedef void (* QueryBestSizeProcPtr)(
- int /*class*/,
- unsigned short * /*pwidth*/,
- unsigned short * /*pheight*/,
- ScreenPtr /*pScreen*/);
-
-typedef Bool (* SaveScreenProcPtr)(
- ScreenPtr /*pScreen*/,
- int /*on*/);
-
-typedef void (* GetImageProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*sx*/,
- int /*sy*/,
- int /*w*/,
- int /*h*/,
- unsigned int /*format*/,
- unsigned long /*planeMask*/,
- char * /*pdstLine*/);
-
-typedef void (* GetSpansProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*wMax*/,
- DDXPointPtr /*ppt*/,
- int* /*pwidth*/,
- int /*nspans*/,
- char * /*pdstStart*/);
-
-typedef void (* SourceValidateProcPtr)(
- DrawablePtr /*pDrawable*/,
- int /*x*/,
- int /*y*/,
- int /*width*/,
- int /*height*/,
- unsigned int /*subWindowMode*/);
-
-typedef Bool (* CreateWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* DestroyWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* PositionWindowProcPtr)(
- WindowPtr /*pWindow*/,
- int /*x*/,
- int /*y*/);
-
-typedef Bool (* ChangeWindowAttributesProcPtr)(
- WindowPtr /*pWindow*/,
- unsigned long /*mask*/);
-
-typedef Bool (* RealizeWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef Bool (* UnrealizeWindowProcPtr)(
- WindowPtr /*pWindow*/);
-
-typedef void (* RestackWindowProcPtr)(
- WindowPtr /*pWindow*/,
- WindowPtr /*pOldNextSib*/);
-
-typedef int (* ValidateTreeProcPtr)(
- WindowPtr /*pParent*/,
- WindowPtr /*pChild*/,
- VTKind /*kind*/);
-
-typedef void (* PostValidateTreeProcPtr)(
- WindowPtr /*pParent*/,
- WindowPtr /*pChild*/,
- VTKind /*kind*/);
-
-typedef void (* WindowExposuresProcPtr)(
- WindowPtr /*pWindow*/,
- RegionPtr /*prgn*/,
- RegionPtr /*other_exposed*/);
-
-typedef void (* CopyWindowProcPtr)(
- WindowPtr /*pWindow*/,
- DDXPointRec /*ptOldOrg*/,
- RegionPtr /*prgnSrc*/);
-
-typedef void (* ClearToBackgroundProcPtr)(
- WindowPtr /*pWindow*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- Bool /*generateExposures*/);
-
-typedef void (* ClipNotifyProcPtr)(
- WindowPtr /*pWindow*/,
- int /*dx*/,
- int /*dy*/);
-
-/* pixmap will exist only for the duration of the current rendering operation */
-#define CREATE_PIXMAP_USAGE_SCRATCH 1
-/* pixmap will be the backing pixmap for a redirected window */
-#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
-/* pixmap will contain a glyph */
-#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
-
-typedef PixmapPtr (* CreatePixmapProcPtr)(
- ScreenPtr /*pScreen*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/,
- unsigned /*usage_hint*/);
-
-typedef Bool (* DestroyPixmapProcPtr)(
- PixmapPtr /*pPixmap*/);
-
-typedef Bool (* RealizeFontProcPtr)(
- ScreenPtr /*pScreen*/,
- FontPtr /*pFont*/);
-
-typedef Bool (* UnrealizeFontProcPtr)(
- ScreenPtr /*pScreen*/,
- FontPtr /*pFont*/);
-
-typedef void (* ConstrainCursorProcPtr)(
- DeviceIntPtr /*pDev*/,
- ScreenPtr /*pScreen*/,
- BoxPtr /*pBox*/);
-
-typedef void (* CursorLimitsProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- BoxPtr /*pHotBox*/,
- BoxPtr /*pTopLeftBox*/);
-
-typedef Bool (* DisplayCursorProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef Bool (* RealizeCursorProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef Bool (* UnrealizeCursorProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/);
-
-typedef void (* RecolorCursorProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- CursorPtr /*pCursor*/,
- Bool /*displayed*/);
-
-typedef Bool (* SetCursorPositionProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /*pScreen*/,
- int /*x*/,
- int /*y*/,
- Bool /*generateEvent*/);
-
-typedef Bool (* CreateGCProcPtr)(
- GCPtr /*pGC*/);
-
-typedef Bool (* CreateColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* DestroyColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* InstallColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef void (* UninstallColormapProcPtr)(
- ColormapPtr /*pColormap*/);
-
-typedef int (* ListInstalledColormapsProcPtr) (
- ScreenPtr /*pScreen*/,
- XID* /*pmaps */);
-
-typedef void (* StoreColorsProcPtr)(
- ColormapPtr /*pColormap*/,
- int /*ndef*/,
- xColorItem * /*pdef*/);
-
-typedef void (* ResolveColorProcPtr)(
- unsigned short* /*pred*/,
- unsigned short* /*pgreen*/,
- unsigned short* /*pblue*/,
- VisualPtr /*pVisual*/);
-
-typedef RegionPtr (* BitmapToRegionProcPtr)(
- PixmapPtr /*pPix*/);
-
-typedef void (* SendGraphicsExposeProcPtr)(
- ClientPtr /*client*/,
- RegionPtr /*pRgn*/,
- XID /*drawable*/,
- int /*major*/,
- int /*minor*/);
-
-typedef void (* ScreenBlockHandlerProcPtr)(
- int /*screenNum*/,
- pointer /*blockData*/,
- pointer /*pTimeout*/,
- pointer /*pReadmask*/);
-
-typedef void (* ScreenWakeupHandlerProcPtr)(
- int /*screenNum*/,
- pointer /*wakeupData*/,
- unsigned long /*result*/,
- pointer /*pReadMask*/);
-
-typedef Bool (* CreateScreenResourcesProcPtr)(
- ScreenPtr /*pScreen*/);
-
-typedef Bool (* ModifyPixmapHeaderProcPtr)(
- PixmapPtr /*pPixmap*/,
- int /*width*/,
- int /*height*/,
- int /*depth*/,
- int /*bitsPerPixel*/,
- int /*devKind*/,
- pointer /*pPixData*/);
-
-typedef PixmapPtr (* GetWindowPixmapProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef void (* SetWindowPixmapProcPtr)(
- WindowPtr /*pWin*/,
- PixmapPtr /*pPix*/);
-
-typedef PixmapPtr (* GetScreenPixmapProcPtr)(
- ScreenPtr /*pScreen*/);
-
-typedef void (* SetScreenPixmapProcPtr)(
- PixmapPtr /*pPix*/);
-
-typedef void (* MarkWindowProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef Bool (* MarkOverlappedWindowsProcPtr)(
- WindowPtr /*parent*/,
- WindowPtr /*firstChild*/,
- WindowPtr * /*pLayerWin*/);
-
-typedef int (* ConfigNotifyProcPtr)(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- int /*w*/,
- int /*h*/,
- int /*bw*/,
- WindowPtr /*pSib*/);
-
-typedef void (* MoveWindowProcPtr)(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- WindowPtr /*pSib*/,
- VTKind /*kind*/);
-
-typedef void (* ResizeWindowProcPtr)(
- WindowPtr /*pWin*/,
- int /*x*/,
- int /*y*/,
- unsigned int /*w*/,
- unsigned int /*h*/,
- WindowPtr /*pSib*/
-);
-
-typedef WindowPtr (* GetLayerWindowProcPtr)(
- WindowPtr /*pWin*/
-);
-
-typedef void (* HandleExposuresProcPtr)(
- WindowPtr /*pWin*/);
-
-typedef void (* ReparentWindowProcPtr)(
- WindowPtr /*pWin*/,
- WindowPtr /*pPriorParent*/);
-
-typedef void (* SetShapeProcPtr)(
- WindowPtr /*pWin*/,
- int /* kind */);
-
-typedef void (* ChangeBorderWidthProcPtr)(
- WindowPtr /*pWin*/,
- unsigned int /*width*/);
-
-typedef void (* MarkUnrealizedWindowProcPtr)(
- WindowPtr /*pChild*/,
- WindowPtr /*pWin*/,
- Bool /*fromConfigure*/);
-
-#ifdef CreateWindow
-#undef CreateWindow
-#endif
-
-typedef Bool (* DeviceCursorInitializeProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /* pScreen */);
-
-typedef void (* DeviceCursorCleanupProcPtr)(
- DeviceIntPtr /* pDev */,
- ScreenPtr /* pScreen */);
-
-typedef struct _Screen {
- int myNum; /* index of this instance in Screens[] */
- ATOM id;
- short x, y, width, height;
- short mmWidth, mmHeight;
- short numDepths;
- unsigned char rootDepth;
- DepthPtr allowedDepths;
- unsigned long rootVisual;
- unsigned long defColormap;
- short minInstalledCmaps, maxInstalledCmaps;
- char backingStoreSupport, saveUnderSupport;
- unsigned long whitePixel, blackPixel;
- GCPtr GCperDepth[MAXFORMATS+1];
- /* next field is a stipple to use as default in
- a GC. we don't build default tiles of all depths
- because they are likely to be of a color
- different from the default fg pixel, so
- we don't win anything by building
- a standard one.
- */
- PixmapPtr PixmapPerDepth[1];
- pointer devPrivate;
- short numVisuals;
- VisualPtr visuals;
- WindowPtr root;
- ScreenSaverStuffRec screensaver;
-
- /* Random screen procedures */
-
- CloseScreenProcPtr CloseScreen;
- QueryBestSizeProcPtr QueryBestSize;
- SaveScreenProcPtr SaveScreen;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
-
- /* Window Procedures */
-
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- ValidateTreeProcPtr ValidateTree;
- PostValidateTreeProcPtr PostValidateTree;
- WindowExposuresProcPtr WindowExposures;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- ClipNotifyProcPtr ClipNotify;
- RestackWindowProcPtr RestackWindow;
-
- /* Pixmap procedures */
-
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
-
- /* Font procedures */
-
- RealizeFontProcPtr RealizeFont;
- UnrealizeFontProcPtr UnrealizeFont;
-
- /* Cursor Procedures */
-
- ConstrainCursorProcPtr ConstrainCursor;
- CursorLimitsProcPtr CursorLimits;
- DisplayCursorProcPtr DisplayCursor;
- RealizeCursorProcPtr RealizeCursor;
- UnrealizeCursorProcPtr UnrealizeCursor;
- RecolorCursorProcPtr RecolorCursor;
- SetCursorPositionProcPtr SetCursorPosition;
-
- /* GC procedures */
-
- CreateGCProcPtr CreateGC;
-
- /* Colormap procedures */
-
- CreateColormapProcPtr CreateColormap;
- DestroyColormapProcPtr DestroyColormap;
- InstallColormapProcPtr InstallColormap;
- UninstallColormapProcPtr UninstallColormap;
- ListInstalledColormapsProcPtr ListInstalledColormaps;
- StoreColorsProcPtr StoreColors;
- ResolveColorProcPtr ResolveColor;
-
- /* Region procedures */
-
- BitmapToRegionProcPtr BitmapToRegion;
- SendGraphicsExposeProcPtr SendGraphicsExpose;
-
- /* os layer procedures */
-
- ScreenBlockHandlerProcPtr BlockHandler;
- ScreenWakeupHandlerProcPtr WakeupHandler;
-
- pointer blockData;
- pointer wakeupData;
-
- /* anybody can get a piece of this array */
- PrivateRec *devPrivates;
-
- CreateScreenResourcesProcPtr CreateScreenResources;
- ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
-
- GetWindowPixmapProcPtr GetWindowPixmap;
- SetWindowPixmapProcPtr SetWindowPixmap;
- GetScreenPixmapProcPtr GetScreenPixmap;
- SetScreenPixmapProcPtr SetScreenPixmap;
-
- PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
-
- unsigned int totalPixmapSize;
-
- MarkWindowProcPtr MarkWindow;
- MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
- ConfigNotifyProcPtr ConfigNotify;
- MoveWindowProcPtr MoveWindow;
- ResizeWindowProcPtr ResizeWindow;
- GetLayerWindowProcPtr GetLayerWindow;
- HandleExposuresProcPtr HandleExposures;
- ReparentWindowProcPtr ReparentWindow;
-
- SetShapeProcPtr SetShape;
-
- ChangeBorderWidthProcPtr ChangeBorderWidth;
- MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
-
- /* Device cursor procedures */
- DeviceCursorInitializeProcPtr DeviceCursorInitialize;
- DeviceCursorCleanupProcPtr DeviceCursorCleanup;
-
- /* set it in driver side if X server can copy the framebuffer content.
- * Meant to be used together with '-background none' option, avoiding
- * malicious users to steal framebuffer's content if that would be the
- * default */
- Bool canDoBGNoneRoot;
-} ScreenRec;
-
-static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) {
- return (*(_pScreen)->BitmapToRegion)(pPix); /* no mi version?! */
-}
-
-typedef struct _ScreenInfo {
- int imageByteOrder;
- int bitmapScanlineUnit;
- int bitmapScanlinePad;
- int bitmapBitOrder;
- int numPixmapFormats;
- PixmapFormatRec
- formats[MAXFORMATS];
- int numScreens;
- ScreenPtr screens[MAXSCREENS];
-} ScreenInfo;
-
-extern _X_EXPORT ScreenInfo screenInfo;
-
-extern _X_EXPORT void InitOutput(
- ScreenInfo * /*pScreenInfo*/,
- int /*argc*/,
- char ** /*argv*/);
-
-#endif /* SCREENINTSTRUCT_H */
+/***********************************************************
+
+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.
+
+******************************************************************/
+
+#ifndef SCREENINTSTRUCT_H
+#define SCREENINTSTRUCT_H
+
+#include "screenint.h"
+#include "regionstr.h"
+#include "colormap.h"
+#include "cursor.h"
+#include "validate.h"
+#include <X11/Xproto.h>
+#include "dix.h"
+#include "privates.h"
+
+typedef struct _PixmapFormat {
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ unsigned char scanlinePad;
+ } PixmapFormatRec;
+
+typedef struct _Visual {
+ VisualID vid;
+ short class;
+ short bitsPerRGBValue;
+ long ColormapEntries;
+ short nplanes;/* = log2 (ColormapEntries). This does not
+ * imply that the screen has this many planes.
+ * it may have more or fewer */
+ unsigned long redMask, greenMask, blueMask;
+ int offsetRed, offsetGreen, offsetBlue;
+ } VisualRec;
+
+typedef struct _Depth {
+ unsigned char depth;
+ short numVids;
+ VisualID *vids; /* block of visual ids for this depth */
+ } DepthRec;
+
+typedef struct _ScreenSaverStuff {
+ WindowPtr pWindow;
+ XID wid;
+ char blanked;
+ Bool (*ExternalScreenSaver)(
+ ScreenPtr /*pScreen*/,
+ int /*xstate*/,
+ Bool /*force*/);
+} ScreenSaverStuffRec;
+
+
+/*
+ * There is a typedef for each screen function pointer so that code that
+ * needs to declare a screen function pointer (e.g. in a screen private
+ * or as a local variable) can easily do so and retain full type checking.
+ */
+
+typedef Bool (* CloseScreenProcPtr)(
+ int /*index*/,
+ ScreenPtr /*pScreen*/);
+
+typedef void (* QueryBestSizeProcPtr)(
+ int /*class*/,
+ unsigned short * /*pwidth*/,
+ unsigned short * /*pheight*/,
+ ScreenPtr /*pScreen*/);
+
+typedef Bool (* SaveScreenProcPtr)(
+ ScreenPtr /*pScreen*/,
+ int /*on*/);
+
+typedef void (* GetImageProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*sx*/,
+ int /*sy*/,
+ int /*w*/,
+ int /*h*/,
+ unsigned int /*format*/,
+ unsigned long /*planeMask*/,
+ char * /*pdstLine*/);
+
+typedef void (* GetSpansProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*wMax*/,
+ DDXPointPtr /*ppt*/,
+ int* /*pwidth*/,
+ int /*nspans*/,
+ char * /*pdstStart*/);
+
+typedef void (* SourceValidateProcPtr)(
+ DrawablePtr /*pDrawable*/,
+ int /*x*/,
+ int /*y*/,
+ int /*width*/,
+ int /*height*/,
+ unsigned int /*subWindowMode*/);
+
+typedef Bool (* CreateWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* DestroyWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* PositionWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/);
+
+typedef Bool (* ChangeWindowAttributesProcPtr)(
+ WindowPtr /*pWindow*/,
+ unsigned long /*mask*/);
+
+typedef Bool (* RealizeWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef Bool (* UnrealizeWindowProcPtr)(
+ WindowPtr /*pWindow*/);
+
+typedef void (* RestackWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ WindowPtr /*pOldNextSib*/);
+
+typedef int (* ValidateTreeProcPtr)(
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/);
+
+typedef void (* PostValidateTreeProcPtr)(
+ WindowPtr /*pParent*/,
+ WindowPtr /*pChild*/,
+ VTKind /*kind*/);
+
+typedef void (* WindowExposuresProcPtr)(
+ WindowPtr /*pWindow*/,
+ RegionPtr /*prgn*/,
+ RegionPtr /*other_exposed*/);
+
+typedef void (* CopyWindowProcPtr)(
+ WindowPtr /*pWindow*/,
+ DDXPointRec /*ptOldOrg*/,
+ RegionPtr /*prgnSrc*/);
+
+typedef void (* ClearToBackgroundProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ Bool /*generateExposures*/);
+
+typedef void (* ClipNotifyProcPtr)(
+ WindowPtr /*pWindow*/,
+ int /*dx*/,
+ int /*dy*/);
+
+/* pixmap will exist only for the duration of the current rendering operation */
+#define CREATE_PIXMAP_USAGE_SCRATCH 1
+/* pixmap will be the backing pixmap for a redirected window */
+#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
+/* pixmap will contain a glyph */
+#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
+
+typedef PixmapPtr (* CreatePixmapProcPtr)(
+ ScreenPtr /*pScreen*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ unsigned /*usage_hint*/);
+
+typedef Bool (* DestroyPixmapProcPtr)(
+ PixmapPtr /*pPixmap*/);
+
+typedef Bool (* RealizeFontProcPtr)(
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/);
+
+typedef Bool (* UnrealizeFontProcPtr)(
+ ScreenPtr /*pScreen*/,
+ FontPtr /*pFont*/);
+
+typedef void (* ConstrainCursorProcPtr)(
+ DeviceIntPtr /*pDev*/,
+ ScreenPtr /*pScreen*/,
+ BoxPtr /*pBox*/);
+
+typedef void (* CursorLimitsProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ BoxPtr /*pHotBox*/,
+ BoxPtr /*pTopLeftBox*/);
+
+typedef Bool (* DisplayCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef Bool (* RealizeCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef Bool (* UnrealizeCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/);
+
+typedef void (* RecolorCursorProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ CursorPtr /*pCursor*/,
+ Bool /*displayed*/);
+
+typedef Bool (* SetCursorPositionProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /*pScreen*/,
+ int /*x*/,
+ int /*y*/,
+ Bool /*generateEvent*/);
+
+typedef Bool (* CreateGCProcPtr)(
+ GCPtr /*pGC*/);
+
+typedef Bool (* CreateColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* DestroyColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* InstallColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef void (* UninstallColormapProcPtr)(
+ ColormapPtr /*pColormap*/);
+
+typedef int (* ListInstalledColormapsProcPtr) (
+ ScreenPtr /*pScreen*/,
+ XID* /*pmaps */);
+
+typedef void (* StoreColorsProcPtr)(
+ ColormapPtr /*pColormap*/,
+ int /*ndef*/,
+ xColorItem * /*pdef*/);
+
+typedef void (* ResolveColorProcPtr)(
+ unsigned short* /*pred*/,
+ unsigned short* /*pgreen*/,
+ unsigned short* /*pblue*/,
+ VisualPtr /*pVisual*/);
+
+typedef RegionPtr (* BitmapToRegionProcPtr)(
+ PixmapPtr /*pPix*/);
+
+typedef void (* SendGraphicsExposeProcPtr)(
+ ClientPtr /*client*/,
+ RegionPtr /*pRgn*/,
+ XID /*drawable*/,
+ int /*major*/,
+ int /*minor*/);
+
+typedef void (* ScreenBlockHandlerProcPtr)(
+ int /*screenNum*/,
+ pointer /*blockData*/,
+ pointer /*pTimeout*/,
+ pointer /*pReadmask*/);
+
+typedef void (* ScreenWakeupHandlerProcPtr)(
+ int /*screenNum*/,
+ pointer /*wakeupData*/,
+ unsigned long /*result*/,
+ pointer /*pReadMask*/);
+
+typedef Bool (* CreateScreenResourcesProcPtr)(
+ ScreenPtr /*pScreen*/);
+
+typedef Bool (* ModifyPixmapHeaderProcPtr)(
+ PixmapPtr /*pPixmap*/,
+ int /*width*/,
+ int /*height*/,
+ int /*depth*/,
+ int /*bitsPerPixel*/,
+ int /*devKind*/,
+ pointer /*pPixData*/);
+
+typedef PixmapPtr (* GetWindowPixmapProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef void (* SetWindowPixmapProcPtr)(
+ WindowPtr /*pWin*/,
+ PixmapPtr /*pPix*/);
+
+typedef PixmapPtr (* GetScreenPixmapProcPtr)(
+ ScreenPtr /*pScreen*/);
+
+typedef void (* SetScreenPixmapProcPtr)(
+ PixmapPtr /*pPix*/);
+
+typedef void (* MarkWindowProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef Bool (* MarkOverlappedWindowsProcPtr)(
+ WindowPtr /*parent*/,
+ WindowPtr /*firstChild*/,
+ WindowPtr * /*pLayerWin*/);
+
+typedef int (* ConfigNotifyProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ int /*w*/,
+ int /*h*/,
+ int /*bw*/,
+ WindowPtr /*pSib*/);
+
+typedef void (* MoveWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ WindowPtr /*pSib*/,
+ VTKind /*kind*/);
+
+typedef void (* ResizeWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ int /*x*/,
+ int /*y*/,
+ unsigned int /*w*/,
+ unsigned int /*h*/,
+ WindowPtr /*pSib*/
+);
+
+typedef WindowPtr (* GetLayerWindowProcPtr)(
+ WindowPtr /*pWin*/
+);
+
+typedef void (* HandleExposuresProcPtr)(
+ WindowPtr /*pWin*/);
+
+typedef void (* ReparentWindowProcPtr)(
+ WindowPtr /*pWin*/,
+ WindowPtr /*pPriorParent*/);
+
+typedef void (* SetShapeProcPtr)(
+ WindowPtr /*pWin*/,
+ int /* kind */);
+
+typedef void (* ChangeBorderWidthProcPtr)(
+ WindowPtr /*pWin*/,
+ unsigned int /*width*/);
+
+typedef void (* MarkUnrealizedWindowProcPtr)(
+ WindowPtr /*pChild*/,
+ WindowPtr /*pWin*/,
+ Bool /*fromConfigure*/);
+
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
+typedef Bool (* DeviceCursorInitializeProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /* pScreen */);
+
+typedef void (* DeviceCursorCleanupProcPtr)(
+ DeviceIntPtr /* pDev */,
+ ScreenPtr /* pScreen */);
+
+typedef void (*ConstrainCursorHarderProcPtr)(
+ DeviceIntPtr, ScreenPtr, int *, int *);
+
+typedef struct _Screen {
+ int myNum; /* index of this instance in Screens[] */
+ ATOM id;
+ short x, y, width, height;
+ short mmWidth, mmHeight;
+ short numDepths;
+ unsigned char rootDepth;
+ DepthPtr allowedDepths;
+ unsigned long rootVisual;
+ unsigned long defColormap;
+ short minInstalledCmaps, maxInstalledCmaps;
+ char backingStoreSupport, saveUnderSupport;
+ unsigned long whitePixel, blackPixel;
+ GCPtr GCperDepth[MAXFORMATS+1];
+ /* next field is a stipple to use as default in
+ a GC. we don't build default tiles of all depths
+ because they are likely to be of a color
+ different from the default fg pixel, so
+ we don't win anything by building
+ a standard one.
+ */
+ PixmapPtr PixmapPerDepth[1];
+ pointer devPrivate;
+ short numVisuals;
+ VisualPtr visuals;
+ WindowPtr root;
+ ScreenSaverStuffRec screensaver;
+
+ /* Random screen procedures */
+
+ CloseScreenProcPtr CloseScreen;
+ QueryBestSizeProcPtr QueryBestSize;
+ SaveScreenProcPtr SaveScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+
+ /* Window Procedures */
+
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+
+ /* Pixmap procedures */
+
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+
+ /* Font procedures */
+
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+
+ /* Cursor Procedures */
+
+ ConstrainCursorProcPtr ConstrainCursor;
+ ConstrainCursorHarderProcPtr ConstrainCursorHarder;
+ CursorLimitsProcPtr CursorLimits;
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ UnrealizeCursorProcPtr UnrealizeCursor;
+ RecolorCursorProcPtr RecolorCursor;
+ SetCursorPositionProcPtr SetCursorPosition;
+
+ /* GC procedures */
+
+ CreateGCProcPtr CreateGC;
+
+ /* Colormap procedures */
+
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ ListInstalledColormapsProcPtr ListInstalledColormaps;
+ StoreColorsProcPtr StoreColors;
+ ResolveColorProcPtr ResolveColor;
+
+ /* Region procedures */
+
+ BitmapToRegionProcPtr BitmapToRegion;
+ SendGraphicsExposeProcPtr SendGraphicsExpose;
+
+ /* os layer procedures */
+
+ ScreenBlockHandlerProcPtr BlockHandler;
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+
+ pointer blockData;
+ pointer wakeupData;
+
+ /* anybody can get a piece of this array */
+ PrivateRec *devPrivates;
+
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
+
+ GetWindowPixmapProcPtr GetWindowPixmap;
+ SetWindowPixmapProcPtr SetWindowPixmap;
+ GetScreenPixmapProcPtr GetScreenPixmap;
+ SetScreenPixmapProcPtr SetScreenPixmap;
+
+ PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
+
+ unsigned int totalPixmapSize;
+
+ MarkWindowProcPtr MarkWindow;
+ MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
+ ConfigNotifyProcPtr ConfigNotify;
+ MoveWindowProcPtr MoveWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ GetLayerWindowProcPtr GetLayerWindow;
+ HandleExposuresProcPtr HandleExposures;
+ ReparentWindowProcPtr ReparentWindow;
+
+ SetShapeProcPtr SetShape;
+
+ ChangeBorderWidthProcPtr ChangeBorderWidth;
+ MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
+
+ /* Device cursor procedures */
+ DeviceCursorInitializeProcPtr DeviceCursorInitialize;
+ DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ /* set it in driver side if X server can copy the framebuffer content.
+ * Meant to be used together with '-background none' option, avoiding
+ * malicious users to steal framebuffer's content if that would be the
+ * default */
+ Bool canDoBGNoneRoot;
+} ScreenRec;
+
+static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) {
+ return (*(_pScreen)->BitmapToRegion)(pPix); /* no mi version?! */
+}
+
+typedef struct _ScreenInfo {
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numPixmapFormats;
+ PixmapFormatRec
+ formats[MAXFORMATS];
+ int numScreens;
+ ScreenPtr screens[MAXSCREENS];
+} ScreenInfo;
+
+extern _X_EXPORT ScreenInfo screenInfo;
+
+extern _X_EXPORT void InitOutput(
+ ScreenInfo * /*pScreenInfo*/,
+ int /*argc*/,
+ char ** /*argv*/);
+
+#endif /* SCREENINTSTRUCT_H */
diff --git a/xorg-server/manpages.am b/xorg-server/manpages.am
new file mode 100644
index 000000000..69ee0054d
--- /dev/null
+++ b/xorg-server/manpages.am
@@ -0,0 +1,37 @@
+appmandir = $(APP_MAN_DIR)
+#appman_PRE = list of application man page files set by calling Makefile.am
+appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
+
+drivermandir = $(DRIVER_MAN_DIR)
+#driverman_PRE = list of driver man page files set by calling Makefile.am
+driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
+
+filemandir = $(FILE_MAN_DIR)
+#fileman_PRE = list of file man page files set by calling Makefile.am
+fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX))
+
+# The calling Makefile should only contain man page targets
+# Otherwise the following three global variables may conflict
+EXTRA_DIST = $(appman_PRE) $(driverman_PRE) $(fileman_PRE)
+CLEANFILES = $(appman_DATA) $(driverman_DATA) $(fileman_DATA)
+SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man
+
+# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS
+# 's|/,|/, |g' will add a space to help font path formatting
+MAN_SUBSTS += -e 's|__logdir__|$(logdir)|g' \
+ -e 's|__datadir__|$(datadir)|g' \
+ -e 's|__mandir__|$(mandir)|g' \
+ -e 's|__sysconfdir__|$(sysconfdir)|g' \
+ -e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \
+ -e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \
+ -e 's|__laucnd_id_prefix__|$(LAUNCHD_ID_PREFIX)|g' \
+ -e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \
+ -e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \
+ -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'
+
+.man.$(APP_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+.man.$(DRIVER_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+.man.$(FILE_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c
index b4b346813..d792dedb1 100644
--- a/xorg-server/xkb/ddxLoad.c
+++ b/xorg-server/xkb/ddxLoad.c
@@ -1,467 +1,463 @@
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-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 Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS 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 <xkb-config.h>
-
-#include <stdio.h>
-#include <ctype.h>
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include <X11/extensions/XKM.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#define XKBSRV_NEED_FILE_FUNCS
-#include <xkbsrv.h>
-#include <X11/extensions/XI.h>
-#include "xkb.h"
-
-#if defined(CSRG_BASED) || defined(linux) || defined(__GNU__)
-#include <paths.h>
-#endif
-
- /*
- * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
- * relative to the top-level XKB configuration directory.
- * Making the server write to a subdirectory of that directory
- * requires some work in the general case (install procedure
- * has to create links to /var or somesuch on many machines),
- * so we just compile into /usr/tmp for now.
- */
-#ifndef XKM_OUTPUT_DIR
-#define XKM_OUTPUT_DIR "compiled/"
-#endif
-
-#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
-#define ERROR_PREFIX "\"> \""
-#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
-#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\""
-
-#if defined(WIN32)
-#define PATHSEPARATOR "\\"
-#else
-#define PATHSEPARATOR "/"
-#endif
-
-#ifdef WIN32
-
-#include <X11/Xwindows.h>
-const char*
-Win32TempDir()
-{
- static char buffer[PATH_MAX];
- if (GetTempPath(sizeof(buffer), buffer))
- {
- int len;
- buffer[sizeof(buffer)-1] = 0;
- len = strlen(buffer);
- if (len > 0)
- if (buffer[len-1] == '\\')
- buffer[len-1] = 0;
- return buffer;
- }
- if (getenv("TEMP") != NULL)
- return getenv("TEMP");
- else if (getenv("TMP") != NULL)
- return getenv("TEMP");
- else
- return "/tmp";
-}
-
-int
-Win32System(const char *cmdline)
-{
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- DWORD dwExitCode;
- char *cmd = strdup(cmdline);
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
- {
- LPVOID buffer;
- if (!FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &buffer,
- 0,
- NULL ))
- {
- ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
- }
- else
- {
- ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *)buffer);
- LocalFree(buffer);
- }
-
- free(cmd);
- return -1;
- }
- /* Wait until child process exits. */
- WaitForSingleObject( pi.hProcess, INFINITE );
-
- GetExitCodeProcess( pi.hProcess, &dwExitCode);
-
- /* Close process and thread handles. */
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
- free(cmd);
-
- return dwExitCode;
-}
-#undef System
-#define System(x) Win32System(x)
-#endif
-
-static void
-OutputDirectory(
- char* outdir,
- size_t size)
-{
-#ifndef WIN32
- /* Can we write an xkm and then open it too? */
- if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size))
- {
- (void) strcpy (outdir, XKM_OUTPUT_DIR);
- } else
-#else
- if (strlen(Win32TempDir()) + 1 < size)
- {
- (void) strcpy(outdir, Win32TempDir());
- (void) strcat(outdir, "\\");
- } else
-#endif
- if (strlen("/tmp/") < size)
- {
- (void) strcpy (outdir, "/tmp/");
- }
-}
-
-static Bool
-XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- char * nameRtrn,
- int nameRtrnLen)
-{
- FILE * out;
- char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
-
- const char *emptystring = "";
- char *xkbbasedirflag = NULL;
- const char *xkbbindir = emptystring;
- const char *xkbbindirsep = emptystring;
-
-#ifdef WIN32
- /* WIN32 has no popen. The input must be stored in a file which is
- used as input for xkbcomp. xkbcomp does not read from stdin. */
- char tmpname[PATH_MAX];
- const char *xkmfile = tmpname;
-#else
- const char *xkmfile = "-";
-#endif
-
- snprintf(keymap, sizeof(keymap), "server-%s", display);
-
- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
-
-#ifdef WIN32
- strcpy(tmpname, Win32TempDir());
- strcat(tmpname, "\\xkb_XXXXXX");
- (void) mktemp(tmpname);
-#endif
-
- if (XkbBaseDirectory != NULL) {
- if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1)
- xkbbasedirflag = NULL;
- }
-
- if (XkbBinDirectory != NULL) {
- int ld = strlen(XkbBinDirectory);
- int lps = strlen(PATHSEPARATOR);
-
- xkbbindir = XkbBinDirectory;
-
- if ((ld >= lps) &&
- (strcmp(xkbbindir + ld - lps, PATHSEPARATOR) != 0)) {
- xkbbindirsep = PATHSEPARATOR;
- }
- }
-
- if (asprintf(&buf,
- "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
- xkbbindir, xkbbindirsep,
- ((xkbDebugFlags < 2) ? 1 :
- ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)),
- xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
- PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
- xkm_output_dir, keymap) == -1)
- buf = NULL;
-
- free(xkbbasedirflag);
-
- if (!buf) {
- LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n");
- return FALSE;
- }
-
-#ifndef WIN32
- out= Popen(buf,"w");
-#else
- out= fopen(tmpname, "w");
-#endif
-
- if (out!=NULL) {
-#ifdef DEBUG
- if (xkbDebugFlags) {
- ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
- XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
- }
-#endif
- XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
-#ifndef WIN32
- if (Pclose(out)==0)
-#else
- if (fclose(out)==0 && System(buf) >= 0)
-#endif
- {
- if (xkbDebugFlags)
- DebugF("[xkb] xkb executes: %s\n",buf);
- if (nameRtrn) {
- strncpy(nameRtrn,keymap,nameRtrnLen);
- nameRtrn[nameRtrnLen-1]= '\0';
- }
- free(buf);
-#ifdef WIN32
- /* remove the temporary file */
- unlink(tmpname);
-#endif
- return TRUE;
- }
- else
- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
-#ifdef WIN32
- /* remove the temporary file */
- unlink(tmpname);
-#endif
- }
- else {
-#ifndef WIN32
- LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n");
-#else
- LogMessage(X_ERROR, "Could not open file %s\n", tmpname);
-#endif
- }
- if (nameRtrn)
- nameRtrn[0]= '\0';
- free(buf);
- return FALSE;
-}
-
-static FILE *
-XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen)
-{
-char buf[PATH_MAX],xkm_output_dir[PATH_MAX];
-FILE * file;
-
- buf[0]= '\0';
- if (mapName!=NULL) {
- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
- if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/')
-#ifdef WIN32
- &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':')
-#endif
- ) {
- if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir)
- +strlen(mapName)+6 <= PATH_MAX)
- {
- sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory,
- xkm_output_dir,mapName);
- }
- }
- else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX)
- sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName);
- if (buf[0] != '\0')
- file= fopen(buf,"rb");
- else file= NULL;
- }
- else file= NULL;
- if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) {
- strncpy(fileNameRtrn,buf,fileNameRtrnLen);
- buf[fileNameRtrnLen-1]= '\0';
- }
- return file;
-}
-
-unsigned
-XkbDDXLoadKeymapByNames( DeviceIntPtr keybd,
- XkbComponentNamesPtr names,
- unsigned want,
- unsigned need,
- XkbDescPtr * xkbRtrn,
- char * nameRtrn,
- int nameRtrnLen)
-{
-XkbDescPtr xkb;
-FILE * file;
-char fileName[PATH_MAX];
-unsigned missing;
-
- *xkbRtrn = NULL;
- if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL))
- xkb= NULL;
- else xkb= keybd->key->xkbInfo->desc;
- if ((names->keycodes==NULL)&&(names->types==NULL)&&
- (names->compat==NULL)&&(names->symbols==NULL)&&
- (names->geometry==NULL)) {
- LogMessage(X_ERROR, "XKB: No components provided for device %s\n",
- keybd->name ? keybd->name : "(unnamed keyboard)");
- return 0;
- }
- else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
- nameRtrn,nameRtrnLen)){
- LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n");
- return 0;
- }
- file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
- if (file==NULL) {
- LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName);
- return 0;
- }
- missing= XkmReadFile(file,need,want,xkbRtrn);
- if (*xkbRtrn==NULL) {
- LogMessage(X_ERROR, "Error loading keymap %s\n",fileName);
- fclose(file);
- (void) unlink (fileName);
- return 0;
- }
- else {
- DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
- }
- fclose(file);
- (void) unlink (fileName);
- return (need|want)&(~missing);
-}
-
-Bool
-XkbDDXNamesFromRules( DeviceIntPtr keybd,
- char * rules_name,
- XkbRF_VarDefsPtr defs,
- XkbComponentNamesPtr names)
-{
-char buf[PATH_MAX];
-FILE * file;
-Bool complete;
-XkbRF_RulesPtr rules;
-
- if (!rules_name)
- return FALSE;
-
- if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) {
- LogMessage(X_ERROR, "XKB: Rules name is too long\n");
- return FALSE;
- }
- sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name);
-
- file = fopen(buf, "r");
- if (!file) {
- LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf);
- return FALSE;
- }
-
- rules = XkbRF_Create();
- if (!rules) {
- LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n");
- fclose(file);
- return FALSE;
- }
-
- if (!XkbRF_LoadRules(file, rules)) {
- LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name);
- fclose(file);
- XkbRF_Free(rules,TRUE);
- return FALSE;
- }
-
- memset(names, 0, sizeof(*names));
- complete = XkbRF_GetComponents(rules,defs,names);
- fclose(file);
- XkbRF_Free(rules, TRUE);
-
- if (!complete)
- LogMessage(X_ERROR, "XKB: Rules returned no components\n");
-
- return complete;
-}
-
-XkbDescPtr
-XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo)
-{
- XkbComponentNamesRec kccgst;
- XkbRF_VarDefsRec mlvo;
- XkbDescPtr xkb;
- char name[PATH_MAX];
-
- if (!dev || !rmlvo) {
- LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n");
- return NULL;
- }
-
- mlvo.model = rmlvo->model;
- mlvo.layout = rmlvo->layout;
- mlvo.variant = rmlvo->variant;
- mlvo.options = rmlvo->options;
-
- /* XDNFR already logs for us. */
- if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst))
- return NULL;
-
- /* XDLKBN too, but it might return 0 as well as allocating. */
- if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name,
- PATH_MAX)) {
- if (xkb)
- XkbFreeKeyboard(xkb, 0, TRUE);
- return NULL;
- }
-
- return xkb;
-}
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+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 Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS 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 <xkb-config.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <X11/X.h>
+#include <X11/Xos.h>
+#include <X11/Xproto.h>
+#include <X11/keysym.h>
+#include <X11/extensions/XKM.h>
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#define XKBSRV_NEED_FILE_FUNCS
+#include <xkbsrv.h>
+#include <X11/extensions/XI.h>
+#include "xkb.h"
+
+ /*
+ * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
+ * relative to the top-level XKB configuration directory.
+ * Making the server write to a subdirectory of that directory
+ * requires some work in the general case (install procedure
+ * has to create links to /var or somesuch on many machines),
+ * so we just compile into /usr/tmp for now.
+ */
+#ifndef XKM_OUTPUT_DIR
+#define XKM_OUTPUT_DIR "compiled/"
+#endif
+
+#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
+#define ERROR_PREFIX "\"> \""
+#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\""
+#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\""
+
+#if defined(WIN32)
+#define PATHSEPARATOR "\\"
+#else
+#define PATHSEPARATOR "/"
+#endif
+
+#ifdef WIN32
+
+#include <X11/Xwindows.h>
+const char*
+Win32TempDir()
+{
+ static char buffer[PATH_MAX];
+ if (GetTempPath(sizeof(buffer), buffer))
+ {
+ int len;
+ buffer[sizeof(buffer)-1] = 0;
+ len = strlen(buffer);
+ if (len > 0)
+ if (buffer[len-1] == '\\')
+ buffer[len-1] = 0;
+ return buffer;
+ }
+ if (getenv("TEMP") != NULL)
+ return getenv("TEMP");
+ else if (getenv("TMP") != NULL)
+ return getenv("TEMP");
+ else
+ return "/tmp";
+}
+
+int
+Win32System(const char *cmdline)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ DWORD dwExitCode;
+ char *cmd = strdup(cmdline);
+
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+
+ if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
+ {
+ LPVOID buffer;
+ if (!FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &buffer,
+ 0,
+ NULL ))
+ {
+ ErrorF("[xkb] Starting '%s' failed!\n", cmdline);
+ }
+ else
+ {
+ ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *)buffer);
+ LocalFree(buffer);
+ }
+
+ free(cmd);
+ return -1;
+ }
+ /* Wait until child process exits. */
+ WaitForSingleObject( pi.hProcess, INFINITE );
+
+ GetExitCodeProcess( pi.hProcess, &dwExitCode);
+
+ /* Close process and thread handles. */
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+ free(cmd);
+
+ return dwExitCode;
+}
+#undef System
+#define System(x) Win32System(x)
+#endif
+
+static void
+OutputDirectory(
+ char* outdir,
+ size_t size)
+{
+#ifndef WIN32
+ /* Can we write an xkm and then open it too? */
+ if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size))
+ {
+ (void) strcpy (outdir, XKM_OUTPUT_DIR);
+ } else
+#else
+ if (strlen(Win32TempDir()) + 1 < size)
+ {
+ (void) strcpy(outdir, Win32TempDir());
+ (void) strcat(outdir, "\\");
+ } else
+#endif
+ if (strlen("/tmp/") < size)
+ {
+ (void) strcpy (outdir, "/tmp/");
+ }
+}
+
+static Bool
+XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
+ XkbComponentNamesPtr names,
+ unsigned want,
+ unsigned need,
+ char * nameRtrn,
+ int nameRtrnLen)
+{
+ FILE * out;
+ char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX];
+
+ const char *emptystring = "";
+ char *xkbbasedirflag = NULL;
+ const char *xkbbindir = emptystring;
+ const char *xkbbindirsep = emptystring;
+
+#ifdef WIN32
+ /* WIN32 has no popen. The input must be stored in a file which is
+ used as input for xkbcomp. xkbcomp does not read from stdin. */
+ char tmpname[PATH_MAX];
+ const char *xkmfile = tmpname;
+#else
+ const char *xkmfile = "-";
+#endif
+
+ snprintf(keymap, sizeof(keymap), "server-%s", display);
+
+ OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
+
+#ifdef WIN32
+ strcpy(tmpname, Win32TempDir());
+ strcat(tmpname, "\\xkb_XXXXXX");
+ (void) mktemp(tmpname);
+#endif
+
+ if (XkbBaseDirectory != NULL) {
+ if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1)
+ xkbbasedirflag = NULL;
+ }
+
+ if (XkbBinDirectory != NULL) {
+ int ld = strlen(XkbBinDirectory);
+ int lps = strlen(PATHSEPARATOR);
+
+ xkbbindir = XkbBinDirectory;
+
+ if ((ld >= lps) &&
+ (strcmp(xkbbindir + ld - lps, PATHSEPARATOR) != 0)) {
+ xkbbindirsep = PATHSEPARATOR;
+ }
+ }
+
+ if (asprintf(&buf,
+ "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
+ "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
+ xkbbindir, xkbbindirsep,
+ ((xkbDebugFlags < 2) ? 1 :
+ ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)),
+ xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
+ PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
+ xkm_output_dir, keymap) == -1)
+ buf = NULL;
+
+ free(xkbbasedirflag);
+
+ if (!buf) {
+ LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n");
+ return FALSE;
+ }
+
+#ifndef WIN32
+ out= Popen(buf,"w");
+#else
+ out= fopen(tmpname, "w");
+#endif
+
+ if (out!=NULL) {
+#ifdef DEBUG
+ if (xkbDebugFlags) {
+ ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n");
+ XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need);
+ }
+#endif
+ XkbWriteXKBKeymapForNames(out,names,xkb,want,need);
+#ifndef WIN32
+ if (Pclose(out)==0)
+#else
+ if (fclose(out)==0 && System(buf) >= 0)
+#endif
+ {
+ if (xkbDebugFlags)
+ DebugF("[xkb] xkb executes: %s\n",buf);
+ if (nameRtrn) {
+ strncpy(nameRtrn,keymap,nameRtrnLen);
+ nameRtrn[nameRtrnLen-1]= '\0';
+ }
+ free(buf);
+#ifdef WIN32
+ /* remove the temporary file */
+ unlink(tmpname);
+#endif
+ return TRUE;
+ }
+ else
+ LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
+#ifdef WIN32
+ /* remove the temporary file */
+ unlink(tmpname);
+#endif
+ }
+ else {
+#ifndef WIN32
+ LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n");
+#else
+ LogMessage(X_ERROR, "Could not open file %s\n", tmpname);
+#endif
+ }
+ if (nameRtrn)
+ nameRtrn[0]= '\0';
+ free(buf);
+ return FALSE;
+}
+
+static FILE *
+XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen)
+{
+char buf[PATH_MAX],xkm_output_dir[PATH_MAX];
+FILE * file;
+
+ buf[0]= '\0';
+ if (mapName!=NULL) {
+ OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
+ if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/')
+#ifdef WIN32
+ &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':')
+#endif
+ ) {
+ if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir)
+ +strlen(mapName)+6 <= PATH_MAX)
+ {
+ sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory,
+ xkm_output_dir,mapName);
+ }
+ }
+ else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX)
+ sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName);
+ if (buf[0] != '\0')
+ file= fopen(buf,"rb");
+ else file= NULL;
+ }
+ else file= NULL;
+ if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) {
+ strncpy(fileNameRtrn,buf,fileNameRtrnLen);
+ buf[fileNameRtrnLen-1]= '\0';
+ }
+ return file;
+}
+
+unsigned
+XkbDDXLoadKeymapByNames( DeviceIntPtr keybd,
+ XkbComponentNamesPtr names,
+ unsigned want,
+ unsigned need,
+ XkbDescPtr * xkbRtrn,
+ char * nameRtrn,
+ int nameRtrnLen)
+{
+XkbDescPtr xkb;
+FILE * file;
+char fileName[PATH_MAX];
+unsigned missing;
+
+ *xkbRtrn = NULL;
+ if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL))
+ xkb= NULL;
+ else xkb= keybd->key->xkbInfo->desc;
+ if ((names->keycodes==NULL)&&(names->types==NULL)&&
+ (names->compat==NULL)&&(names->symbols==NULL)&&
+ (names->geometry==NULL)) {
+ LogMessage(X_ERROR, "XKB: No components provided for device %s\n",
+ keybd->name ? keybd->name : "(unnamed keyboard)");
+ return 0;
+ }
+ else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
+ nameRtrn,nameRtrnLen)){
+ LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n");
+ return 0;
+ }
+ file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
+ if (file==NULL) {
+ LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName);
+ return 0;
+ }
+ missing= XkmReadFile(file,need,want,xkbRtrn);
+ if (*xkbRtrn==NULL) {
+ LogMessage(X_ERROR, "Error loading keymap %s\n",fileName);
+ fclose(file);
+ (void) unlink (fileName);
+ return 0;
+ }
+ else {
+ DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
+ }
+ fclose(file);
+ (void) unlink (fileName);
+ return (need|want)&(~missing);
+}
+
+Bool
+XkbDDXNamesFromRules( DeviceIntPtr keybd,
+ char * rules_name,
+ XkbRF_VarDefsPtr defs,
+ XkbComponentNamesPtr names)
+{
+char buf[PATH_MAX];
+FILE * file;
+Bool complete;
+XkbRF_RulesPtr rules;
+
+ if (!rules_name)
+ return FALSE;
+
+ if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) {
+ LogMessage(X_ERROR, "XKB: Rules name is too long\n");
+ return FALSE;
+ }
+ sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name);
+
+ file = fopen(buf, "r");
+ if (!file) {
+ LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf);
+ return FALSE;
+ }
+
+ rules = XkbRF_Create();
+ if (!rules) {
+ LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n");
+ fclose(file);
+ return FALSE;
+ }
+
+ if (!XkbRF_LoadRules(file, rules)) {
+ LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name);
+ fclose(file);
+ XkbRF_Free(rules,TRUE);
+ return FALSE;
+ }
+
+ memset(names, 0, sizeof(*names));
+ complete = XkbRF_GetComponents(rules,defs,names);
+ fclose(file);
+ XkbRF_Free(rules, TRUE);
+
+ if (!complete)
+ LogMessage(X_ERROR, "XKB: Rules returned no components\n");
+
+ return complete;
+}
+
+XkbDescPtr
+XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo)
+{
+ XkbComponentNamesRec kccgst;
+ XkbRF_VarDefsRec mlvo;
+ XkbDescPtr xkb;
+ char name[PATH_MAX];
+
+ if (!dev || !rmlvo) {
+ LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n");
+ return NULL;
+ }
+
+ mlvo.model = rmlvo->model;
+ mlvo.layout = rmlvo->layout;
+ mlvo.variant = rmlvo->variant;
+ mlvo.options = rmlvo->options;
+
+ /* XDNFR already logs for us. */
+ if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst))
+ return NULL;
+
+ /* XDLKBN too, but it might return 0 as well as allocating. */
+ if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name,
+ PATH_MAX)) {
+ if (xkb)
+ XkbFreeKeyboard(xkb, 0, TRUE);
+ return NULL;
+ }
+
+ return xkb;
+}