From 06b805d97211a664ebd6a1ec345d9dcd43fdbbde Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Nov 02 2007 17:11:11 +0000 Subject: * Fri Nov 02 2007 Adam Jackson 1.4.99.1-0.6 - Merge a bunch of the more trivial patches upstream. - New git snapshot containing the merged bits. - Remove unused patches. - Drop the XFree86 obsoletes. --- diff --git a/xorg-x11-server-0.99.3-init-origins-fix.patch b/xorg-x11-server-0.99.3-init-origins-fix.patch deleted file mode 100644 index bf472db..0000000 --- a/xorg-x11-server-0.99.3-init-origins-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Kristian Høgsberg -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Fix crash in xf86InitOrigins() - -In a multihead setup, if only the first screen can be -initialized, but the second screen is mentioned first in the -ServerLayout section, the xf86InitOrigins() function will crash -because the screen referred to in the e.g. "RightOf" part is -non-existent. - ---- ---- a/hw/xfree86/common/xf86Cursor.c.init-origins-fix 2004-10-18 22:22:42.675899006 -0400 -+++ b/hw/xfree86/common/xf86Cursor.c 2004-10-18 22:21:42.540867549 -0400 -@@ -566,6 +566,14 @@ - - screen = &xf86ConfigLayout.screens[i]; - -+ if (screen->refscreen != NULL && -+ screen->refscreen->screennum >= xf86NumScreens) { -+ screensLeft &= ~(1 << i); -+ xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n", -+ screen->screen->id); -+ continue; -+ } -+ - switch(screen->where) { - case PosObsolete: - OldStyleConfig = TRUE; diff --git a/xorg-x11-server-1.0.1-fpic-libxf86config.patch b/xorg-x11-server-1.0.1-fpic-libxf86config.patch deleted file mode 100644 index 15c099a..0000000 --- a/xorg-x11-server-1.0.1-fpic-libxf86config.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Build libxf86config with -fPIC - ---- ---- xorg-server-1.0.1/hw/xfree86/parser/Makefile.am.xf86configfpic 2006-03-06 13:57:45.000000000 -0500 -+++ xorg-server-1.0.1/hw/xfree86/parser/Makefile.am 2006-03-06 13:59:11.000000000 -0500 -@@ -23,7 +23,7 @@ - DRI.c \ - Extensions.c - --AM_CFLAGS = $(XORG_CFLAGS) -+AM_CFLAGS = $(XORG_CFLAGS) -fPIC -fvisibility=hidden - - EXTRA_DIST = \ - Configint.h \ diff --git a/xorg-x11-server-1.1.0-dont-backfill-bg-none.patch b/xorg-x11-server-1.1.0-dont-backfill-bg-none.patch deleted file mode 100644 index b1afc73..0000000 --- a/xorg-x11-server-1.1.0-dont-backfill-bg-none.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Don't backfill windows with bg=none - -Disable backfilling of windows created with bg=none, which otherwise -would force a framebuffer readback. - -Note that this patch can only be dropped if you verify that - - https://bugzilla.redhat.com/show_bug.cgi?id=285991 - -is fixed (which it is in upstream git as of - -f98dfec79dadb70fa7bba84e7335f92b3a73dc02 - ---- ---- a/composite/compalloc.c.spiffiffity 2006-03-13 16:59:55.000000000 -0500 -+++ b/composite/compalloc.c 2006-04-12 16:37:50.000000000 -0400 -@@ -478,6 +478,7 @@ - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ -+#if 0 - if (pGC) - { - XID val = IncludeInferiors; -@@ -492,6 +493,7 @@ - w, h, 0, 0); - FreeScratchGC (pGC); - } -+#endif - return pPixmap; - } - diff --git a/xorg-x11-server-1.1.1-automake-1.10-fixes.patch b/xorg-x11-server-1.1.1-automake-1.10-fixes.patch deleted file mode 100644 index 0d5de03..0000000 --- a/xorg-x11-server-1.1.1-automake-1.10-fixes.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- xorg-server-1.1.1/hw/xfree86/os-support/linux/Makefile.am.automake-1.10 2006-11-30 15:35:09.000000000 -0500 -+++ xorg-server-1.1.1/hw/xfree86/os-support/linux/Makefile.am 2006-12-01 11:00:04.000000000 -0500 -@@ -41,7 +41,7 @@ - INCLUDES = $(XORG_INCS) $(PLATFORM_INCLUDES) -I/usr/include/drm # FIXME this last part is crack - - # FIXME: These need to be added to the build --LNX_EXTRA_SOURCES = \ -+LNX_EXTRA_SRCS = \ - lnx_font.c \ - lnx_jstk.c \ - lnxResource.c ---- xorg-server-1.1.1/hw/xfree86/os-support/misc/Makefile.am.automake-1.10 2006-07-05 14:31:41.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/os-support/misc/Makefile.am 2006-12-01 11:00:57.000000000 -0500 -@@ -1,14 +1,14 @@ - # FIXME: Add the *.S files to build when applicable --I386_SOURCES = BUSmemcpy.S IODelay.S SlowBcopy.S -+I386_SRCS = BUSmemcpy.S IODelay.S SlowBcopy.S - OTHER_SOURCES = BUSmemcpy.c IODelay.c SlowBcopy.c - - ARCH_SOURCES = $(OTHER_SOURCES) - - # FIXME: Add to the build (NeedPortIO) --PORTIO_SOURCES = PortIO.S -+PORTIO_SRCS = PortIO.S - - # FIXME: Add to the build (if HasGcc || HasGcc2) --ILHACK_SOURCES = xf86_IlHack.c -+ILHACK_SRCS = xf86_IlHack.c - - noinst_LTLIBRARIES = libmisc.la - diff --git a/xorg-x11-server-1.1.1-builderstring.patch b/xorg-x11-server-1.1.1-builderstring.patch deleted file mode 100644 index 0f1f71b..0000000 --- a/xorg-x11-server-1.1.1-builderstring.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- xorg-server-1.1.1/include/dix-config.h.in.builderstring 2006-07-05 14:38:48.000000000 -0400 -+++ xorg-server-1.1.1/include/dix-config.h.in 2006-08-09 16:59:05.000000000 -0400 -@@ -15,6 +15,9 @@ - /* Operating System Vendor */ - #undef OSVENDOR - -+/* Builder string */ -+#undef BUILDERSTRING -+ - /* Default font path */ - #undef COMPILEDDEFAULTFONTPATH - ---- xorg-server-1.1.1/configure.ac.builderstring 2006-08-09 14:04:19.000000000 -0400 -+++ xorg-server-1.1.1/configure.ac 2006-08-09 16:58:25.000000000 -0400 -@@ -358,6 +358,9 @@ - AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]), - [ OSVENDOR="$withval" ], - [ OSVENDOR="" ]) -+AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]), -+ [ BUILDERSTRING="$withval" ] -+ [ ]) - AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]), - [ MESA_SOURCE="$withval" ], - [ MESA_SOURCE="" ]) -@@ -817,6 +820,8 @@ - AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) - AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) - AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) -+AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) -+ - AC_SUBST([VENDOR_STRING]) - AC_SUBST([VENDOR_STRING_SHORT]) - AC_SUBST([VENDOR_RELEASE]) diff --git a/xorg-x11-server-1.1.1-builtin-fonts.patch b/xorg-x11-server-1.1.1-builtin-fonts.patch deleted file mode 100644 index 47f1f09..0000000 --- a/xorg-x11-server-1.1.1-builtin-fonts.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Enable builtin font FPE. - ---- ---- ./dix/dixfonts.c.builtin-fonts 2006-09-06 16:45:20.000000000 -0400 -+++ ./dix/dixfonts.c 2006-09-06 16:45:31.000000000 -0400 -@@ -1904,9 +1904,7 @@ - } else - #endif - { --#ifdef KDRIVESERVER - BuiltinRegisterFpeFunctions(); --#endif - FontFileRegisterFpeFunctions(); - #ifndef NOFONTSERVERACCESS - fs_register_fpe_functions(); diff --git a/xorg-x11-server-1.1.1-graphics-expose.patch b/xorg-x11-server-1.1.1-graphics-expose.patch deleted file mode 100644 index 4cebe16..0000000 --- a/xorg-x11-server-1.1.1-graphics-expose.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- xorg-server-1.1.1/miext/cw/cw_ops.c.graphics-expose 2006-07-05 20:23:57.000000000 -0400 -+++ xorg-server-1.1.1/miext/cw/cw_ops.c 2006-10-04 23:54:03.000000000 -0400 -@@ -30,6 +30,7 @@ - #include "gcstruct.h" - #include "pixmapstr.h" - #include "cw.h" -+#include "mi.h" - - #define SETUP_BACKING_DST(_pDst, _pGC) \ - cwGCPtr pGCPrivate = getCwGC (_pGC); \ -@@ -185,7 +186,7 @@ - int w, int h, int dstx, int dsty) - { - int odstx, odsty; -- RegionPtr exposed = NULL; -+ int osrcx, osrcy; - SETUP_BACKING_DST(pDst, pGC); - SETUP_BACKING_SRC(pSrc, pGC); - -@@ -193,19 +194,20 @@ - - odstx = dstx; - odsty = dsty; -+ osrcx = srcx; -+ osrcy = srcy; - CW_OFFSET_XY_DST(dstx, dsty); - CW_OFFSET_XY_SRC(srcx, srcy); - -- exposed = (*pBackingGC->ops->CopyArea)(pBackingSrc, pBackingDst, -- pBackingGC, srcx, srcy, w, h, -- dstx, dsty); -- -- if (exposed != NULL) -- REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty); -- -+ (*pBackingGC->ops->CopyArea)(pBackingSrc, pBackingDst, -+ pBackingGC, srcx, srcy, w, h, -+ dstx, dsty); -+ - EPILOGUE(pGC); - -- return exposed; -+ return miHandleExposures(pSrc, pDst, pGC, -+ osrcx, osrcy, w, h, -+ odstx, odsty, 0); - } - - static RegionPtr -@@ -213,7 +215,7 @@ - int w, int h, int dstx, int dsty, unsigned long plane) - { - int odstx, odsty; -- RegionPtr exposed = NULL; -+ int osrcx, osrcy; - SETUP_BACKING_DST(pDst, pGC); - SETUP_BACKING_SRC(pSrc, pGC); - -@@ -221,19 +223,20 @@ - - odstx = dstx; - odsty = dsty; -+ osrcx = srcx; -+ osrcy = srcy; - CW_OFFSET_XY_DST(dstx, dsty); - CW_OFFSET_XY_SRC(srcx, srcy); - -- exposed = (*pBackingGC->ops->CopyPlane)(pBackingSrc, pBackingDst, -- pBackingGC, srcx, srcy, w, h, -- dstx, dsty, plane); -- -- if (exposed != NULL) -- REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty); -+ (*pBackingGC->ops->CopyPlane)(pBackingSrc, pBackingDst, -+ pBackingGC, srcx, srcy, w, h, -+ dstx, dsty, plane); - - EPILOGUE(pGC); - -- return exposed; -+ return miHandleExposures(pSrc, pDst, pGC, -+ osrcx, osrcy, w, h, -+ odstx, odsty, plane); - } - - static void diff --git a/xorg-x11-server-1.1.1-no-composite-in-xnest.patch b/xorg-x11-server-1.1.1-no-composite-in-xnest.patch deleted file mode 100644 index 889ec84..0000000 --- a/xorg-x11-server-1.1.1-no-composite-in-xnest.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Disable Composite in Xnest. - ---- ---- xorg-server-1.1.1/hw/xnest/Args.c.no-xnest-composite 2006-07-05 14:31:42.000000000 -0400 -+++ xorg-server-1.1.1/hw/xnest/Args.c 2006-07-25 14:02:33.000000000 -0400 -@@ -51,9 +51,12 @@ - Bool xnestDoDirectColormaps = False; - Window xnestParentWindow = 0; - -+/* XXX terrible hack */ -+extern Bool noCompositeExtension; - /* ddxInitGlobals - called by |InitGlobals| from os/util.c */ - void ddxInitGlobals(void) - { -+ noCompositeExtension = TRUE; - } - - int diff --git a/xorg-x11-server-1.1.1-no-scanpci.patch b/xorg-x11-server-1.1.1-no-scanpci.patch deleted file mode 100644 index 9116a85..0000000 --- a/xorg-x11-server-1.1.1-no-scanpci.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- xorg-server-1.1.1/hw/xfree86/utils/Makefile.am.no-scanpci 2006-07-05 14:31:42.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/utils/Makefile.am 2006-11-10 11:43:27.000000000 -0500 -@@ -4,6 +4,5 @@ - ioport \ - kbd_mode \ - pcitweak \ -- scanpci \ - xorgcfg \ - xorgconfig ---- xorg-server-1.1.1/hw/xfree86/scanpci/Makefile.am.no-scanpci 2006-07-05 14:31:41.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/scanpci/Makefile.am 2006-11-10 11:59:26.000000000 -0500 -@@ -1,10 +1,8 @@ --module_LTLIBRARIES = libscanpci.la libpcidata.la -+module_LTLIBRARIES = libpcidata.la - - libpcidata_la_LDFLAGS = -avoid-version --libscanpci_la_LDFLAGS = -avoid-version - - libpcidata_la_SOURCES = xf86PciData.c --libscanpci_la_SOURCES = xf86ScanPci.c - - INCLUDES = $(XORG_INCS) - diff --git a/xorg-x11-server-1.1.1-spurious-libxf1bpp-link.patch b/xorg-x11-server-1.1.1-spurious-libxf1bpp-link.patch deleted file mode 100644 index 30382b4..0000000 --- a/xorg-x11-server-1.1.1-spurious-libxf1bpp-link.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xorg-server-1.1.1/hw/xfree86/xf4bpp/Makefile.am.xf1bpp 2006-07-05 14:31:42.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/xf4bpp/Makefile.am 2006-11-10 12:53:25.000000000 -0500 -@@ -46,8 +46,6 @@ - mfbzerarc.c \ - vgamodule.c - --libxf4bpp_la_LIBADD = ../xf1bpp/libxf1bpp.la -- - EXTRA_DIST = OScompiler.h ibmTrace.h ppcGCstr.h ppcSpMcro.h vgaReg.h \ - vgaVideo.h wm3.h NOTES - diff --git a/xorg-x11-server-1.1.1-vbe-filter-less.patch b/xorg-x11-server-1.1.1-vbe-filter-less.patch deleted file mode 100644 index 1e453f4..0000000 --- a/xorg-x11-server-1.1.1-vbe-filter-less.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Don't filter modes away during VBE mode list construction. - -Pass all VBE modes back up to the driver, on the assumption that it -knows how to filter modes intelligently. - ---- ---- xorg-server-1.1.1/hw/xfree86/vbe/vbeModes.c.jx 2006-07-05 14:31:42.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/vbe/vbeModes.c 2006-09-22 15:29:34.000000000 -0400 -@@ -153,34 +153,6 @@ - xf86ErrorFVerb(DEBUG_VERB, "*"); - } - -- /* -- * Check if there's a valid monitor mode that this one can be matched -- * up with. The actual matching is done later. -- */ -- if (modeOK) { -- Bool sizeMatch = FALSE; -- modeOK = FALSE; -- for (p = pScrn->monitor->Modes; p != NULL; p = p->next) { -- if ((p->HDisplay != mode->XResolution) || -- (p->VDisplay != mode->YResolution) || -- (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) -- continue; -- sizeMatch = TRUE; -- /* XXX could support the various V_ flags */ -- status = xf86CheckModeForMonitor(p, pScrn->monitor); -- if (status == MODE_OK) { -- modeOK = TRUE; -- break; -- } -- } -- if (sizeMatch && !modeOK) { -- xf86DrvMsg(pScrn->scrnIndex, X_INFO, -- "Not using built-in mode \"%dx%d\" (%s)\n", -- mode->XResolution, mode->YResolution, -- xf86ModeStatusToString(status)); -- } -- } -- - xf86ErrorFVerb(DEBUG_VERB, - "Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution); - xf86ErrorFVerb(DEBUG_VERB, diff --git a/xorg-x11-server-1.1.1-vt-activate-is-a-terrible-api.patch b/xorg-x11-server-1.1.1-vt-activate-is-a-terrible-api.patch deleted file mode 100644 index abfa9de..0000000 --- a/xorg-x11-server-1.1.1-vt-activate-is-a-terrible-api.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- xorg-server-1.1.1/hw/xfree86/os-support/linux/lnx_init.c.vt-activate 2006-07-05 14:31:41.000000000 -0400 -+++ xorg-server-1.1.1/hw/xfree86/os-support/linux/lnx_init.c 2006-12-14 22:00:25.000000000 -0500 -@@ -248,14 +248,20 @@ - #endif - /* - * now get the VT -+ * -+ * There's a race here, in that if someone else does a VT_ACTIVATE -+ * between our ACTIVATE/WAITACTIVE, we might never get the VT. -+ * So we have to fail in that case. There's really no fixing this, -+ * it's a racy protocol. - */ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) -- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed: %s\n", -- strerror(errno)); -+ FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", -+ strerror(errno)); -+ - - if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0) -- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed: %s\n", -- strerror(errno)); -+ FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n", -+ strerror(errno)); - - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) - FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", -@@ -352,6 +358,9 @@ - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0) - xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n", - strerror(errno)); -+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0) -+ xf86Msg(X_WARNING, "xf86CloseConsole: VT_WAITACTIVE failed: %s\n", -+ strerror(errno)); - activeVT = -1; - } - diff --git a/xorg-x11-server-1.1.1-xkb-in-xnest.patch b/xorg-x11-server-1.1.1-xkb-in-xnest.patch deleted file mode 100644 index 377f43c..0000000 --- a/xorg-x11-server-1.1.1-xkb-in-xnest.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xorg-server-1.1.1/mi/miinitext.c.xkb-in-xnest 2006-07-05 14:38:48.000000000 -0400 -+++ xorg-server-1.1.1/mi/miinitext.c 2006-08-17 22:57:27.000000000 -0400 -@@ -595,7 +595,7 @@ - #ifdef XSYNC - if (!noSyncExtension) SyncExtensionInit(); - #endif --#if defined(XKB) && !defined(PRINT_ONLY_SERVER) && !defined(NO_HW_ONLY_EXTS) -+#if defined(XKB) && !defined(PRINT_ONLY_SERVER) - if (!noXkbExtension) XkbExtensionInit(); - #endif - #ifdef XCMISC diff --git a/xorg-x11-server-1.2.0-enable-composite.patch b/xorg-x11-server-1.2.0-enable-composite.patch deleted file mode 100644 index 72390fe..0000000 --- a/xorg-x11-server-1.2.0-enable-composite.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Enable the Composite extension by default - ---- ---- xorg-server-1.2.0/os/utils.c.enable-composite 2007-01-22 22:13:16.000000000 -0500 -+++ xorg-server-1.2.0/os/utils.c 2007-01-23 12:26:04.000000000 -0500 -@@ -138,7 +138,7 @@ - #ifdef COMPOSITE - /* COMPOSITE is disabled by default for now until the - * interface is stable */ -- #define COMPOSITE_DEFAULT FALSE -+ #define COMPOSITE_DEFAULT TRUE - _X_EXPORT Bool noCompositeExtension = !COMPOSITE_DEFAULT; - #endif - diff --git a/xorg-x11-server-1.2.0-selinux-awareness.patch b/xorg-x11-server-1.2.0-selinux-awareness.patch deleted file mode 100644 index 14fd7e3..0000000 --- a/xorg-x11-server-1.2.0-selinux-awareness.patch +++ /dev/null @@ -1,39 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Add selinux awareness. - -Mesa contains some codegen paths that check for selinux, so we need to -link against libselinux to make that work. - ---- ---- xserver-20070223/hw/xfree86/dixmods/Makefile.am.selinux-awareness 2007-02-23 11:20:30.000000000 -0500 -+++ xserver-20070223/hw/xfree86/dixmods/Makefile.am 2007-02-23 11:24:32.000000000 -0500 -@@ -42,7 +42,7 @@ - -I$(top_srcdir)/GL/glx - - libGLcore_la_LDFLAGS = -avoid-version --libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la -+libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la -lselinux - libGLcore_la_SOURCES = GLcoremodule.c - - libafb_la_LDFLAGS = -avoid-version ---- xserver-20070223/configure.ac.selinux-awareness 2007-02-23 11:24:31.000000000 -0500 -+++ xserver-20070223/configure.ac 2007-02-23 11:25:38.000000000 -0500 -@@ -237,6 +237,8 @@ - ;; - esac - -+SYS_LIBS="${SYS_LIBS} -lselinux" -+ - dnl BSD *_video.c selection - AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) - AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) -@@ -1010,7 +1012,7 @@ - AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) - - if test "x$XNEST" = xyes; then -- XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" -+ XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS $XSERVER_LIBS" - AC_SUBST([XNEST_LIBS]) - fi - diff --git a/xorg-x11-server-1.2.0-xephyr-only.patch b/xorg-x11-server-1.2.0-xephyr-only.patch deleted file mode 100644 index 7b86982..0000000 --- a/xorg-x11-server-1.2.0-xephyr-only.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- xorg-server-1.2.0/hw/kdrive/Makefile.am.xephyr 2007-01-22 22:13:14.000000000 -0500 -+++ xorg-server-1.2.0/hw/kdrive/Makefile.am 2007-01-23 12:28:32.000000000 -0500 -@@ -1,16 +1,3 @@ --if KDRIVEVESA --VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ -- smi via --endif -- --if KDRIVEFBDEV --FBDEV_SUBDIRS = fbdev --endif -- --if XSDLSERVER --XSDL_SUBDIRS = sdl --endif -- - if XEPHYR - XEPHYR_SUBDIRS = ephyr - endif -@@ -22,11 +9,7 @@ - SUBDIRS = \ - src \ - $(LINUX_SUBDIRS) \ -- $(XSDL_SUBDIRS) \ -- $(FBDEV_SUBDIRS) \ -- $(VESA_SUBDIRS) \ -- $(XEPHYR_SUBDIRS) \ -- fake -+ $(XEPHYR_SUBDIRS) - - DIST_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ - smi via fbdev sdl ephyr src linux fake sis300 diff --git a/xorg-x11-server-1.2.0-xf86config-comment-less.patch b/xorg-x11-server-1.2.0-xf86config-comment-less.patch deleted file mode 100644 index 108e226..0000000 --- a/xorg-x11-server-1.2.0-xf86config-comment-less.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Disable explicit commenting in Monitor section. - ---- ---- xorg-server-1.2.0/hw/xfree86/parser/Monitor.c.comment-less 2007-01-22 22:13:15.000000000 -0500 -+++ xorg-server-1.2.0/hw/xfree86/parser/Monitor.c 2007-01-23 12:32:48.000000000 -0500 -@@ -674,8 +674,6 @@ - fprintf (cf, "\tDisplaySize %d\t%d\n", - ptr->mon_width, - ptr->mon_height); -- if ( ptr->mon_n_hsync || ptr->mon_n_vrefresh ) -- fprintf(cf," ### Comment all HorizSync and VertRefresh values to use DDC:\n"); - for (i = 0; i < ptr->mon_n_hsync; i++) - { - fprintf (cf, "\tHorizSync %2.1f - %2.1f\n", diff --git a/xorg-x11-server-libxf86config-dont-write-empty-sections.patch b/xorg-x11-server-libxf86config-dont-write-empty-sections.patch deleted file mode 100644 index e47c3f2..0000000 --- a/xorg-x11-server-libxf86config-dont-write-empty-sections.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- hw/xfree86/parser/write.c.orig 2006-07-12 11:15:49.000000000 -0400 -+++ hw/xfree86/parser/write.c 2006-07-12 11:19:59.000000000 -0400 -@@ -108,13 +108,19 @@ - - xf86printLayoutSection (cf, cptr->conf_layout_lst); - -- fprintf (cf, "Section \"Files\"\n"); -- xf86printFileSection (cf, cptr->conf_files); -- fprintf (cf, "EndSection\n\n"); -- -- fprintf (cf, "Section \"Module\"\n"); -- xf86printModuleSection (cf, cptr->conf_modules); -- fprintf (cf, "EndSection\n\n"); -+ if (cptr->conf_files != NULL) -+ { -+ fprintf (cf, "Section \"Files\"\n"); -+ xf86printFileSection (cf, cptr->conf_files); -+ fprintf (cf, "EndSection\n\n"); -+ } -+ -+ if (cptr->conf_modules != NULL) -+ { -+ fprintf (cf, "Section \"Module\"\n"); -+ xf86printModuleSection (cf, cptr->conf_modules); -+ fprintf (cf, "EndSection\n\n"); -+ } - - xf86printVendorSection (cf, cptr->conf_vendor_lst); - diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index dc44e69..d821777 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -15,12 +15,12 @@ # RHEL5 bugfix sync %define pkgname xorg-server -%define gitdate 20071101 +%define gitdate 20071102 Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.4.99.1 -Release: 0.5%{?dist} +Release: 0.6%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -38,10 +38,7 @@ Source0: ftp://ftp.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2 Source100: comment-header-modefiles.txt # general bug fixes -Patch0: xorg-x11-server-0.99.3-init-origins-fix.patch -Patch10: xorg-x11-server-1.1.1-vbe-filter-less.patch Patch19: xserver-1.3.0-xnest-exposures.patch -Patch22: xserver-1.3.0-fbdevhw-magic-numbers.patch # OpenGL compositing manager feature/optimization patches. Patch100: xorg-x11-server-1.1.0-no-move-damage.patch @@ -53,25 +50,13 @@ Patch1001: xorg-x11-server-Red-Hat-extramodes.patch Patch1003: xserver-1.4.99-pic-libxf86config.patch Patch1004: xserver-1.4.99-selinux-awareness.patch Patch1005: xserver-1.4.99-builtin-fonts.patch -Patch1008: xorg-x11-server-1.2.0-xf86config-comment-less.patch Patch1010: xserver-1.3.0-no-prerelease-warning.patch Patch1014: xserver-1.4.99-xaa-evict-pixmaps.patch Patch1022: xserver-1.3.0-default-dpi.patch -Patch1024: xserver-1.3.0-avoid-ps2-probe.patch Patch2004: xserver-1.3.0-honor-displaysize.patch Patch2007: xserver-1.3.0-randr12-config-hack.patch Patch2013: xserver-1.3.0-document-fontpath-correctly.patch -Patch2015: xserver-1.3.0-accidental-abi.patch -Patch2016: xserver-1.4.99-late-sigusr1.patch - -# assorted PCI layer shenanigans. oh the pain. -##Patch2500: xorg-x11-server-1.2.99-unbreak-domain.patch -##Patch2501: xserver-1.3.0-pci-bus-count.patch -##Patch2502: xserver-1.3.0-mmap-failure-check.patch -##Patch2503: xserver-1.3.0-rom-search.patch -##Patch2504: xserver-1.3.0-domain-obiwan.patch -##Patch2505: xserver-1.3.0-pci-device-enable.patch %define moduledir %{_libdir}/xorg/modules @@ -91,7 +76,7 @@ Patch2016: xserver-1.4.99-late-sigusr1.patch %endif %define kdrive --enable-kdrive --enable-xephyr --disable-xsdl --disable-xfake --disable-xfbdev --disable-kdrive-vesa -%define xservers --enable-xvfb --enable-xnest %{kdrive} --enable-dmx +%define xservers --enable-xvfb --enable-xnest %{kdrive} %{enable_xorg} --enable-dmx # FIXME: Temporary Build deps on autotools, as needed... BuildRequires: automake autoconf libtool @@ -180,7 +165,7 @@ upon. %package Xnest Summary: A nested server. Group: User Interface/X -Obsoletes: XFree86-Xnest, xorg-x11-Xnest +Obsoletes: xorg-x11-Xnest Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xnest @@ -213,7 +198,7 @@ application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays %package Xvfb Summary: A X Windows System virtual framebuffer X server. Group: User Interface/X -Obsoletes: XFree86-Xvfb xorg-x11-Xvfb +Obsoletes: xorg-x11-Xvfb Requires: xorg-x11-server-common >= %{version}-%{release} Provides: Xvfb @@ -246,7 +231,7 @@ Render and Composite. %package devel Summary: SDK for X server driver module development Group: User Interface/X -Obsoletes: XFree86-sdk xorg-x11-sdk xorg-x11-server-sdk +Obsoletes: xorg-x11-sdk xorg-x11-server-sdk Requires: xorg-x11-util-macros Requires: xorg-x11-proto-devel Requires: pkgconfig @@ -300,8 +285,7 @@ fi # --with-rgb-path should be superfluous now ? # --with-pie ? autoreconf -v --install || exit 1 -%configure --enable-maintainer-mode \ - %{enable_xorg} %{xservers} \ +%configure --enable-maintainer-mode %{xservers} \ --disable-static \ --with-pic \ --disable-{a,c,m}fb \ @@ -534,6 +518,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Nov 02 2007 Adam Jackson 1.4.99.1-0.6 +- Merge a bunch of the more trivial patches upstream. +- New git snapshot containing the merged bits. +- Remove unused patches. +- Drop the XFree86 obsoletes. + * Fri Nov 02 2007 Adam Jackson 1.4.99.1-0.5 - New git snapshot that fixes Xdmx build. - Reenable Xdmx build. diff --git a/xserver-1.2.0-geode-mmx.patch b/xserver-1.2.0-geode-mmx.patch deleted file mode 100644 index 8af6080..0000000 --- a/xserver-1.2.0-geode-mmx.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Fix MMX detection for AMD Geode processors. - ---- ---- a/fb/fbpict.c -+++ a/fb/fbpict.c -@@ -1516,7 +1516,9 @@ static unsigned int detectCPUFeatures(void) { - features |= SSE; - if (result & (1 << 26)) - features |= SSE2; -- if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) { -+ if ((features & MMX) && !(features & SSE) && -+ (strcmp(vendor, "AuthenticAMD") == 0 || -+ strcmp(vendor, "Geode by NSC") == 0)) { - /* check for AMD MMX extensions */ - - unsigned int result; diff --git a/xserver-1.2.0-vfprintf.patch b/xserver-1.2.0-vfprintf.patch deleted file mode 100644 index 1aeda9b..0000000 --- a/xserver-1.2.0-vfprintf.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- xorg-server-1.2.0/hw/xfree86/os-support/xf86_libc.h.jx 2007-01-22 22:13:15.000000000 -0500 -+++ xorg-server-1.2.0/hw/xfree86/os-support/xf86_libc.h 2007-01-29 18:13:11.000000000 -0500 -@@ -428,7 +428,7 @@ - #define toupper(i) xf86toupper(i) - #undef ungetc - #define ungetc(i,FP) xf86ungetc(i,FP) --#undef vfprinf -+#undef vfprintf - #define vfprintf(p,f,a) xf86vfprintf(p,f,a) - #undef vsnprintf - #define vsnprintf(s,n,f,a) xf86vsnprintf(s,n,f,a) diff --git a/xserver-1.2.0-xephyr-keysym-madness.patch b/xserver-1.2.0-xephyr-keysym-madness.patch deleted file mode 100644 index 5e8cc18..0000000 --- a/xserver-1.2.0-xephyr-keysym-madness.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Fix keysym typedef in Xephyr. - ---- ---- xorg-server-1.2.0/hw/kdrive/ephyr/hostx.c.xephyr-keysym 2007-01-22 22:13:14.000000000 -0500 -+++ xorg-server-1.2.0/hw/kdrive/ephyr/hostx.c 2007-01-29 17:58:00.000000000 -0500 -@@ -77,9 +77,10 @@ - - static int HostXWantDamageDebug = 0; - --extern KeySym EphyrKeymap[]; -+/* these two need to be 32-bits. do not say KeySym, that way lies madness */ -+extern unsigned int EphyrKeymap[]; -+extern unsigned int kdKeymap[]; - --extern KeySym kdKeymap[]; - extern int kdMinScanCode; - extern int kdMaxScanCode; - extern int kdMinKeyCode; -@@ -662,7 +663,7 @@ - void - hostx_load_keymap(void) - { -- KeySym *keymap; -+ unsigned int *keymap; - int host_width, min_keycode, max_keycode, width; - int i,j; - diff --git a/xserver-1.3.0-accidental-abi.patch b/xserver-1.3.0-accidental-abi.patch deleted file mode 100644 index a24897f..0000000 --- a/xserver-1.3.0-accidental-abi.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Fix accidental ABI usage in RANDR 1.2 drivers. - -Due to RANDR 1.2, xf86findOptionValue and xf86nameCompare are now ABI. -Make sure they're exported from the server. - ---- -diff -up xorg-server-1.3.0.0/hw/xfree86/parser/Flags.c.jx xorg-server-1.3.0.0/hw/xfree86/parser/Flags.c ---- xorg-server-1.3.0.0/hw/xfree86/parser/Flags.c.jx 2006-09-18 02:04:18.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/parser/Flags.c 2007-10-03 11:08:01.000000000 -0400 -@@ -330,7 +330,7 @@ xf86findOption (XF86OptionPtr list, cons - * returned. If the option is not found, a NULL is returned. - */ - --char * -+__attribute__((visibility("default"))) char * - xf86findOptionValue (XF86OptionPtr list, const char *name) - { - XF86OptionPtr p = xf86findOption (list, name); -diff -up xorg-server-1.3.0.0/hw/xfree86/parser/scan.c.jx xorg-server-1.3.0.0/hw/xfree86/parser/scan.c ---- xorg-server-1.3.0.0/hw/xfree86/parser/scan.c.jx 2006-10-04 17:46:03.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/parser/scan.c 2007-10-03 10:57:43.000000000 -0400 -@@ -985,7 +985,7 @@ StringToToken (char *str, xf86ConfigSymT - * Compare two names. The characters '_', ' ', and '\t' are ignored - * in the comparison. - */ --int -+__attribute__((visibility("default"))) int - xf86nameCompare (const char *s1, const char *s2) - { - char c1, c2; diff --git a/xserver-1.3.0-add-really-slow-bcopy.patch b/xserver-1.3.0-add-really-slow-bcopy.patch deleted file mode 100644 index ba8c766..0000000 --- a/xserver-1.3.0-add-really-slow-bcopy.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c -index d925bed..8a2768d 100644 ---- a/hw/xfree86/loader/xf86sym.c -+++ b/hw/xfree86/loader/xf86sym.c -@@ -259,6 +259,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { - SYMFUNC(xf86UDelay) - SYMFUNC(xf86IODelay) - SYMFUNC(xf86SlowBcopy) -+ SYMFUNC(xf86SetReallySlowBcopy) - #ifdef __alpha__ - SYMFUNC(xf86SlowBCopyToBus) - SYMFUNC(xf86SlowBCopyFromBus) -diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c -index 7694eaa..5cd7168 100644 ---- a/hw/xfree86/os-support/misc/SlowBcopy.c -+++ b/hw/xfree86/os-support/misc/SlowBcopy.c -@@ -22,21 +22,37 @@ - #include "xf86_OSlib.h" - #include "compiler.h" - --/* The outb() isn't needed on my machine, but who knows ... -- ost */ -+static int really_slow_bcopy; -+ - _X_EXPORT void --xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) -+xf86SetReallySlowBcopy(void) -+{ -+ really_slow_bcopy = 1; -+} -+ -+#if defined(__i386__) || defined(__x86_64__) -+static void xf86_really_slow_bcopy(unsigned char *src, unsigned char *dst, int len) - { - while(len--) - { - *dst++ = *src++; --#if !defined(__sparc__) && \ -- !defined(__powerpc__) && \ -- !defined(__mips__) && \ -- !defined(__ia64__) && \ -- !defined(__arm__) - outb(0x80, 0x00); -+ } -+} - #endif -+ -+/* The outb() isn't needed on my machine, but who knows ... -- ost */ -+_X_EXPORT void -+xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) -+{ -+#if defined(__i386__) || defined(__x86_64__) -+ if (really_slow_bcopy) { -+ xf86_really_slow_bcopy(src, dst, len); -+ return; - } -+#endif -+ while(len--) -+ *dst++ = *src++; - } - - #ifdef __alpha__ -diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h -index 1bbbf56..6f0391d 100644 ---- a/hw/xfree86/os-support/xf86_OSproc.h -+++ b/hw/xfree86/os-support/xf86_OSproc.h -@@ -159,6 +159,7 @@ extern void xf86BusToMem(unsigned char *, unsigned char *, int); - extern void xf86MemToBus(unsigned char *, unsigned char *, int); - extern void xf86IODelay(void); - extern void xf86UDelay(long usec); -+extern void xf86SetReallySlowBcopy(void); - extern void xf86SlowBcopy(unsigned char *, unsigned char *, int); - extern int xf86OpenSerial(pointer options); - extern int xf86SetSerial(int fd, pointer options); diff --git a/xserver-1.3.0-arm-iopl.patch b/xserver-1.3.0-arm-iopl.patch deleted file mode 100644 index fa00d66..0000000 --- a/xserver-1.3.0-arm-iopl.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- xorg-server-1.3.0.0/hw/xfree86/common/xf86Bus.c.arm 2007-02-17 20:37:56.000000000 -0500 -+++ xorg-server-1.3.0.0/hw/xfree86/common/xf86Bus.c 2007-06-04 11:33:14.000000000 -0400 -@@ -3006,7 +3006,7 @@ - - } - --#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) -+#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) - #include "vgaHW.h" - #include "compiler.h" - #endif -@@ -3018,7 +3018,7 @@ - CheckGenericGA() - { - /* This needs to be changed for multiple domains */ --#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) -+#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) && !defined(__arm__) - IOADDRESS GenericIOBase = VGAHW_GET_IOBASE(); - CARD8 CurrentValue, TestValue; - ---- xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_video.c.arm 2006-09-18 02:04:18.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_video.c 2007-06-04 11:35:21.000000000 -0400 -@@ -62,7 +62,8 @@ - #elif !defined(__powerpc__) && \ - !defined(__mc68000__) && \ - !defined(__sparc__) && \ -- !defined(__mips__) -+ !defined(__mips__) && \ -+ !defined(__arm__) - - /* - * Due to conflicts with "compiler.h", don't rely on to declare -@@ -567,7 +568,7 @@ - #endif - } - close(fd); --#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) -+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) - if (ioperm(0, 1024, 1) || iopl(3)) { - if (errno == ENODEV) - ErrorF("xf86EnableIOPorts: no I/O ports found\n"); ---- xorg-server-1.3.0.0/hw/xfree86/os-support/misc/SlowBcopy.c.arm 2006-09-18 02:04:18.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/os-support/misc/SlowBcopy.c 2007-06-04 11:31:28.000000000 -0400 -@@ -35,7 +35,8 @@ - #if !defined(__sparc__) && \ - !defined(__powerpc__) && \ - !defined(__mips__) && \ -- !defined(__ia64__) -+ !defined(__ia64__) && \ -+ !defined(__arm__) - outb(0x80, 0x00); - #endif - } diff --git a/xserver-1.3.0-avoid-ps2-probe.patch b/xserver-1.3.0-avoid-ps2-probe.patch deleted file mode 100644 index c54db76..0000000 --- a/xserver-1.3.0-avoid-ps2-probe.patch +++ /dev/null @@ -1,99 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Avoid PS/2 protocol probing for /dev/input/mice - -The kernel will always upconvert to ExplorerPS/2 for all readers of -/dev/input/mice, so don't waste time on startup trying to figure -that out. - ---- -diff -up xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_mouse.c.jx xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_mouse.c ---- xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_mouse.c.jx 2006-09-18 02:04:18.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_mouse.c 2007-10-11 09:53:33.000000000 -0400 -@@ -45,7 +45,8 @@ typedef enum { - MOUSE_PROTO_SERIAL, - MOUSE_PROTO_PS2, - MOUSE_PROTO_MSC, -- MOUSE_PROTO_GPM -+ MOUSE_PROTO_GPM, -+ MOUSE_PROTO_EXPPS2, - } protocolTypes; - - static struct { -@@ -55,7 +56,8 @@ static struct { - { MOUSE_PROTO_UNKNOWN, NULL }, - { MOUSE_PROTO_PS2, "PS/2" }, - { MOUSE_PROTO_MSC, "MouseSystems" }, -- { MOUSE_PROTO_GPM, "GPM" } -+ { MOUSE_PROTO_GPM, "GPM" }, -+ { MOUSE_PROTO_EXPPS2, "ExplorerPS/2" }, - }; - - static const char * -@@ -87,7 +89,7 @@ FindDevice(InputInfoPtr pInfo, const cha - } - - static const char * --GuessProtocol(InputInfoPtr pInfo, int flags) -+lnxMouseMagic(InputInfoPtr pInfo) - { - int fd = -1; - const char *dev; -@@ -137,8 +139,10 @@ GuessProtocol(InputInfoPtr pInfo, int fl - } - } - -- if (strcmp(realdev, DEFAULT_PS2_DEV) == 0) -- proto = MOUSE_PROTO_PS2; -+ if (strcmp(realdev, DEFAULT_MOUSE_DEV) == 0) -+ proto = MOUSE_PROTO_EXPPS2; -+ else if (strcmp(realdev, DEFAULT_PS2_DEV) == 0) -+ proto = MOUSE_PROTO_EXPPS2; - else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0) - proto = MOUSE_PROTO_MSC; - else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0) -@@ -171,15 +175,14 @@ GuessProtocol(InputInfoPtr pInfo, int fl - close(fd); - } - if (proto == MOUSE_PROTO_UNKNOWN) { -- xf86Msg(X_ERROR, "%s: GuessProtocol: Cannot find mouse protocol.\n", -+ xf86Msg(X_ERROR, "%s: Cannot find mouse protocol.\n", - pInfo->name); - return NULL; - } else { - for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) { - if (devproto[i].proto == proto) { - xf86Msg(X_INFO, -- "%s: GuessProtocol: " -- "setting mouse protocol to \"%s\"\n", -+ "%s: Setting mouse protocol to \"%s\"\n", - pInfo->name, devproto[i].name); - return devproto[i].name; - } -@@ -188,6 +191,18 @@ GuessProtocol(InputInfoPtr pInfo, int fl - return NULL; - } - -+static const char * -+GuessProtocol(InputInfoPtr pInfo, int flags) -+{ -+ return lnxMouseMagic(pInfo); -+} -+ -+static const char * -+SetupAuto(InputInfoPtr pInfo, int *protoPara) -+{ -+ return lnxMouseMagic(pInfo); -+} -+ - _X_EXPORT OSMouseInfoPtr - xf86OSMouseInit(int flags) - { -@@ -200,6 +215,7 @@ xf86OSMouseInit(int flags) - p->DefaultProtocol = DefaultProtocol; - p->FindDevice = FindDevice; - p->GuessProtocol = GuessProtocol; -+ p->SetupAuto = SetupAuto; - return p; - } - diff --git a/xserver-1.3.0-composite-version.patch b/xserver-1.3.0-composite-version.patch deleted file mode 100644 index 00d685c..0000000 --- a/xserver-1.3.0-composite-version.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -up xorg-server-1.3.0.0/composite/compext.c.jx xorg-server-1.3.0.0/composite/compext.c ---- xorg-server-1.3.0.0/composite/compext.c.jx 2007-07-12 09:30:39.000000000 -0400 -+++ xorg-server-1.3.0.0/composite/compext.c 2007-07-12 09:33:45.000000000 -0400 -@@ -49,6 +49,9 @@ - - #include "compint.h" - -+#define SERVER_COMPOSITE_MAJOR 0 -+#define SERVER_COMPOSITE_MINOR 3 -+ - static CARD8 CompositeReqCode; - int CompositeClientPrivateIndex; - RESTYPE CompositeClientWindowType; -@@ -133,16 +136,16 @@ ProcCompositeQueryVersion (ClientPtr cli - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; -- if (stuff->majorVersion < COMPOSITE_MAJOR) { -+ if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR) { - rep.majorVersion = stuff->majorVersion; - rep.minorVersion = stuff->minorVersion; - } else { -- rep.majorVersion = COMPOSITE_MAJOR; -- if (stuff->majorVersion == COMPOSITE_MAJOR && -- stuff->minorVersion < COMPOSITE_MINOR) -+ rep.majorVersion = SERVER_COMPOSITE_MAJOR; -+ if (stuff->majorVersion == SERVER_COMPOSITE_MAJOR && -+ stuff->minorVersion < SERVER_COMPOSITE_MINOR) - rep.minorVersion = stuff->minorVersion; - else -- rep.minorVersion = COMPOSITE_MINOR; -+ rep.minorVersion = SERVER_COMPOSITE_MINOR; - } - pCompositeClient->major_version = rep.majorVersion; - pCompositeClient->minor_version = rep.minorVersion; diff --git a/xserver-1.3.0-exaupgrade.patch b/xserver-1.3.0-exaupgrade.patch deleted file mode 100644 index 968e814..0000000 --- a/xserver-1.3.0-exaupgrade.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff --git a/exa/exa.c b/exa/exa.c -index e9f42df..8e22b89 100644 ---- a/exa/exa.c -+++ b/exa/exa.c -@@ -126,7 +126,7 @@ exaGetDrawablePixmap(DrawablePtr pDrawable) - * the backing drawable. These coordinates are nonzero only for redirected - * windows. - */ --static void -+void - exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap, - int *xp, int *yp) - { -@@ -172,29 +172,6 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) - REGION_UNINIT(pScreen, ®ion); - } - --/** -- * exaDrawableDirty() marks a pixmap backing a drawable as dirty, allowing for -- * optimizations in pixmap migration when no changes have occurred. -- */ --void --exaDrawableDirty (DrawablePtr pDrawable, int x1, int y1, int x2, int y2) --{ -- PixmapPtr pPix = exaGetDrawablePixmap(pDrawable); -- int xoff, yoff; -- -- x1 = max(x1, pDrawable->x); -- y1 = max(y1, pDrawable->y); -- x2 = min(x2, pDrawable->x + pDrawable->width); -- y2 = min(y2, pDrawable->y + pDrawable->height); -- -- if (x1 >= x2 || y1 >= y2) -- return; -- -- exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff); -- -- exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); --} -- - static Bool - exaDestroyPixmap (PixmapPtr pPixmap) - { -@@ -322,6 +299,9 @@ exaPixmapIsOffscreen(PixmapPtr p) - if (p->devPrivate.ptr == NULL) - return TRUE; - -+ if (pExaScr->info->PixmapIsOffscreen) -+ return pExaScr->info->PixmapIsOffscreen(p); -+ - return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - - (CARD8 *) pExaScr->info->memoryBase) < - pExaScr->info->memorySize); -@@ -589,6 +569,45 @@ exaDriverInit (ScreenPtr pScreen, - PictureScreenPtr ps; - #endif - -+ if (!pScreenInfo) -+ return FALSE; -+ -+ if (!pScreenInfo->memoryBase) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memoryBase must be " -+ "non-zero\n", pScreen->myNum); -+ return FALSE; -+ } -+ -+ if (!pScreenInfo->memorySize) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memorySize must be " -+ "non-zero\n", pScreen->myNum); -+ return FALSE; -+ } -+ -+ if (pScreenInfo->offScreenBase > pScreenInfo->memorySize) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::offScreenBase must be <= " -+ "ExaDriverRec::memorySize\n", pScreen->myNum); -+ return FALSE; -+ } -+ -+ if (!pScreenInfo->PrepareSolid) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareSolid must be " -+ "non-NULL\n", pScreen->myNum); -+ return FALSE; -+ } -+ -+ if (!pScreenInfo->PrepareCopy) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareCopy must be " -+ "non-NULL\n", pScreen->myNum); -+ return FALSE; -+ } -+ -+ if (!pScreenInfo->WaitMarker) { -+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::WaitMarker must be " -+ "non-NULL\n", pScreen->myNum); -+ return FALSE; -+ } -+ - if (pScreenInfo->exa_major != EXA_VERSION_MAJOR || - pScreenInfo->exa_minor > EXA_VERSION_MINOR) - { -@@ -668,10 +687,6 @@ exaDriverInit (ScreenPtr pScreen, - } - #endif - --#ifdef COMPOSITE -- miDisableCompositeWrapper(pScreen); --#endif -- - #ifdef MITSHM - /* Re-register with the MI funcs, which don't allow shared pixmaps. - * Shared pixmaps are almost always a performance loss for us, but this -diff --git a/exa/exa.h b/exa/exa.h -index bf723f7..9ea5933 100644 ---- a/exa/exa.h -+++ b/exa/exa.h -@@ -39,7 +39,7 @@ - #include "fb.h" - - #define EXA_VERSION_MAJOR 2 --#define EXA_VERSION_MINOR 1 -+#define EXA_VERSION_MINOR 2 - #define EXA_VERSION_RELEASE 0 - - typedef struct _ExaOffscreenArea ExaOffscreenArea; -@@ -229,7 +229,7 @@ typedef struct _ExaDriver { - * @{ - */ - /** -- * PrepareCopy() sets up the driver for doing a copy within offscreen -+ * PrepareCopy() sets up the driver for doing a copy within video - * memory. - * - * @param pSrcPixmap source pixmap -@@ -636,6 +636,23 @@ typedef struct _ExaDriver { - */ - void (*FinishAccess)(PixmapPtr pPix, int index); - -+ /** -+ * PixmapIsOffscreen() is an optional driver replacement to -+ * exaPixmapIsOffscreen(). Set to NULL if you want the standard behaviour -+ * of exaPixmapIsOffscreen(). -+ * -+ * @param pPix the pixmap -+ * @return TRUE if the given drawable is in framebuffer memory. -+ * -+ * exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen -+ * memory, meaning that acceleration could probably be done to it, and that it -+ * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it -+ * with the CPU. -+ * -+ * -+ */ -+ Bool (*PixmapIsOffscreen)(PixmapPtr pPix); -+ - /** @name PrepareAccess() and FinishAccess() indices - * @{ - */ -@@ -704,6 +721,9 @@ exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, - ExaOffscreenArea * - exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area); - -+void -+ExaOffscreenMarkUsed (PixmapPtr pPixmap); -+ - unsigned long - exaGetPixmapOffset(PixmapPtr pPix); - -diff --git a/exa/exa_accel.c b/exa/exa_accel.c -index e633d80..cc383cc 100644 ---- a/exa/exa_accel.c -+++ b/exa/exa_accel.c -@@ -74,6 +74,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, - pGC->planemask, - pGC->fgPixel)) - { -+ exaDoMigration (pixmaps, 1, FALSE); - ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); - return; - } -@@ -109,8 +110,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, - (*pExaScr->info->Solid) (pPixmap, - fullX1 + off_x, fullY1 + off_y, - fullX2 + off_x, fullY1 + 1 + off_y); -- exaPixmapDirty (pPixmap, fullX1 + off_x, fullY1 + off_y, -- fullX2 + off_x, fullY1 + 1 + off_y); - } - else - { -@@ -129,8 +128,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, - (*pExaScr->info->Solid) (pPixmap, - partX1 + off_x, fullY1 + off_y, - partX2 + off_x, fullY1 + 1 + off_y); -- exaPixmapDirty (pPixmap, partX1 + off_x, fullY1 + off_y, -- partX2 + off_x, fullY1 + 1 + off_y); - } - } - pbox++; -@@ -154,8 +151,9 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int xoff, yoff; - int src_stride, bpp = pDrawable->bitsPerPixel; - -- if (pExaScr->swappedOut || pExaScr->info->UploadToScreen == NULL) -- goto migrate_and_fallback; -+ pixmaps[0].as_dst = TRUE; -+ pixmaps[0].as_src = FALSE; -+ pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - - /* Don't bother with under 8bpp, XYPixmaps. */ - if (format != ZPixmap || bpp < 8) -@@ -165,10 +163,14 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) - goto migrate_and_fallback; - -- pixmaps[0].as_dst = TRUE; -- pixmaps[0].as_src = FALSE; -- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); -+ if (pExaScr->swappedOut) -+ goto fallback; -+ - exaDoMigration (pixmaps, 1, TRUE); -+ -+ if (pExaScr->info->UploadToScreen == NULL) -+ goto fallback; -+ - pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); - - if (pPix == NULL) -@@ -221,25 +223,23 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - - fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)), - src_stride / sizeof(FbStip), -- (x1 - x) * bpp, -- dst + (y1 + yoff) * dst_stride, -+ (x1 - x) * dstBpp, -+ dst + (y1 + dstYoff) * dst_stride, - dst_stride, -- (x1 + xoff) * bpp, -- (x2 - x1) * bpp, -+ (x1 + dstXoff) * dstBpp, -+ (x2 - x1) * dstBpp, - y2 - y1, -- GXcopy, FB_ALLONES, bpp); -+ GXcopy, FB_ALLONES, dstBpp); - - exaFinishAccess(pDrawable, EXA_PREPARE_DEST); - } -+ - exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); - } - - return; - - migrate_and_fallback: -- pixmaps[0].as_dst = TRUE; -- pixmaps[0].as_src = FALSE; -- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); - - fallback: -@@ -387,6 +387,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, - int src_off_x, src_off_y; - int dst_off_x, dst_off_y; - ExaMigrationRec pixmaps[2]; -+ Bool fallback = FALSE; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; -@@ -404,62 +405,64 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, - pDstPixmap->drawable.width > pExaScr->info->maxX || - pDstPixmap->drawable.height > pExaScr->info->maxY) - { -- exaDoMigration (pixmaps, 2, FALSE); -- goto fallback; -+ fallback = TRUE; - } else { - exaDoMigration (pixmaps, 2, TRUE); - } - - /* Mixed directions must be handled specially if the card is lame */ -- if (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS && -+ if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && - reverse != upsidedown) { -- if (!exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, -+ if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, - dx, dy)) -- goto fallback; -- return; -+ return; -+ fallback = TRUE; -+ } -+ -+ pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); -+ pDstPixmap = exaGetDrawablePixmap (pDstDrawable); -+ -+ exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); -+ exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); -+ -+ if (fallback || !exaPixmapIsOffscreen(pSrcPixmap) || -+ !exaPixmapIsOffscreen(pDstPixmap) || -+ !(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1, -+ upsidedown ? -1 : 1, -+ pGC ? pGC->alu : GXcopy, -+ pGC ? pGC->planemask : FB_ALLONES)) { -+ fallback = TRUE; -+ EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, -+ exaDrawableLocation(pSrcDrawable), -+ exaDrawableLocation(pDstDrawable))); -+ exaDoMigration (pixmaps, 2, FALSE); -+ exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); -+ exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); -+ fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, -+ pbox, nbox, dx, dy, reverse, upsidedown, -+ bitplane, closure); -+ exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); -+ exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); - } - -- if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) && -- (pDstPixmap = exaGetOffscreenPixmap (pDstDrawable, &dst_off_x, &dst_off_y)) && -- (*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, -- reverse ? -1 : 1, upsidedown ? -1 : 1, -- pGC ? pGC->alu : GXcopy, -- pGC ? pGC->planemask : FB_ALLONES)) -+ while (nbox--) - { -- while (nbox--) -- { -+ if (!fallback) - (*pExaScr->info->Copy) (pDstPixmap, - pbox->x1 + dx + src_off_x, - pbox->y1 + dy + src_off_y, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, -- pbox->x2 - pbox->x1, -- pbox->y2 - pbox->y1); -- exaPixmapDirty (pDstPixmap, -- pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, -- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); -- pbox++; -- } -- (*pExaScr->info->DoneCopy) (pDstPixmap); -- exaMarkSync(pDstDrawable->pScreen); -- return; -- } -- --fallback: -- EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, -- exaDrawableLocation(pSrcDrawable), -- exaDrawableLocation(pDstDrawable))); -- exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); -- exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); -- fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, -- pbox, nbox, dx, dy, reverse, upsidedown, -- bitplane, closure); -- exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); -- exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); -- while (nbox--) -- { -- exaDrawableDirty (pDstDrawable, pbox->x1, pbox->y1, pbox->x2, pbox->y2); -+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); -+ exaPixmapDirty (pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, -+ pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); - pbox++; - } -+ -+ if (fallback) -+ return; -+ -+ (*pExaScr->info->DoneCopy) (pDstPixmap); -+ exaMarkSync (pDstDrawable->pScreen); - } - - RegionPtr -@@ -618,6 +621,9 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg, - DEALLOCATE_LOCAL(prect); - } - -+static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, -+ Pixel pixel, CARD32 planemask, CARD32 alu); -+ - static void - exaPolyFillRect(DrawablePtr pDrawable, - GCPtr pGC, -@@ -626,7 +632,7 @@ exaPolyFillRect(DrawablePtr pDrawable, - { - ExaScreenPriv (pDrawable->pScreen); - RegionPtr pClip = fbGetCompositeClip(pGC); -- PixmapPtr pPixmap; -+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); - register BoxPtr pbox; - BoxPtr pextent; - int extentX1, extentX2, extentY1, extentY2; -@@ -635,40 +641,73 @@ exaPolyFillRect(DrawablePtr pDrawable, - int xoff, yoff; - int xorg, yorg; - int n; -- ExaMigrationRec pixmaps[1]; -+ ExaMigrationRec pixmaps[2]; -+ RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED); -+ -+ /* Compute intersection of rects and clip region */ -+ REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y); -+ REGION_INTERSECT(pScreen, pReg, pClip, pReg); -+ -+ if (!REGION_NUM_RECTS(pReg)) { -+ goto out; -+ } - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; -- pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); -+ pixmaps[0].pPix = pPixmap; - -+ exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); -+ - if (pExaScr->swappedOut || -- pGC->fillStyle != FillSolid || - pPixmap->drawable.width > pExaScr->info->maxX || - pPixmap->drawable.height > pExaScr->info->maxY) - { -- exaDoMigration (pixmaps, 1, FALSE); -- ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect); -- while (nrect-- >= 0) { -- exaDrawableDirty(pDrawable, -- pDrawable->x + prect->x, -- pDrawable->y + prect->y, -- pDrawable->x + prect->x + prect->width, -- pDrawable->y + prect->y + prect->height); -- prect++; -+ goto fallback; -+ } -+ -+ /* For ROPs where overlaps don't matter, convert rectangles to region and -+ * call exaFillRegion{Solid,Tiled}. -+ */ -+ if ((pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) && -+ (pGC->alu == GXcopy || pGC->alu == GXclear || pGC->alu == GXnoop || -+ pGC->alu == GXcopyInverted || pGC->alu == GXset)) { -+ if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) && -+ exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ? -+ pGC->fgPixel : pGC->tile.pixel, pGC->planemask, -+ pGC->alu)) || -+ (pGC->fillStyle == FillTiled && !pGC->tileIsPixel && -+ exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg, -+ pGC->planemask, pGC->alu))) { -+ goto out; - } -- return; -- } else { -- exaDoMigration (pixmaps, 1, TRUE); - } - -- if (!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || -+ if (pGC->fillStyle != FillSolid && -+ !(pGC->tileIsPixel && pGC->fillStyle == FillTiled)) -+ { -+ goto fallback; -+ } -+ -+ exaDoMigration (pixmaps, 1, TRUE); -+ -+ if (!exaPixmapIsOffscreen (pPixmap) || - !(*pExaScr->info->PrepareSolid) (pPixmap, - pGC->alu, - pGC->planemask, - pGC->fgPixel)) - { -+fallback: -+ if (pGC->fillStyle == FillTiled && !pGC->tileIsPixel) { -+ pixmaps[1].as_dst = FALSE; -+ pixmaps[1].as_src = TRUE; -+ pixmaps[1].pPix = pGC->tile.pixmap; -+ exaDoMigration (pixmaps, 2, FALSE); -+ } else { -+ exaDoMigration (pixmaps, 1, FALSE); -+ } -+ - ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect); -- return; -+ goto out; - } - - xorg = pDrawable->x; -@@ -707,15 +746,14 @@ exaPolyFillRect(DrawablePtr pDrawable, - (*pExaScr->info->Solid) (pPixmap, - fullX1 + xoff, fullY1 + yoff, - fullX2 + xoff, fullY2 + yoff); -- exaPixmapDirty (pPixmap, fullX1 + xoff, fullY1 + yoff, -- fullX2 + xoff, fullY2 + yoff); - } - else - { - pbox = REGION_RECTS(pClip); - /* - * clip the rectangle to each box in the clip region -- * this is logically equivalent to calling Intersect() -+ * this is logically equivalent to calling Intersect(), -+ * but rectangles may overlap each other here. - */ - while(n--) - { -@@ -738,14 +776,15 @@ exaPolyFillRect(DrawablePtr pDrawable, - (*pExaScr->info->Solid) (pPixmap, - partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); -- exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, -- partX2 + xoff, partY2 + yoff); - } - } - } - } - (*pExaScr->info->DoneSolid) (pPixmap); - exaMarkSync(pDrawable->pScreen); -+ -+out: -+ REGION_DESTROY(pScreen, pReg); - } - - static void -@@ -775,20 +814,19 @@ exaSolidBoxClipped (DrawablePtr pDrawable, - pPixmap->drawable.width > pExaScr->info->maxX || - pPixmap->drawable.height > pExaScr->info->maxY) - { -- exaDoMigration (pixmaps, 1, FALSE); -- goto fallback; -+ fallback = TRUE; - } else { - exaDoMigration (pixmaps, 1, TRUE); - } - -- pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); -+ exaGetDrawableDeltas (pDrawable, pPixmap, &xoff, &yoff); - -- if (!pPixmap || -+ if (fallback || !exaPixmapIsOffscreen(pPixmap) || - !(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg)) - { --fallback: - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); -+ exaDoMigration (pixmaps, 1, FALSE); - fallback = TRUE; - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); -@@ -827,10 +865,10 @@ fallback: - (*pExaScr->info->Solid) (pPixmap, - partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); -- exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, -- partX2 + xoff, partY2 + yoff); -- } else -- exaDrawableDirty (pDrawable, partX1, partY1, partX2, partY2); -+ } -+ -+ exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff, -+ partY2 + yoff); - } - - if (fallback) -@@ -870,12 +908,36 @@ exaImageGlyphBlt (DrawablePtr pDrawable, - int dstBpp; - int dstXoff, dstYoff; - FbBits depthMask; -+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); -+ ExaMigrationRec pixmaps[1]; -+ int xBack, widthBack, yBack, heightBack; -+ -+ for (ppci = ppciInit, n = nglyph, widthBack = 0; n; n--) -+ widthBack += (*ppci++)->metrics.characterWidth; -+ -+ xBack = x; -+ if (widthBack < 0) -+ { -+ xBack += widthBack; -+ widthBack = -widthBack; -+ } -+ yBack = y - FONTASCENT(pGC->font); -+ heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); -+ -+ if (xBack >= pDrawable->width || yBack >= pDrawable->height || -+ (xBack + widthBack) <= 0 || (yBack + heightBack) <= 0) -+ return; -+ -+ pixmaps[0].as_dst = TRUE; -+ pixmaps[0].as_src = TRUE; -+ pixmaps[0].pPix = pPixmap; - - depthMask = FbFullMask(pDrawable->depth); - if ((pGC->planemask & depthMask) != depthMask) - { -+ exaDoMigration(pixmaps, 1, FALSE); - ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); -- return; -+ goto damage; - } - glyph = NULL; - switch (pDrawable->bitsPerPixel) { -@@ -887,6 +949,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable, - - x += pDrawable->x; - y += pDrawable->y; -+ xBack += pDrawable->x; -+ yBack += pDrawable->y; - - if (TERMINALFONT (pGC->font) && !glyph) - { -@@ -894,23 +958,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, - } - else - { -- int xBack, widthBack; -- int yBack, heightBack; -- -- ppci = ppciInit; -- n = nglyph; -- widthBack = 0; -- while (n--) -- widthBack += (*ppci++)->metrics.characterWidth; -- -- xBack = x; -- if (widthBack < 0) -- { -- xBack += widthBack; -- widthBack = -widthBack; -- } -- yBack = y - FONTASCENT(pGC->font); -- heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - exaSolidBoxClipped (pDrawable, - fbGetCompositeClip(pGC), - pGC->planemask, -@@ -923,74 +970,50 @@ exaImageGlyphBlt (DrawablePtr pDrawable, - } - - EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); -+ exaDoMigration(pixmaps, 1, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - exaPrepareAccessGC (pGC); - - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - -- ppci = ppciInit; -- while (nglyph--) -+ for (ppci = ppciInit; nglyph; nglyph--, x += pci->metrics.characterWidth) - { - pci = *ppci++; -- pglyph = FONTGLYPHBITS(pglyphBase, pci); - gWidth = GLYPHWIDTHPIXELS(pci); - gHeight = GLYPHHEIGHTPIXELS(pci); -- if (gWidth && gHeight) -+ gx = x + pci->metrics.leftSideBearing; -+ gy = y - pci->metrics.ascent; -+ -+ if (!gWidth || !gHeight || (gx + gWidth) <= xBack || -+ (gy + gHeight) <= yBack || gx >= (xBack + widthBack) || -+ gy >= (yBack + heightBack)) -+ continue; -+ -+ pglyph = FONTGLYPHBITS(pglyphBase, pci); -+ -+ if (glyph && gWidth <= sizeof (FbStip) * 8 && -+ fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) - { -- gx = x + pci->metrics.leftSideBearing; -- gy = y - pci->metrics.ascent; -- if (glyph && gWidth <= sizeof (FbStip) * 8 && -- fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) -- { -- (*glyph) (dst + (gy + dstYoff) * dstStride, -- dstStride, -- dstBpp, -- (FbStip *) pglyph, -- pPriv->fg, -- gx + dstXoff, -- gHeight); -- exaDrawableDirty (pDrawable, gx, gy, gx + gWidth, gy + gHeight); -- } -- else -- { -- RegionPtr pClip = fbGetCompositeClip(pGC); -- int nbox; -- BoxPtr pbox; -- -- gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); -- fbPutXYImage (pDrawable, -- pClip, -- pPriv->fg, -- pPriv->bg, -- pPriv->pm, -- GXcopy, -- opaque, -- -- gx, -- gy, -- gWidth, gHeight, -- -- (FbStip *) pglyph, -- gStride, -- 0); -- -- for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); -- nbox--; pbox++) { -- int x1 = max(gx, pbox->x1), x2 = min(gx + gWidth, pbox->x2); -- int y1 = max(gy, pbox->y1), y2 = min(gy + gHeight, pbox->y2); -- -- if (x1 >= x2 || y1 >= y2) -- continue; -- -- exaDrawableDirty (pDrawable, gx, gy, gx + gWidth, -- gy + gHeight); -- } -- } -+ (*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp, -+ (FbStip *) pglyph, pPriv->fg, gx + dstXoff, gHeight); -+ } -+ else -+ { -+ RegionPtr pClip = fbGetCompositeClip(pGC); -+ -+ gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); -+ fbPutXYImage (pDrawable, pClip, pPriv->fg, pPriv->bg, pPriv->pm, -+ GXcopy, opaque, gx, gy, gWidth, gHeight, -+ (FbStip *) pglyph, gStride, 0); - } -- x += pci->metrics.characterWidth; - } - exaFinishAccessGC (pGC); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); -+ -+damage: -+ exaGetDrawableDeltas(pDrawable, pPixmap, &dstXoff, &dstYoff); -+ exaPixmapDirty(pPixmap, xBack + dstXoff, yBack + dstYoff, -+ xBack + dstXoff + widthBack, yBack + dstYoff + heightBack); - } - - const GCOps exaOps = { -@@ -1043,10 +1066,12 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); - } - --static void -+static Bool - exaFillRegionSolid (DrawablePtr pDrawable, - RegionPtr pRegion, -- Pixel pixel) -+ Pixel pixel, -+ CARD32 planemask, -+ CARD32 alu) - { - ExaScreenPriv(pDrawable->pScreen); - PixmapPtr pPixmap; -@@ -1062,22 +1087,19 @@ exaFillRegionSolid (DrawablePtr pDrawable, - if (pPixmap->drawable.width > pExaScr->info->maxX || - pPixmap->drawable.height > pExaScr->info->maxY) - { -- exaDoMigration (pixmaps, 1, FALSE); - goto fallback; - } else { - exaDoMigration (pixmaps, 1, TRUE); - } - - if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && -- (*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel)) -+ (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel)) - { - while (nbox--) - { - (*pExaScr->info->Solid) (pPixmap, - pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); -- exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff, -- pBox->x2 + xoff, pBox->y2 + yoff); - pBox++; - } - (*pExaScr->info->DoneSolid) (pPixmap); -@@ -1086,27 +1108,30 @@ exaFillRegionSolid (DrawablePtr pDrawable, - else - { - fallback: -+ if (alu != GXcopy || planemask != FB_ALLONES) -+ return FALSE; - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); -+ exaDoMigration (pixmaps, 1, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - fbFillRegionSolid (pDrawable, pRegion, 0, - fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); -- while (nbox--) -- { -- exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2); -- pBox++; -- } - } -+ -+ return TRUE; - } - - /* Try to do an accelerated tile of the pTile into pRegion of pDrawable. - * Based on fbFillRegionTiled(), fbTile(). - */ --static void -+Bool - exaFillRegionTiled (DrawablePtr pDrawable, - RegionPtr pRegion, -- PixmapPtr pTile) -+ PixmapPtr pTile, -+ DDXPointPtr pPatOrg, -+ CARD32 planemask, -+ CARD32 alu) - { - ExaScreenPriv(pDrawable->pScreen); - PixmapPtr pPixmap; -@@ -1122,10 +1147,10 @@ exaFillRegionTiled (DrawablePtr pDrawable, - /* If we're filling with a solid color, grab it out and go to - * FillRegionSolid, saving numerous copies. - */ -- if (tileWidth == 1 && tileHeight == 1) { -- exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel (pTile)); -- return; -- } -+ if (tileWidth == 1 && tileHeight == 1) -+ return exaFillRegionSolid(pDrawable, pRegion, -+ exaGetPixmapFirstPixel (pTile), planemask, -+ alu); - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; -@@ -1139,7 +1164,6 @@ exaFillRegionTiled (DrawablePtr pDrawable, - tileWidth > pExaScr->info->maxX || - tileHeight > pExaScr->info->maxY) - { -- exaDoMigration (pixmaps, 2, FALSE); - goto fallback; - } else { - exaDoMigration (pixmaps, 2, TRUE); -@@ -1153,8 +1177,9 @@ exaFillRegionTiled (DrawablePtr pDrawable, - if (!exaPixmapIsOffscreen(pTile)) - goto fallback; - -- if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile, &tileXoff, &tileYoff), pPixmap, 0, 0, GXcopy, -- FB_ALLONES)) -+ if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile, -+ &tileXoff, &tileYoff), -+ pPixmap, 0, 0, alu, planemask)) - { - while (nbox--) - { -@@ -1162,7 +1187,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, - int dstY = pBox->y1; - int tileY; - -- tileY = (dstY - pDrawable->y) % tileHeight; -+ tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight; - while (height > 0) { - int width = pBox->x2 - pBox->x1; - int dstX = pBox->x1; -@@ -1173,7 +1198,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, - h = height; - height -= h; - -- tileX = (dstX - pDrawable->x) % tileWidth; -+ tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth; - while (width > 0) { - int w = tileWidth - tileX; - if (w > width) -@@ -1190,38 +1215,44 @@ exaFillRegionTiled (DrawablePtr pDrawable, - dstY += h; - tileY = 0; - } -- exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff, -- pBox->x2 + xoff, pBox->y2 + yoff); - pBox++; - } - (*pExaScr->info->DoneCopy) (pPixmap); - exaMarkSync(pDrawable->pScreen); -- return; -+ return TRUE; - } - - fallback: -+ if (alu != GXcopy || planemask != FB_ALLONES) -+ return FALSE; - EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, - exaDrawableLocation(&pTile->drawable), - exaDrawableLocation(pDrawable))); -+ exaDoMigration (pixmaps, 2, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); - fbFillRegionTiled (pDrawable, pRegion, pTile); - exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); -- while (nbox--) -- { -- exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2); -- pBox++; -- } -+ -+ return TRUE; - } - - void - exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) - { - ExaScreenPriv (pWin->drawable.pScreen); -- if (!REGION_NUM_RECTS(pRegion)) -+ PixmapPtr pPixmap = exaGetDrawablePixmap((DrawablePtr)pWin); -+ int xoff, yoff; -+ BoxPtr pBox; -+ int nbox = REGION_NUM_RECTS(pRegion); -+ -+ if (!nbox) - return; -+ - if (!pExaScr->swappedOut) { -+ DDXPointRec zeros = { 0, 0 }; -+ - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { -@@ -1235,25 +1266,41 @@ exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) - what); - return; - case BackgroundPixel: -- exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel); -- return; -+ exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel, -+ FB_ALLONES, GXcopy); -+ goto damage; - case BackgroundPixmap: -- exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap); -- return; -+ exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap, -+ &zeros, FB_ALLONES, GXcopy); -+ goto damage; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { -- exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel); -- return; -+ exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel, -+ FB_ALLONES, GXcopy); -+ goto damage; - } else { -- exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap); -- return; -+ exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap, -+ &zeros, FB_ALLONES, GXcopy); -+ goto damage; - } - break; - } - } - ExaCheckPaintWindow (pWin, pRegion, what); -+ -+damage: -+ exaGetDrawableDeltas((DrawablePtr)pWin, pPixmap, &xoff, &yoff); -+ -+ pBox = REGION_RECTS(pRegion); -+ -+ while (nbox--) -+ { -+ exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff, -+ pBox->x2 + xoff, pBox->y2 + yoff); -+ pBox++; -+ } - } - - /** -@@ -1273,27 +1320,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, - int xoff, yoff; - Bool ok; - -- if (pExaScr->swappedOut || pExaScr->info->DownloadFromScreen == NULL) -+ if (pExaScr->swappedOut || (w == 1 && h == 1)) - goto fallback; - -+ if (pExaScr->info->DownloadFromScreen == NULL) -+ goto migrate_and_fallback; -+ - /* Only cover the ZPixmap, solid copy case. */ - if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask)) -- goto fallback; -+ goto migrate_and_fallback; - - /* Only try to handle the 8bpp and up cases, since we don't want to think - * about <8bpp. - */ - if (pDrawable->bitsPerPixel < 8) -- goto fallback; -+ goto migrate_and_fallback; - -- /* Migrate, but assume that we could accelerate the download. It is up to -- * the migration scheme to ensure that this case doesn't result in bad -- * moving of pixmaps. -- */ -- pixmaps[0].as_dst = FALSE; -- pixmaps[0].as_src = TRUE; -- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); -- exaDoMigration (pixmaps, 1, TRUE); - pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); - if (pPix == NULL) - goto fallback; -@@ -1308,12 +1350,12 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, - return; - } - --fallback: -+migrate_and_fallback: - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); -- -+fallback: - ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d); - } - -diff --git a/exa/exa_migration.c b/exa/exa_migration.c -index eedc5fd..70d8e12 100644 ---- a/exa/exa_migration.c -+++ b/exa/exa_migration.c -@@ -464,12 +464,10 @@ exaAssertNotDirty (PixmapPtr pPixmap) - BoxPtr pBox = REGION_RECTS(pValidReg); - Bool ret = TRUE; - -- if (pExaPixmap == NULL || pExaPixmap->fb_ptr == NULL) -+ if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL) - return ret; - -- dst = pExaPixmap->sys_ptr; - dst_pitch = pExaPixmap->sys_pitch; -- src = pExaPixmap->fb_ptr; - src_pitch = pExaPixmap->fb_pitch; - cpp = pPixmap->drawable.bitsPerPixel / 8; - -@@ -486,21 +484,18 @@ exaAssertNotDirty (PixmapPtr pPixmap) - continue; - - rowbytes = (pBox->x2 - pBox->x1) * cpp; -- src += pBox->y1 * src_pitch + pBox->x1 * cpp; -- dst += pBox->y1 * dst_pitch + pBox->x1 * cpp; -+ src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp; -+ dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp; - -- for (y = pBox->y2 - pBox->y1; y; y--) { -- if (memcmp(dst + pBox->y1 * dst_pitch + pBox->x1 * cpp, -- src + pBox->y1 * src_pitch + pBox->x1 * cpp, -- (pBox->x2 - pBox->x1) * cpp) != 0) { -+ for (y = pBox->y1; y < pBox->y2; -+ y++, src += src_pitch, dst += dst_pitch) { -+ if (memcmp(dst, src, rowbytes) != 0) { - ret = FALSE; -+ exaPixmapDirty(pPixmap, pBox->x1, pBox->y1, pBox->x2, -+ pBox->y2); - break; - } -- src += src_pitch; -- dst += dst_pitch; - } -- src -= pBox->y1 * src_pitch + pBox->x1 * cpp; -- dst -= pBox->y1 * dst_pitch + pBox->x1 * cpp; - } - exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); - -diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c -index 7708dd7..c666b00 100644 ---- a/exa/exa_offscreen.c -+++ b/exa/exa_offscreen.c -@@ -54,7 +54,7 @@ ExaOffscreenValidate (ScreenPtr pScreen) - assert (area->offset >= area->base_offset && - area->offset < (area->base_offset + area->size)); - if (prev) -- assert (prev->base_offset + prev->area.size == area->base_offset); -+ assert (prev->base_offset + prev->size == area->base_offset); - prev = area; - } - assert (prev->base_offset + prev->size == pExaScr->info->memorySize); -@@ -341,13 +341,15 @@ exaEnableDisableFBAccess (int index, Bool enable) - ScreenPtr pScreen = screenInfo.screens[index]; - ExaScreenPriv (pScreen); - -- if (!enable) { -+ if (!enable && pExaScr->disableFbCount++ == 0) { - if (pExaScr->info->exa_minor < 1) - ExaOffscreenSwapOut (pScreen); - else - ExaOffscreenEjectPixmaps (pScreen); - pExaScr->swappedOut = TRUE; -- } else { -+ } -+ -+ if (enable && --pExaScr->disableFbCount == 0) { - if (pExaScr->info->exa_minor < 1) - ExaOffscreenSwapIn (pScreen); - pExaScr->swappedOut = FALSE; -@@ -427,7 +429,7 @@ ExaOffscreenMarkUsed (PixmapPtr pPixmap) - ExaScreenPriv (pPixmap->drawable.pScreen); - static int iter = 0; - -- if (!pExaPixmap->area) -+ if (!pExaPixmap || !pExaPixmap->area) - return; - - /* The numbers here are arbitrary. We may want to tune these. */ -diff --git a/exa/exa_priv.h b/exa/exa_priv.h -index 984cb66..a6d98cd 100644 ---- a/exa/exa_priv.h -+++ b/exa/exa_priv.h -@@ -113,6 +113,7 @@ typedef struct { - enum ExaMigrationHeuristic migration; - Bool hideOffscreenPixmapData; - Bool checkDirtyCorrectness; -+ unsigned disableFbCount; - } ExaScreenPrivRec, *ExaScreenPrivPtr; - - /* -@@ -287,6 +288,10 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap); - void - exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - -+Bool -+exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, -+ DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu); -+ - void - exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - -@@ -318,9 +323,6 @@ ExaCheckComposite (CARD8 op, - - /* exa_offscreen.c */ - void --ExaOffscreenMarkUsed (PixmapPtr pPixmap); -- --void - ExaOffscreenSwapOut (ScreenPtr pScreen); - - void -@@ -343,7 +345,8 @@ void - exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2); - - void --exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2); -+exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap, -+ int *xp, int *yp); - - Bool - exaDrawableIsOffscreen (DrawablePtr pDrawable); -diff --git a/exa/exa_render.c b/exa/exa_render.c -index b78d728..5e7c67f 100644 ---- a/exa/exa_render.c -+++ b/exa/exa_render.c -@@ -297,15 +297,15 @@ exaTryDriverSolidFill(PicturePtr pSrc, - - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); -+ - while (nbox--) - { - (*pExaScr->info->Solid) (pDstPix, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); -- exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, -- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); - pbox++; - } -+ - (*pExaScr->info->DoneSolid) (pDstPix); - exaMarkSync(pDst->pDrawable->pScreen); - -@@ -446,8 +446,6 @@ exaTryDriverComposite(CARD8 op, - pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); -- exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, -- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); - pbox++; - } - (*pExaScr->info->DoneComposite) (pDstPix); -@@ -521,6 +519,9 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, - CARD16 height) - { - ExaScreenPriv (pDst->pDrawable->pScreen); -+ DrawablePtr pDstDraw = pDst->pDrawable; -+ PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDstDraw); -+ int xoff, yoff; - - assert(op == PictOpOver); - -@@ -539,6 +540,12 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, - exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, - xDst, yDst, width, height); - -+ exaGetDrawableDeltas(pDstDraw, pDstPixmap, &xoff, &yoff); -+ xoff += pDstDraw->x; -+ yoff += pDstDraw->y; -+ exaPixmapDirty(pDstPixmap, xDst + xoff, yDst + yoff, xDst + xoff + width, -+ yDst + yoff + height); -+ - /* Then, add in the source value times the destination alpha factors (1.0). - */ - exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, -@@ -565,6 +572,28 @@ exaComposite(CARD8 op, - int ret = -1; - Bool saveSrcRepeat = pSrc->repeat; - Bool saveMaskRepeat = pMask ? pMask->repeat : 0; -+ ExaMigrationRec pixmaps[3]; -+ int npixmaps = 1; -+ PixmapPtr pSrcPixmap = NULL; -+ -+ pixmaps[0].as_dst = TRUE; -+ pixmaps[0].as_src = exaOpReadsDestination(op); -+ pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); -+ -+ if (pSrc->pDrawable) { -+ pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable); -+ pixmaps[npixmaps].as_dst = FALSE; -+ pixmaps[npixmaps].as_src = TRUE; -+ pixmaps[npixmaps].pPix = pSrcPixmap; -+ npixmaps++; -+ } -+ -+ if (pMask && pMask->pDrawable) { -+ pixmaps[npixmaps].as_dst = FALSE; -+ pixmaps[npixmaps].as_src = TRUE; -+ pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable); -+ npixmaps++; -+ } - - /* We currently don't support acceleration of gradients, or other pictures - * with a NULL pDrawable. -@@ -583,19 +612,24 @@ exaComposite(CARD8 op, - - if (!pMask) - { -- if (op == PictOpSrc) -+ if ((op == PictOpSrc && -+ ((pSrc->format == pDst->format) || -+ (pSrc->format==PICT_a8r8g8b8 && pDst->format==PICT_x8r8g8b8) || -+ (pSrc->format==PICT_a8b8g8r8 && pDst->format==PICT_x8b8g8r8))) || -+ (op == PictOpOver && !pSrc->alphaMap && !pDst->alphaMap && -+ pSrc->format == pDst->format && -+ (pSrc->format==PICT_x8r8g8b8 || pSrc->format==PICT_x8b8g8r8))) - { - if (pSrc->pDrawable->width == 1 && -- pSrc->pDrawable->height == 1 && pSrc->repeat && -- pSrc->repeatType == RepeatNormal) -+ pSrc->pDrawable->height == 1 && -+ pSrc->repeat) - { - ret = exaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst, - width, height); - if (ret == 1) - goto done; - } -- else if (!pSrc->repeat && !pSrc->transform && -- pSrc->format == pDst->format) -+ else if (pSrcPixmap && !pSrc->repeat && !pSrc->transform) - { - RegionRec region; - -@@ -617,6 +651,45 @@ exaComposite(CARD8 op, - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - goto done; - } -+ else if (pSrcPixmap && !pSrc->transform && -+ pSrc->repeatType == RepeatNormal) -+ { -+ RegionRec region; -+ DDXPointRec srcOrg; -+ -+ /* Let's see if the driver can do the repeat in one go */ -+ if (pExaScr->info->PrepareComposite && !pSrc->alphaMap && -+ !pDst->alphaMap) -+ { -+ ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, -+ ySrc, xMask, yMask, xDst, yDst, -+ width, height); -+ if (ret == 1) -+ goto done; -+ } -+ -+ /* Now see if we can use exaFillRegionTiled() */ -+ xDst += pDst->pDrawable->x; -+ yDst += pDst->pDrawable->y; -+ xSrc += pSrc->pDrawable->x; -+ ySrc += pSrc->pDrawable->y; -+ -+ if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, -+ ySrc, xMask, yMask, xDst, yDst, -+ width, height)) -+ goto done; -+ -+ srcOrg.x = (xSrc - xDst) % pSrcPixmap->drawable.width; -+ srcOrg.y = (ySrc - yDst) % pSrcPixmap->drawable.height; -+ -+ ret = exaFillRegionTiled(pDst->pDrawable, ®ion, pSrcPixmap, -+ &srcOrg, FB_ALLONES, GXcopy); -+ -+ REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); -+ -+ if (ret) -+ goto done; -+ } - } - } - -@@ -627,8 +700,8 @@ exaComposite(CARD8 op, - pMask->repeat = 0; - - if (pExaScr->info->PrepareComposite && -- (!pSrc->repeat || pSrc->repeat == RepeatNormal) && -- (!pMask || !pMask->repeat || pMask->repeat == RepeatNormal) && -+ (!pSrc->repeat || pSrc->repeatType == RepeatNormal) && -+ (!pMask || !pMask->repeat || pMask->repeatType == RepeatNormal) && - !pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap) - { - Bool isSrcSolid; -@@ -660,39 +733,14 @@ exaComposite(CARD8 op, - } - } - -- if (ret != 0) { -- ExaMigrationRec pixmaps[3]; -- /* failure to accelerate was not due to pixmaps being in the wrong -- * locations. -- */ -- pixmaps[0].as_dst = TRUE; -- pixmaps[0].as_src = exaOpReadsDestination(op); -- pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); -- pixmaps[1].as_dst = FALSE; -- pixmaps[1].as_src = TRUE; -- pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable); -- if (pMask) { -- pixmaps[2].as_dst = FALSE; -- pixmaps[2].as_src = TRUE; -- pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable); -- exaDoMigration(pixmaps, 3, FALSE); -- } else { -- exaDoMigration(pixmaps, 2, FALSE); -- } -- } -- - fallback: - #if DEBUG_TRACE_FALL - exaPrintCompositeFallback (op, pSrc, pMask, pDst); - #endif - -+ exaDoMigration(pixmaps, npixmaps, FALSE); - ExaCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc, - xMask, yMask, xDst, yDst, width, height); -- exaDrawableDirty(pDst->pDrawable, -- pDst->pDrawable->x + xDst, -- pDst->pDrawable->y + yDst, -- pDst->pDrawable->x + xDst + width, -- pDst->pDrawable->y + yDst + height); - - done: - pSrc->repeat = saveSrcRepeat; -@@ -716,6 +764,7 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - { - DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; -+ int xoff, yoff; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; -@@ -724,8 +773,10 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbRasterizeTrapezoid(pPicture, trap, x_off, y_off); -- exaDrawableDirty(pDraw, pDraw->x, pDraw->y, -- pDraw->x + pDraw->width, pDraw->y + pDraw->height); -+ exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); -+ exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, -+ pDraw->x + xoff + pDraw->width, -+ pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); - } - -@@ -739,6 +790,7 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - { - DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; -+ int xoff, yoff; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; -@@ -747,8 +799,10 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbAddTriangles(pPicture, x_off, y_off, ntri, tris); -- exaDrawableDirty(pDraw, pDraw->x, pDraw->y, -- pDraw->x + pDraw->width, pDraw->y + pDraw->height); -+ exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); -+ exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, -+ pDraw->x + xoff + pDraw->width, -+ pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); - } - -@@ -845,10 +899,11 @@ exaGlyphs (CARD8 op, - PixmapPtr pPixmap = NULL; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = NULL; -+ PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable); - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; -- int x, y; -+ int x, y, x1, y1, xoff, yoff; - int xDst = list->xOff, yDst = list->yOff; - int n; - int error; -@@ -892,7 +947,12 @@ exaGlyphs (CARD8 op, - xRectangle rect; - - miGlyphExtents (nlist, list, glyphs, &extents); -- -+ -+ extents.x1 = max(extents.x1, 0); -+ extents.y1 = max(extents.y1, 0); -+ extents.x2 = min(extents.x2, pDst->pDrawable->width); -+ extents.y2 = min(extents.y2, pDst->pDrawable->height); -+ - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; -@@ -918,6 +978,7 @@ exaGlyphs (CARD8 op, - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); -+ exaPixmapDirty(pMaskPixmap, 0, 0, width, height); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; -@@ -929,6 +990,8 @@ exaGlyphs (CARD8 op, - y = 0; - } - -+ exaGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &xoff, &yoff); -+ - while (nlist--) - { - GCPtr pGC = NULL; -@@ -983,13 +1046,21 @@ exaGlyphs (CARD8 op, - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = pPixmap; -- exaDoMigration (pixmaps, 1, TRUE); -+ exaDoMigration (pixmaps, 1, pExaScr->info->PrepareComposite != NULL); - - while (n--) - { - GlyphPtr glyph = *glyphs++; - pointer glyphdata = (pointer) (glyph + 1); -- -+ DrawablePtr pCmpDrw = (maskFormat ? pMask : pDst)->pDrawable; -+ -+ x1 = x - glyph->info.x; -+ y1 = y - glyph->info.y; -+ -+ if (x1 >= pCmpDrw->width || y1 >= pCmpDrw->height || -+ (x1 + glyph->info.width) <= 0 || (y1 + glyph->info.height) <= 0) -+ goto nextglyph; -+ - (*pScreen->ModifyPixmapHeader) (pScratchPixmap, - glyph->info.width, - glyph->info.height, -@@ -1048,17 +1119,22 @@ exaGlyphs (CARD8 op, - if (maskFormat) - { - exaComposite (PictOpAdd, pPicture, NULL, pMask, 0, 0, 0, 0, -- x - glyph->info.x, y - glyph->info.y, -- glyph->info.width, glyph->info.height); -+ x1, y1, glyph->info.width, glyph->info.height); -+ exaPixmapDirty(pMaskPixmap, x1, y1, x1 + glyph->info.width, -+ y1 + glyph->info.height); - } - else - { - exaComposite (op, pSrc, pPicture, pDst, -- xSrc + (x - glyph->info.x) - xDst, -- ySrc + (y - glyph->info.y) - yDst, -- 0, 0, x - glyph->info.x, y - glyph->info.y, -- glyph->info.width, glyph->info.height); -+ xSrc + x1 - xDst, ySrc + y1 - yDst, -+ 0, 0, x1, y1, glyph->info.width, -+ glyph->info.height); -+ x1 += pDst->pDrawable->x + xoff; -+ y1 += pDst->pDrawable->y + yoff; -+ exaPixmapDirty(pDstPixmap, x1, y1, x1 + glyph->info.width, -+ y1 + glyph->info.height); - } -+nextglyph: - x += glyph->info.xOff; - y += glyph->info.yOff; - } -diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c -index 7713a08..b67ea63 100644 ---- a/exa/exa_unaccel.c -+++ b/exa/exa_unaccel.c -@@ -88,10 +88,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *bits) - { -+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); -+ int xoff, yoff; -+ - EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); -+ exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); -+ exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h); - } - - RegionPtr -@@ -201,32 +206,11 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, - { - EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - -- if (nrect) { -- int x1 = max(prect->x, 0), y1 = max(prect->y, 0); -- int x2 = min(prect->x + prect->width, pDrawable->width); -- int y2 = min(prect->y + prect->height, pDrawable->height); -- -- exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); -- exaPrepareAccessGC (pGC); -- fbPolyFillRect (pDrawable, pGC, nrect, prect); -- exaFinishAccessGC (pGC); -- exaFinishAccess (pDrawable, EXA_PREPARE_DEST); -- -- /* Only track bounding box of damage, as this path can degenerate to -- * zillions of damage boxes -- */ -- while (--nrect) -- { -- prect++; -- x1 = min(x1, prect->x); -- x2 = max(x2, prect->x + prect->width); -- y1 = min(y1, prect->y); -- y2 = max(y2, prect->y + prect->height); -- } -- -- exaDrawableDirty (pDrawable, pDrawable->x + x1, pDrawable->y + y1, -- pDrawable->x + x2, pDrawable->y + y2); -- } -+ exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); -+ exaPrepareAccessGC (pGC); -+ fbPolyFillRect (pDrawable, pGC, nrect, prect); -+ exaFinishAccessGC (pGC); -+ exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - } - - void -@@ -385,31 +369,48 @@ ExaCheckComposite (CARD8 op, - /** - * Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps - * that happen to be 1x1. Pixmap must be at least 8bpp. -+ * -+ * XXX This really belongs in fb, so it can be aware of tiling and etc. - */ - CARD32 - exaGetPixmapFirstPixel (PixmapPtr pPixmap) - { - CARD32 pixel; -+ void *fb; -+ Bool need_finish = FALSE; -+ BoxRec box; - ExaMigrationRec pixmaps[1]; -+ ExaPixmapPriv (pPixmap); -+ -+ /* Try to avoid framebuffer readbacks */ -+ if (exaPixmapIsOffscreen(pPixmap)) { -+ if (!miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) { -+ fb = pExaPixmap->sys_ptr; -+ } else { -+ need_finish = TRUE; -+ fb = pPixmap->devPrivate.ptr; -+ pixmaps[0].as_dst = FALSE; -+ pixmaps[0].as_src = TRUE; -+ pixmaps[0].pPix = pPixmap; -+ exaDoMigration (pixmaps, 1, FALSE); -+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); -+ } -+ } - -- pixmaps[0].as_dst = FALSE; -- pixmaps[0].as_src = TRUE; -- pixmaps[0].pPix = pPixmap; -- exaDoMigration (pixmaps, 1, FALSE); -- -- exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); - switch (pPixmap->drawable.bitsPerPixel) { - case 32: -- pixel = *(CARD32 *)(pPixmap->devPrivate.ptr); -+ pixel = *(CARD32 *)fb; - break; - case 16: -- pixel = *(CARD16 *)(pPixmap->devPrivate.ptr); -+ pixel = *(CARD16 *)fb; - break; - default: -- pixel = *(CARD8 *)(pPixmap->devPrivate.ptr); -+ pixel = *(CARD8 *)fb; - break; - } -- exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); -+ -+ if (need_finish) -+ exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); - - return pixel; - } diff --git a/xserver-1.3.0-fbdevhw-magic-numbers.patch b/xserver-1.3.0-fbdevhw-magic-numbers.patch deleted file mode 100644 index e02f115..0000000 --- a/xserver-1.3.0-fbdevhw-magic-numbers.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Fix magic number in fbdevhw - -The transformation between fbdev and xfree86 mode timings needs to be -invertible, otherwise Xen and other framebuffers that don't have real -pixel clocks won't initialize. - ---- ---- xorg-server-1.3.0.0/hw/xfree86/fbdevhw/fbdevhw.c.jx 2007-03-26 23:32:36.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/fbdevhw/fbdevhw.c 2007-05-11 15:10:05.000000000 -0400 -@@ -258,7 +258,7 @@ - static void - fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode) - { -- mode->Clock = var->pixclock ? 1000000000/var->pixclock : 28000000; -+ mode->Clock = var->pixclock ? 1000000000/var->pixclock : 0; - mode->HDisplay = var->xres; - mode->HSyncStart = mode->HDisplay+var->right_margin; - mode->HSyncEnd = mode->HSyncStart+var->hsync_len; diff --git a/xserver-1.3.0-idletime.patch b/xserver-1.3.0-idletime.patch deleted file mode 100644 index ca32b67..0000000 --- a/xserver-1.3.0-idletime.patch +++ /dev/null @@ -1,152 +0,0 @@ -commit 7e2c935920cafadbd87c351f1a3239932864fb90 -Author: Fredrik Höglund -Date: Fri May 18 20:06:14 2007 +0200 - - Add a new IDLETIME system sync counter. - - This counter exposes the time in milliseconds since the last - input event. Clients such as screen savers and power managers - can set an alarm on this counter to find out when the idle time - reaches a certain value, without having to poll the server. - -diff --git a/Xext/sync.c b/Xext/sync.c -index c5441a1..6fc2dcc 100644 ---- a/Xext/sync.c -+++ b/Xext/sync.c -@@ -243,6 +243,11 @@ SyncInitServerTime( - void - ); - -+static void -+SyncInitIdleTime( -+ void -+); -+ - static void - SyncResetProc( - ExtensionEntry * /* extEntry */ -@@ -2400,6 +2405,7 @@ SyncExtensionInit(INITARGS) - * because there is always a servertime counter. - */ - SyncInitServerTime(); -+ SyncInitIdleTime(); - - #ifdef DEBUG - fprintf(stderr, "Sync Extension %d.%d\n", -@@ -2520,3 +2526,116 @@ SyncInitServerTime(void) - ServertimeQueryValue, ServertimeBracketValues); - pnext_time = NULL; - } -+ -+ -+ -+/* -+ * IDLETIME implementation -+ */ -+ -+static pointer IdleTimeCounter; -+static XSyncValue *pIdleTimeValueLess; -+static XSyncValue *pIdleTimeValueGreater; -+ -+static void -+IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return) -+{ -+ CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds; -+ XSyncIntsToValue (pValue_return, idle, 0); -+} -+ -+static void -+IdleTimeBlockHandler (pointer env, -+ struct timeval **wt, -+ pointer LastSelectMask) -+{ -+ XSyncValue idle; -+ -+ if (!pIdleTimeValueLess && !pIdleTimeValueGreater) -+ return; -+ -+ IdleTimeQueryValue (NULL, &idle); -+ -+ if (pIdleTimeValueLess && -+ XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)) -+ { -+ AdjustWaitForDelay (wt, 0); -+ } -+ else if (pIdleTimeValueGreater) -+ { -+ unsigned long timeout = 0; -+ -+ if (XSyncValueLessThan (idle, *pIdleTimeValueGreater)) -+ { -+ XSyncValue value; -+ Bool overflow; -+ -+ XSyncValueSubtract (&value, *pIdleTimeValueGreater, -+ idle, &overflow); -+ timeout = XSyncValueLow32 (value); -+ } -+ -+ AdjustWaitForDelay (wt, timeout); -+ } -+} -+ -+static void -+IdleTimeWakeupHandler (pointer env, -+ int rc, -+ pointer LastSelectMask) -+{ -+ XSyncValue idle; -+ -+ if (!pIdleTimeValueLess && !pIdleTimeValueGreater) -+ return; -+ -+ IdleTimeQueryValue (NULL, &idle); -+ -+ if ((pIdleTimeValueGreater && -+ XSyncValueGreaterThan (idle, *pIdleTimeValueGreater)) || -+ (pIdleTimeValueLess && XSyncValueLessThan (idle, *pIdleTimeValueLess))) -+ { -+ SyncChangeCounter (IdleTimeCounter, idle); -+ } -+} -+ -+static void -+IdleTimeBracketValues (pointer pCounter, -+ CARD64 *pbracket_less, -+ CARD64 *pbracket_greater) -+{ -+ Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater); -+ -+ if (registered && !pbracket_less && !pbracket_greater) -+ { -+ RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler, -+ IdleTimeWakeupHandler, -+ NULL); -+ } -+ else if (!registered && (pbracket_less || pbracket_greater)) -+ { -+ RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler, -+ IdleTimeWakeupHandler, -+ NULL); -+ } -+ -+ pIdleTimeValueGreater = pbracket_greater; -+ pIdleTimeValueLess = pbracket_less; -+} -+ -+static void -+SyncInitIdleTime (void) -+{ -+ CARD64 resolution; -+ XSyncValue idle; -+ -+ IdleTimeQueryValue (NULL, &idle); -+ XSyncIntToValue (&resolution, 4); -+ -+ IdleTimeCounter = SyncCreateSystemCounter ("IDLETIME", idle, resolution, -+ XSyncCounterUnrestricted, -+ IdleTimeQueryValue, -+ IdleTimeBracketValues); -+ -+ pIdleTimeValueLess = pIdleTimeValueGreater = NULL; -+} diff --git a/xserver-1.3.0-intel-by-default.patch b/xserver-1.3.0-intel-by-default.patch deleted file mode 100644 index dfcc631..0000000 --- a/xserver-1.3.0-intel-by-default.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up xorg-server-1.3.0.0/hw/xfree86/common/xf86AutoConfig.c.jx xorg-server-1.3.0.0/hw/xfree86/common/xf86AutoConfig.c ---- xorg-server-1.3.0.0/hw/xfree86/common/xf86AutoConfig.c.jx 2006-11-16 13:01:24.000000000 -0500 -+++ xorg-server-1.3.0.0/hw/xfree86/common/xf86AutoConfig.c 2007-09-26 10:08:20.000000000 -0400 -@@ -175,7 +175,7 @@ videoPtrToDriverName(pciVideoPtr info) - case 0x8086: - if ((info->chipType == 0x00d1) || (info->chipType == 0x7800)) - return "i740"; -- else return "i810"; -+ else return "intel"; - case 0x102b: return "mga"; - case 0x10c8: return "neomagic"; - case 0x105d: return "i128"; diff --git a/xserver-1.3.0-late-sigusr1.patch b/xserver-1.3.0-late-sigusr1.patch deleted file mode 100644 index df39cf8..0000000 --- a/xserver-1.3.0-late-sigusr1.patch +++ /dev/null @@ -1,165 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Move SIGUSR1 notification as late as possible. - -If we inherited a signal mask from the parent process that ignores SIGUSR1, -then we will send SIGUSR1 to the parent to indicate when we're ready to -accept connections. Unfortunately, we send this notification way too -early, right after creating the sockets rather than just before entering -the main loop. - -Move it to just before Dispatch() so we're not lying quite so much. - ---- -diff -up xorg-server-1.3.0.0/dix/main.c.jx xorg-server-1.3.0.0/dix/main.c ---- xorg-server-1.3.0.0/dix/main.c.jx 2006-11-16 13:01:23.000000000 -0500 -+++ xorg-server-1.3.0.0/dix/main.c 2007-10-15 14:37:13.000000000 -0400 -@@ -442,6 +442,8 @@ main(int argc, char *argv[], char *envp[ - FatalError("could not create connection block info"); - } - -+ NotifyParentProcess(); -+ - Dispatch(); - - /* Now free up whatever must be freed */ -diff -up xorg-server-1.3.0.0/include/os.h.jx xorg-server-1.3.0.0/include/os.h ---- xorg-server-1.3.0.0/include/os.h.jx 2007-02-16 11:03:12.000000000 -0500 -+++ xorg-server-1.3.0.0/include/os.h 2007-10-15 14:37:13.000000000 -0400 -@@ -124,6 +124,8 @@ extern void ResetOsBuffers(void); - - extern void InitConnectionLimits(void); - -+extern void NotifyParentProcess(void); -+ - extern void CreateWellKnownSockets(void); - - extern void ResetWellKnownSockets(void); -diff -up xorg-server-1.3.0.0/os/connection.c.jx xorg-server-1.3.0.0/os/connection.c ---- xorg-server-1.3.0.0/os/connection.c.jx 2007-02-17 20:37:56.000000000 -0500 -+++ xorg-server-1.3.0.0/os/connection.c 2007-10-15 14:42:19.000000000 -0400 -@@ -370,6 +370,52 @@ InitConnectionLimits(void) - #endif - } - -+/* -+ * If SIGUSR1 was set to SIG_IGN when the server started, assume that either -+ * -+ * a- The parent process is ignoring SIGUSR1 -+ * -+ * or -+ * -+ * b- The parent process is expecting a SIGUSR1 -+ * when the server is ready to accept connections -+ * -+ * In the first case, the signal will be harmless, in the second case, -+ * the signal will be quite useful. -+ */ -+static void -+InitParentProcess(void) -+{ -+#if !defined(WIN32) -+ OsSigHandlerPtr handler; -+ handler = OsSignal (SIGUSR1, SIG_IGN); -+ if ( handler == SIG_IGN) -+ RunFromSmartParent = TRUE; -+ OsSignal(SIGUSR1, handler); -+ ParentProcess = getppid (); -+#ifdef __UNIXOS2__ -+ /* -+ * fg030505: under OS/2, xinit is not the parent process but -+ * the "grant parent" process of the server because execvpe() -+ * presents us an additional process number; -+ * GetPPID(pid) is part of libemxfix -+ */ -+ ParentProcess = GetPPID (ParentProcess); -+#endif /* __UNIXOS2__ */ -+#endif -+} -+ -+void -+NotifyParentProcess(void) -+{ -+#if !defined(WIN32) -+ if (RunFromSmartParent) { -+ if (ParentProcess > 1) { -+ kill (ParentProcess, SIGUSR1); -+ } -+ } -+#endif -+} - - /***************** - * CreateWellKnownSockets -@@ -382,7 +428,6 @@ CreateWellKnownSockets(void) - int i; - int partial; - char port[20]; -- OsSigHandlerPtr handler; - - FD_ZERO(&AllSockets); - FD_ZERO(&AllClients); -@@ -436,42 +481,9 @@ CreateWellKnownSockets(void) - OsSignal (SIGTERM, GiveUp); - XFD_COPYSET (&WellKnownConnections, &AllSockets); - ResetHosts(display); -- /* -- * Magic: If SIGUSR1 was set to SIG_IGN when -- * the server started, assume that either -- * -- * a- The parent process is ignoring SIGUSR1 -- * -- * or -- * -- * b- The parent process is expecting a SIGUSR1 -- * when the server is ready to accept connections -- * -- * In the first case, the signal will be harmless, -- * in the second case, the signal will be quite -- * useful -- */ --#if !defined(WIN32) -- handler = OsSignal (SIGUSR1, SIG_IGN); -- if ( handler == SIG_IGN) -- RunFromSmartParent = TRUE; -- OsSignal(SIGUSR1, handler); -- ParentProcess = getppid (); --#ifdef __UNIXOS2__ -- /* -- * fg030505: under OS/2, xinit is not the parent process but -- * the "grant parent" process of the server because execvpe() -- * presents us an additional process number; -- * GetPPID(pid) is part of libemxfix -- */ -- ParentProcess = GetPPID (ParentProcess); --#endif /* __UNIXOS2__ */ -- if (RunFromSmartParent) { -- if (ParentProcess > 1) { -- kill (ParentProcess, SIGUSR1); -- } -- } --#endif -+ -+ InitParentProcess(); -+ - #ifdef XDMCP - XdmcpInit (); - #endif -@@ -520,16 +532,7 @@ ResetWellKnownSockets (void) - - ResetAuthorization (); - ResetHosts(display); -- /* -- * See above in CreateWellKnownSockets about SIGUSR1 -- */ --#if !defined(WIN32) -- if (RunFromSmartParent) { -- if (ParentProcess > 1) { -- kill (ParentProcess, SIGUSR1); -- } -- } --#endif -+ - /* - * restart XDMCP - */ diff --git a/xserver-1.3.0-mesa7.patch b/xserver-1.3.0-mesa7.patch deleted file mode 100644 index 14e4dc4..0000000 --- a/xserver-1.3.0-mesa7.patch +++ /dev/null @@ -1,8203 +0,0 @@ -diff --git a/GL/apple/Makefile.am b/GL/apple/Makefile.am -new file mode 100644 -index 0000000..2b2d10c ---- /dev/null -+++ b/GL/apple/Makefile.am -@@ -0,0 +1,15 @@ -+AM_CFLAGS = -I$(top_srcdir) \ -+ -I$(top_srcdir)/hw/darwin/quartz \ -+ -I$(top_srcdir)/GL/glx \ -+ -I$(top_srcdir)/hw/darwin/quartz/cr \ -+ -I$(top_srcdir)/GL/include -+ -+if HAVE_AGL_FRAMEWORK -+noinst_LIBRARIES = libAGLcore.a -+libAGLcore_a_SOURCES = aglGlx.c \ -+ $(top_srcdir)/hw/darwin/quartz/xpr/x-list.c \ -+ $(top_srcdir)/hw/darwin/quartz/xpr/x-list.h \ -+ $(top_srcdir)/hw/darwin/quartz/xpr/x-hash.c \ -+ $(top_srcdir)/hw/darwin/quartz/xpr/x-hash.h \ -+ $(top_srcdir)/hw/dmx/glxProxy/compsize.c -+endif -diff --git a/GL/apple/indirect.c b/GL/apple/indirect.c -index 8cba1c6..ba54186 100644 ---- a/GL/apple/indirect.c -+++ b/GL/apple/indirect.c -@@ -1,11 +1,10 @@ - /* - * GLX implementation that uses Apple's OpenGL.framework - * (Indirect rendering path) -- */ --/* -- * Copyright (c) 2002 Greg Parker. All Rights Reserved. -- * Copyright (c) 2002 Apple Computer, Inc. -+ * -+ * Copyright (c) 2007 Apple Inc. - * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved. -+ * Copyright (c) 2002 Greg Parker. All Rights Reserved. - * - * Portions of this file are copied from Mesa's xf86glx.c, - * which contains the following copyright: -@@ -39,11 +38,12 @@ - #include "dri.h" - #include "quartz.h" - --#include -+//#include - #include - #include - - // X11 and X11's glx -+#include - #include - #include - #include -@@ -61,11 +61,16 @@ - #include "x-hash.h" - #include "x-list.h" - -+#include -+ - #include "glcontextmodes.h" -+#include -+#include - - // ggs: needed to call back to glx with visual configs - extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs); - -+#define GLAQUA_DEBUG 1 - - // Write debugging output, or not - #ifdef GLAQUA_DEBUG -@@ -74,182 +79,163 @@ extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void * - #define GLAQUA_DEBUG_MSG(a, ...) - #endif - -- --// The following GL functions don't have an EXT suffix in OpenGL.framework. --GLboolean glAreTexturesResidentEXT(GLsizei a, const GLuint *b, GLboolean *c) { -- return glAreTexturesResident(a, b, c); --} --void glDeleteTexturesEXT(GLsizei d, const GLuint *e) { -- glDeleteTextures(d, e); --} --void glGenTexturesEXT(GLsizei f, GLuint *g) { -- glGenTextures(f, g); --} --GLboolean glIsTextureEXT(GLuint h) { -- return glIsTexture(h); --} -+static void setup_dispatch_table(void); - - // some prototypes --static Bool glAquaScreenProbe(int screen); -+static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen); - static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - int *nvisualp, int *ndepthp, - int *rootDepthp, VisualID *defaultVisp, - unsigned long sizes, int bitsPerRGB); - static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, - void **privates); -+ - static __GLinterface *glAquaCreateContext(__GLimports *imports, - __GLcontextModes *mode, - __GLinterface *shareGC); --static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv); - static void glAquaResetExtension(void); -- --/* -- * This structure is statically allocated in the __glXScreens[] -- * structure. This struct is not used anywhere other than in -- * __glXScreenInit to initialize each of the active screens -- * (__glXActiveScreens[]). Several of the fields must be initialized by -- * the screenProbe routine before they are copied to the active screens -- * struct. In particular, the contextCreate, modes, numVisuals, -- * and numUsableVisuals fields must be initialized. -- */ --static __GLXscreenInfo __glDDXScreenInfo = { -- glAquaScreenProbe, /* Must be generic and handle all screens */ -- glAquaCreateContext, /* Substitute screen's createContext routine */ -- glAquaCreateBuffer, /* Substitute screen's createBuffer routine */ -- NULL, /* Set up modes in probe */ -- NULL, /* Set up pVisualPriv in probe */ -- 0, /* Set up numVisuals in probe */ -- 0, /* Set up numUsableVisuals in probe */ -- "Vendor String", /* GLXvendor is overwritten by __glXScreenInit */ -- "Version String", /* GLXversion is overwritten by __glXScreenInit */ -- "Extensions String", /* GLXextensions is overwritten by __glXScreenInit */ -- NULL /* WrappedPositionWindow is overwritten */ --}; -- --void *__glXglDDXScreenInfo(void) { -- return &__glDDXScreenInfo; --} -- --static __GLXextensionInfo __glDDXExtensionInfo = { -- GL_CORE_APPLE, -- glAquaResetExtension, -- glAquaInitVisuals, -- glAquaSetVisualConfigs -+static void __glXAquaContextDestroy(__GLXcontext *baseContext); -+static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext); -+static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext); -+static int __glXAquaContextForceCurrent(__GLXcontext *baseContext); -+static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask); -+static __GLXdrawable * __glXAquaContextCreateDrawable(__GLXcontext *context, DrawablePtr pDraw, XID drawId); -+ -+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode); -+ -+__GLXprovider __glXMesaProvider = { -+ __glXAquaScreenProbe, -+ "Core OpenGL", -+ NULL - }; - --void *__glXglDDXExtensionInfo(void) { -- return &__glDDXExtensionInfo; -+__GLXprovider * -+GlxGetMesaProvider (void) -+{ -+ ErrorF("GlxGetMesaProvider\n"); -+ return &__glXMesaProvider; - } - --// prototypes -+typedef struct __GLXAquaScreen __GLXAquaScreen; -+typedef struct __GLXAquaContext __GLXAquaContext; -+typedef struct __GLXAquaDrawable __GLXAquaDrawable; - --static GLboolean glAquaDestroyContext(__GLcontext *gc); --static GLboolean glAquaLoseCurrent(__GLcontext *gc); --static GLboolean glAquaMakeCurrent(__GLcontext *gc); --static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare); --static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, -- GLuint mask); --static GLboolean glAquaForceCurrent(__GLcontext *gc); -- --/* Drawing surface notification callbacks */ --static GLboolean glAquaNotifyResize(__GLcontext *gc); --static void glAquaNotifyDestroy(__GLcontext *gc); --static void glAquaNotifySwapBuffers(__GLcontext *gc); -- --/* Dispatch table override control for external agents like libGLS */ --static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc); --static void glAquaBeginDispatchOverride(__GLcontext *gc); --static void glAquaEndDispatchOverride(__GLcontext *gc); -- --static __GLexports glAquaExports = { -- glAquaDestroyContext, -- glAquaLoseCurrent, -- glAquaMakeCurrent, -- glAquaShareContext, -- glAquaCopyContext, -- glAquaForceCurrent, -- -- glAquaNotifyResize, -- glAquaNotifyDestroy, -- glAquaNotifySwapBuffers, -- -- glAquaDispatchExec, -- glAquaBeginDispatchOverride, -- glAquaEndDispatchOverride --}; -- --typedef struct { -+struct __GLXAquaScreen { -+ __GLXscreen base; -+ int index; - int num_vis; - __GLcontextModes *modes; -- void **priv; -+}; - -- // wrapped screen functions -- RealizeWindowProcPtr RealizeWindow; -- UnrealizeWindowProcPtr UnrealizeWindow; --} glAquaScreenRec; -+static __GLXAquaScreen glAquaScreens[MAXSCREENS]; - --static glAquaScreenRec glAquaScreens[MAXSCREENS]; -+struct __GLXAquaContext { -+ __GLXcontext base; -+ CGLContextObj ctx; -+ CGLPixelFormatObj pixelFormat; -+ xp_surface_id sid; -+ unsigned isAttached :1; -+}; - --// __GLdrawablePrivate->private --typedef struct { -+struct __GLXAquaDrawable { -+ __GLXdrawable base; - DrawablePtr pDraw; - xp_surface_id sid; --} GLAquaDrawableRec; -- --struct __GLcontextRec { -- struct __GLinterfaceRec interface; // required to be first -- -- CGLContextObj ctx; -- CGLPixelFormatObj pixelFormat; -+}; - -- /* set when attached */ -- xp_surface_id sid; -+static __GLXcontext * -+__glXAquaScreenCreateContext(__GLXscreen *screen, -+ __GLcontextModes *modes, -+ __GLXcontext *baseShareContext) -+{ -+ __GLXAquaContext *context; -+ __GLXAquaContext *shareContext = (__GLXAquaContext *) baseShareContext; -+ CGLError gl_err; -+ -+ GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); -+ -+ context = malloc (sizeof (__GLXAquaContext)); -+ if (context == NULL) return NULL; -+ -+ memset(context, 0, sizeof *context); -+ -+ context->base.pGlxScreen = screen; -+ context->base.modes = modes; -+ -+ context->base.destroy = __glXAquaContextDestroy; -+ context->base.makeCurrent = __glXAquaContextMakeCurrent; -+ context->base.loseCurrent = __glXAquaContextLoseCurrent; -+ context->base.copy = __glXAquaContextCopy; -+ context->base.forceCurrent = __glXAquaContextForceCurrent; -+ context->base.createDrawable = __glXAquaContextCreateDrawable; -+ -+ context->pixelFormat = makeFormat(modes); -+ if (!context->pixelFormat) { -+ free(context); -+ return NULL; -+ } -+ -+ context->ctx = NULL; -+ gl_err = CGLCreateContext(context->pixelFormat, -+ shareContext ? shareContext->ctx : NULL, -+ &context->ctx); -+ -+ if (gl_err != 0) { -+ ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); -+ CGLDestroyPixelFormat(context->pixelFormat); -+ free(context); -+ return NULL; -+ } -+ setup_dispatch_table(); -+ GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); -+ return &context->base; -+} - -- unsigned isAttached :1; -+static __GLXextensionInfo __glDDXExtensionInfo = { -+ GL_CORE_APPLE, -+ glAquaResetExtension, -+ glAquaInitVisuals, -+ glAquaSetVisualConfigs - }; - -+void *__glXglDDXExtensionInfo(void) { -+ GLAQUA_DEBUG_MSG("glXAglDDXExtensionInfo\n"); -+ return &__glDDXExtensionInfo; -+} -+ - /* maps from surface id -> list of __GLcontext */ - static x_hash_table *surface_hash; - -- --// Context manipulation; return GL_FALSE on failure --static GLboolean glAquaDestroyContext(__GLcontext *gc) --{ -+static void __glXAquaContextDestroy(__GLXcontext *baseContext) { - x_list *lst; - -- GLAQUA_DEBUG_MSG("glAquaDestroyContext (ctx 0x%x)\n", -- (unsigned int) gc->ctx); -+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext; - -- if (gc != NULL) -- { -- if (gc->sid != 0 && surface_hash != NULL) -- { -- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); -- lst = x_list_remove(lst, gc); -- x_hash_table_insert(surface_hash, (void *) gc->sid, lst); -- } -- -- if (gc->ctx != NULL) -- CGLDestroyContext(gc->ctx); -+ GLAQUA_DEBUG_MSG("glAquaContextDestroy (ctx 0x%x)\n", -+ (unsigned int) baseContext); -+ if (context != NULL) { -+ if (context->sid != 0 && surface_hash != NULL) { -+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL); -+ lst = x_list_remove(lst, context); -+ x_hash_table_insert(surface_hash, (void *) context->sid, lst); -+ } - -- if (gc->pixelFormat != NULL) -- CGLDestroyPixelFormat(gc->pixelFormat); -+ if (context->ctx != NULL) CGLDestroyContext(context->ctx); - -- free(gc); -+ if (context->pixelFormat != NULL) CGLDestroyPixelFormat(context->pixelFormat); -+ -+ free(context); - } -- -- return GL_TRUE; - } - --static GLboolean glAquaLoseCurrent(__GLcontext *gc) --{ -+static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext) { - CGLError gl_err; - -- GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); -+ GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%p)\n", baseContext); - - gl_err = CGLSetCurrentContext(NULL); - if (gl_err != 0) -- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); -+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - - __glXLastContext = NULL; // Mesa does this; why? - -@@ -258,141 +244,139 @@ static GLboolean glAquaLoseCurrent(__GLcontext *gc) - - /* Called when a surface is destroyed as a side effect of destroying - the window it's attached to. */ --static void surface_notify(void *_arg, void *data) --{ -- DRISurfaceNotifyArg *arg = _arg; -- GLAquaDrawableRec *aquaPriv = data; -- __GLcontext *gc; -+static void surface_notify(void *_arg, void *data) { -+ DRISurfaceNotifyArg *arg = (DRISurfaceNotifyArg *)_arg; -+ __GLXAquaDrawable *draw = (__GLXAquaDrawable *)data; -+ __GLXAquaContext *context; - x_list *lst; -- -- switch (arg->kind) -- { -+ if(_arg == NULL || data == NULL) { -+ ErrorF("surface_notify called with bad params"); -+ return; -+ } -+ -+ GLAQUA_DEBUG_MSG("surface_notify(%p, %p)\n", _arg, data); -+ switch (arg->kind) { - case AppleDRISurfaceNotifyDestroyed: - if (surface_hash != NULL) - x_hash_table_remove(surface_hash, (void *) arg->id); -- -- aquaPriv->pDraw = NULL; -- aquaPriv->sid = 0; -+ draw->base->pDraw = NULL; -+ draw->sid = 0; - break; - - case AppleDRISurfaceNotifyChanged: -- if (surface_hash != NULL) -- { -+ if (surface_hash != NULL) { - lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL); - for (; lst != NULL; lst = lst->next) - { -- gc = lst->data; -- xp_update_gl_context(gc->ctx); -+ context = lst->data; -+ xp_update_gl_context(context->ctx); - } - } - break; -+ default: -+ ErrorF("surface_notify: unknown kind %d\n", arg->kind); -+ break; - } - } - --static void unattach(__GLcontext *gc) --{ -- x_list *lst; -- -- if (gc->isAttached) -- { -- GLAQUA_DEBUG_MSG("unattaching\n"); -- -- if (surface_hash != NULL) -- { -- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); -- lst = x_list_remove(lst, gc); -- x_hash_table_insert(surface_hash, (void *) gc->sid, lst); -- } -- -- CGLClearDrawable(gc->ctx); -- gc->isAttached = FALSE; -- gc->sid = 0; -- } --} -- --static void attach(__GLcontext *gc, __GLdrawablePrivate *glPriv) --{ -- __GLXdrawablePrivate *glxPriv; -- GLAquaDrawableRec *aquaPriv; -+static void attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) { - DrawablePtr pDraw; -- -- glxPriv = (__GLXdrawablePrivate *)glPriv->other; -- aquaPriv = (GLAquaDrawableRec *)glPriv->private; -- pDraw = glxPriv->pDraw; -- -- if (aquaPriv->sid == 0) -- { -- if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, -- 0, &aquaPriv->sid, NULL, -- surface_notify, aquaPriv)) -- { -+ GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw); -+ pDraw = draw->base.pDraw; -+ -+ if (draw->sid == 0) { -+// if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw, -+ if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw, -+ 0, &draw->sid, NULL, -+ surface_notify, draw)) - return; -- } -- aquaPriv->pDraw = pDraw; -- } -+ draw->pDraw = pDraw; -+ } - -- if (!gc->isAttached || gc->sid != aquaPriv->sid) -- { -+ if (!context->isAttached || context->sid != draw->sid) { - x_list *lst; - -- if (xp_attach_gl_context(gc->ctx, aquaPriv->sid) != Success) -- { -- quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, -- surface_notify, aquaPriv); -+ if (xp_attach_gl_context(context->ctx, draw->sid) != Success) { -+// quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw, -+ DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw, -+ surface_notify, draw); - if (surface_hash != NULL) -- x_hash_table_remove(surface_hash, (void *) aquaPriv->sid); -+ x_hash_table_remove(surface_hash, (void *) draw->sid); - -- aquaPriv->sid = 0; -+ draw->sid = 0; - return; - } - -- gc->isAttached = TRUE; -- gc->sid = aquaPriv->sid; -+ context->isAttached = TRUE; -+ context->sid = draw->sid; - - if (surface_hash == NULL) - surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL); - -- lst = x_hash_table_lookup(surface_hash, (void *) gc->sid, NULL); -- if (x_list_find(lst, gc) == NULL) -- { -- lst = x_list_prepend(lst, gc); -- x_hash_table_insert(surface_hash, (void *) gc->sid, lst); -+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL); -+ if (x_list_find(lst, context) == NULL) { -+ lst = x_list_prepend(lst, context); -+ x_hash_table_insert(surface_hash, (void *) context->sid, lst); - } - - GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id, -- (unsigned int) aquaPriv->sid); -+ (unsigned int) draw->sid); -+ } -+} -+ -+static void unattach(__GLXAquaContext *context) { -+ x_list *lst; -+ GLAQUA_DEBUG_MSG("unattach\n"); -+ if (context == NULL) { -+ ErrorF("Tried to unattach a null context\n"); -+ return; -+ } -+ if (context->isAttached) { -+ GLAQUA_DEBUG_MSG("unattaching\n"); -+ -+ if (surface_hash != NULL) { -+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL); -+ lst = x_list_remove(lst, context); -+ x_hash_table_insert(surface_hash, (void *) context->sid, lst); -+ } -+ -+ CGLClearDrawable(context->ctx); -+ context->isAttached = FALSE; -+ context->sid = 0; - } - } - --static GLboolean glAquaMakeCurrent(__GLcontext *gc) --{ -- __GLdrawablePrivate *glPriv = gc->interface.imports.getDrawablePrivate(gc); -+static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) { - CGLError gl_err; -+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext; -+ __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv; -+ __GLXAquaDrawable *readPriv = (__GLXAquaDrawable *) context->base.readPriv; - -- GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%x)\n", (unsigned int) gc->ctx); -- -- attach(gc, glPriv); -+ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext); -+ -+ attach(context, drawPriv); - -- gl_err = CGLSetCurrentContext(gc->ctx); -+ gl_err = CGLSetCurrentContext(context->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); -- -+ - return gl_err == 0; - } - - static GLboolean glAquaShareContext(__GLcontext *gc, __GLcontext *gcShare) - { - GLAQUA_DEBUG_MSG("glAquaShareContext unimplemented\n"); -- - return GL_TRUE; - } - --static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, -- GLuint mask) -+static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask) - { - CGLError gl_err; - -- GLAQUA_DEBUG_MSG("glAquaCopyContext\n"); -+ __GLXAquaContext *dst = (__GLXAquaContext *) baseDst; -+ __GLXAquaContext *src = (__GLXAquaContext *) baseSrc; -+ -+ GLAQUA_DEBUG_MSG("GLXAquaContextCopy\n"); - - gl_err = CGLCopyContext(src->ctx, dst->ctx, mask); - if (gl_err != 0) -@@ -401,14 +385,13 @@ static GLboolean glAquaCopyContext(__GLcontext *dst, const __GLcontext *src, - return gl_err == 0; - } - --static GLboolean glAquaForceCurrent(__GLcontext *gc) -+static int __glXAquaContextForceCurrent(__GLXcontext *baseContext) - { - CGLError gl_err; -+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext; -+ GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx); - -- GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx 0x%x)\n", -- (unsigned int) gc->ctx); -- -- gl_err = CGLSetCurrentContext(gc->ctx); -+ gl_err = CGLSetCurrentContext(context->ctx); - if (gl_err != 0) - ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err)); - -@@ -417,45 +400,41 @@ static GLboolean glAquaForceCurrent(__GLcontext *gc) - - /* Drawing surface notification callbacks */ - --static GLboolean glAquaNotifyResize(__GLcontext *gc) --{ -- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyResize"); -+static GLboolean __glXAquaDrawableResize(__GLXdrawable *base) { -+ GLAQUA_DEBUG_MSG("unimplemented glAquaDrawableResize\n"); - return GL_TRUE; - } - --static void glAquaNotifyDestroy(__GLcontext *gc) --{ -+static void glAquaNotifyDestroy(__GLcontext *gc) { - GLAQUA_DEBUG_MSG("unimplemented glAquaNotifyDestroy"); - } - --static void glAquaNotifySwapBuffers(__GLcontext *gc) --{ -- GLAQUA_DEBUG_MSG("unimplemented glAquaNotifySwapBuffers"); --} -- --/* Dispatch table override control for external agents like libGLS */ --static struct __GLdispatchStateRec* glAquaDispatchExec(__GLcontext *gc) --{ -- GLAQUA_DEBUG_MSG("unimplemented glAquaDispatchExec"); -- return NULL; --} -- --static void glAquaBeginDispatchOverride(__GLcontext *gc) --{ -- GLAQUA_DEBUG_MSG("unimplemented glAquaBeginDispatchOverride"); --} -- --static void glAquaEndDispatchOverride(__GLcontext *gc) --{ -- GLAQUA_DEBUG_MSG("unimplemented glAquaEndDispatchOverride"); -+static GLboolean __glXAquaDrawableSwapBuffers(__GLXdrawable *base) { -+ __GLXAquaDrawable *glxPriv = (__GLXAquaDrawable *) base; -+ CGLError gl_err; -+ __GLXAquaContext * drawableCtx; -+// GLAQUA_DEBUG_MSG("glAquaDrawableSwapBuffers(%p)\n",base); -+ -+ if(!base) { -+ ErrorF("glXAquaDrawbleSwapBuffers passed NULL\n"); -+ return GL_FALSE; -+ } -+ -+ drawableCtx = (__GLXAquaContext *)base->drawGlxc; -+ -+ if (drawableCtx != NULL && drawableCtx->ctx != NULL) { -+ gl_err = CGLFlushDrawable(drawableCtx->ctx); -+ if (gl_err != 0) -+ ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err)); -+ } -+ return GL_TRUE; - } - --static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) --{ -+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) { - int i; - CGLPixelFormatAttribute attr[64]; // currently uses max of 30 - CGLPixelFormatObj result; -- long n_formats; -+ GLint n_formats; - CGLError gl_err; - - GLAQUA_DEBUG_MSG("makeFormat\n"); -@@ -491,10 +470,12 @@ static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) - attr[i++] = mode->accumRedBits + mode->accumGreenBits - + mode->accumBlueBits + mode->accumAlphaBits; - } -+ - if (mode->haveDepthBuffer) { - attr[i++] = kCGLPFADepthSize; - attr[i++] = mode->depthBits; - } -+ - if (mode->haveStencilBuffer) { - attr[i++] = kCGLPFAStencilSize; - attr[i++] = mode->stencilBits; -@@ -521,129 +502,6 @@ static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) - return result; - } - --static __GLinterface *glAquaCreateContext(__GLimports *imports, -- __GLcontextModes *mode, -- __GLinterface *shareGC) --{ -- __GLcontext *result; -- __GLcontext *sharectx = (__GLcontext *)shareGC; -- CGLError gl_err; -- -- GLAQUA_DEBUG_MSG("glAquaCreateContext\n"); -- -- result = (__GLcontext *)calloc(1, sizeof(__GLcontext)); -- if (!result) return NULL; -- -- result->interface.imports = *imports; -- result->interface.exports = glAquaExports; -- -- result->pixelFormat = makeFormat(mode); -- if (!result->pixelFormat) { -- free(result); -- return NULL; -- } -- -- result->ctx = NULL; -- gl_err = CGLCreateContext(result->pixelFormat, -- sharectx ? sharectx->ctx : NULL, -- &result->ctx); -- -- if (gl_err != 0) { -- ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err)); -- CGLDestroyPixelFormat(result->pixelFormat); -- free(result); -- return NULL; -- } -- -- GLAQUA_DEBUG_MSG("glAquaCreateContext done\n"); -- return (__GLinterface *)result; --} -- --Bool --glAquaRealizeWindow(WindowPtr pWin) --{ -- // If this window has GL contexts, tell them to reattach -- Bool result; -- ScreenPtr pScreen = pWin->drawable.pScreen; -- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; -- __GLXdrawablePrivate *glxPriv; -- -- GLAQUA_DEBUG_MSG("glAquaRealizeWindow\n"); -- -- // Allow the window to be created (RootlessRealizeWindow is inside our wrap) -- pScreen->RealizeWindow = screenPriv->RealizeWindow; -- result = pScreen->RealizeWindow(pWin); -- pScreen->RealizeWindow = glAquaRealizeWindow; -- -- // The Aqua window will already have been created (windows are -- // realized from top down) -- -- // Re-attach this window's GL contexts, if any. -- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); -- if (glxPriv) { -- __GLXcontext *gx; -- __GLcontext *gc; -- __GLdrawablePrivate *glPriv = &glxPriv->glPriv; -- GLAQUA_DEBUG_MSG("glAquaRealizeWindow is GL drawable!\n"); -- -- // GL contexts bound to this window for drawing -- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { -- gc = (__GLcontext *)gx->gc; -- attach(gc, glPriv); -- } -- -- // GL contexts bound to this window for reading -- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { -- gc = (__GLcontext *)gx->gc; -- attach(gc, glPriv); -- } -- } -- -- return result; --} -- --Bool --glAquaUnrealizeWindow(WindowPtr pWin) --{ -- // If this window has GL contexts, tell them to unattach -- Bool result; -- ScreenPtr pScreen = pWin->drawable.pScreen; -- glAquaScreenRec *screenPriv = &glAquaScreens[pScreen->myNum]; -- __GLXdrawablePrivate *glxPriv; -- -- GLAQUA_DEBUG_MSG("glAquaUnrealizeWindow\n"); -- -- // The Aqua window may have already been destroyed (windows -- // are unrealized from top down) -- -- // Unattach this window's GL contexts, if any. -- glxPriv = __glXFindDrawablePrivate(pWin->drawable.id); -- if (glxPriv) { -- __GLXcontext *gx; -- __GLcontext *gc; -- GLAQUA_DEBUG_MSG("glAquaUnealizeWindow is GL drawable!\n"); -- -- // GL contexts bound to this window for drawing -- for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) { -- gc = (__GLcontext *)gx->gc; -- unattach(gc); -- } -- -- // GL contexts bound to this window for reading -- for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) { -- gc = (__GLcontext *)gx->gc; -- unattach(gc); -- } -- } -- -- pScreen->UnrealizeWindow = screenPriv->UnrealizeWindow; -- result = pScreen->UnrealizeWindow(pWin); -- pScreen->UnrealizeWindow = glAquaUnrealizeWindow; -- -- return result; --} -- -- - // Originally copied from Mesa - - static int numConfigs = 0; -@@ -821,15 +679,15 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - - /* Alloc space for the list of new GLX visuals */ - pNewVisualConfigs = (__GLXvisualConfig *) -- __glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig)); -+ malloc(numNewConfigs * sizeof(__GLXvisualConfig)); - if (!pNewVisualConfigs) { - return FALSE; - } - - /* Alloc space for the list of new GLX visual privates */ -- pNewVisualPriv = (void **) __glXMalloc(numNewConfigs * sizeof(void *)); -+ pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *)); - if (!pNewVisualPriv) { -- __glXFree(pNewVisualConfigs); -+ free(pNewVisualConfigs); - return FALSE; - } - -@@ -879,40 +737,40 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - numConfigs = 0; - - /* Alloc temp space for the list of orig VisualIDs for each new visual */ -- orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID)); -+ orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID)); - if (!orig_vid) { -- __glXFree(pNewVisualPriv); -- __glXFree(pNewVisualConfigs); -+ free(pNewVisualPriv); -+ free(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisuals */ - modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes)); - if (modes == NULL) { -- __glXFree(orig_vid); -- __glXFree(pNewVisualPriv); -- __glXFree(pNewVisualConfigs); -+ free(orig_vid); -+ free(pNewVisualPriv); -+ free(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the list of glXVisualPrivates */ -- glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *)); -+ glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *)); - if (!glXVisualPriv) { - _gl_context_modes_destroy( modes ); -- __glXFree(orig_vid); -- __glXFree(pNewVisualPriv); -- __glXFree(pNewVisualConfigs); -+ free(orig_vid); -+ free(pNewVisualPriv); -+ free(pNewVisualConfigs); - return FALSE; - } - - /* Alloc space for the new list of the X server's visuals */ -- pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec)); -+ pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec)); - if (!pVisualNew) { -- __glXFree(glXVisualPriv); -+ free(glXVisualPriv); - _gl_context_modes_destroy( modes ); -- __glXFree(orig_vid); -- __glXFree(pNewVisualPriv); -- __glXFree(pNewVisualConfigs); -+ free(orig_vid); -+ free(pNewVisualPriv); -+ free(pNewVisualConfigs); - return FALSE; - } - -@@ -1007,7 +865,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - - /* Save the GLX visuals in the screen structure */ - glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals; -- glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; -+ // glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv; - - /* Set up depth's VisualIDs */ - for (i = 0; i < ndepth; i++) { -@@ -1022,7 +880,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - numVids++; - - /* Allocate a new list of VisualIDs for this depth */ -- pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID)); -+ pVids = (VisualID *)malloc(numVids * sizeof(VisualID)); - - /* Initialize the new list of VisualIDs for this depth */ - for (j = 0; j < pdepth[i].numVids; j++) -@@ -1031,7 +889,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - pVids[n++] = pVisualNew[k].vid; - - /* Update this depth's list of VisualIDs */ -- __glXFree(pdepth[i].vids); -+ free(pdepth[i].vids); - pdepth[i].vids = pVids; - pdepth[i].numVids = numVids; - } -@@ -1041,21 +899,22 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp, - *visualp = pVisualNew; - - /* Free the old list of the X server's visuals */ -- __glXFree(pVisual); -+ free(pVisual); - - /* Clean up temporary allocations */ -- __glXFree(orig_vid); -- __glXFree(pNewVisualPriv); -- __glXFree(pNewVisualConfigs); -+ free(orig_vid); -+ free(pNewVisualPriv); -+ free(pNewVisualConfigs); - - /* Free the private list created by DDX HW driver */ - if (visualPrivates) -- xfree(visualPrivates); -+ free(visualPrivates); - visualPrivates = NULL; - - return TRUE; - } - -+Bool enable_stereo = FALSE; - /* based on code in i830_dri.c - This ends calling glAquaSetVisualConfigs to set the static - numconfigs, etc. */ -@@ -1066,20 +925,22 @@ glAquaInitVisualConfigs(void) - __GLXvisualConfig *lclVisualConfigs = NULL; - void **lclVisualPrivates = NULL; - -- int depth, aux, buffers, stencil, accum; -+ int stereo, depth, aux, buffers, stencil, accum; - int i = 0; - - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs "); - - /* count num configs: -+ 2 stereo (on, off) (optional) - 2 Z buffer (0, 24 bit) - 2 AUX buffer (0, 2) - 2 buffers (single, double) - 2 stencil (0, 8 bit) - 2 accum (0, 64 bit) -- = 32 configs */ -+ = 64 configs with stereo, or 32 without */ - -- lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ -+ if (enable_stereo) lclNumConfigs = 2 * 2 * 2 * 2 * 2 * 2; /* 64 */ -+ else lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */ - - /* alloc */ - lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs); -@@ -1088,54 +949,55 @@ glAquaInitVisualConfigs(void) - /* fill in configs */ - if (NULL != lclVisualConfigs) { - i = 0; /* current buffer */ -- for (depth = 0; depth < 2; depth++) { -+ for (stereo = 0; stereo < (enable_stereo ? 2 : 1); stereo++) { -+ for (depth = 0; depth < 2; depth++) { - for (aux = 0; aux < 2; aux++) { -- for (buffers = 0; buffers < 2; buffers++) { -- for (stencil = 0; stencil < 2; stencil++) { -- for (accum = 0; accum < 2; accum++) { -- lclVisualConfigs[i].vid = -1; -- lclVisualConfigs[i].class = -1; -- lclVisualConfigs[i].rgba = TRUE; -- lclVisualConfigs[i].redSize = -1; -- lclVisualConfigs[i].greenSize = -1; -- lclVisualConfigs[i].blueSize = -1; -- lclVisualConfigs[i].redMask = -1; -- lclVisualConfigs[i].greenMask = -1; -- lclVisualConfigs[i].blueMask = -1; -- lclVisualConfigs[i].alphaMask = 0; -- if (accum) { -- lclVisualConfigs[i].accumRedSize = 16; -- lclVisualConfigs[i].accumGreenSize = 16; -- lclVisualConfigs[i].accumBlueSize = 16; -- lclVisualConfigs[i].accumAlphaSize = 16; -- } -- else { -- lclVisualConfigs[i].accumRedSize = 0; -- lclVisualConfigs[i].accumGreenSize = 0; -- lclVisualConfigs[i].accumBlueSize = 0; -- lclVisualConfigs[i].accumAlphaSize = 0; -- } -- lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; -- lclVisualConfigs[i].stereo = FALSE; -- lclVisualConfigs[i].bufferSize = -1; -- -- lclVisualConfigs[i].depthSize = depth? 24 : 0; -- lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; -- lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; -- lclVisualConfigs[i].level = 0; -- lclVisualConfigs[i].visualRating = GLX_NONE_EXT; -- lclVisualConfigs[i].transparentPixel = 0; -- lclVisualConfigs[i].transparentRed = 0; -- lclVisualConfigs[i].transparentGreen = 0; -- lclVisualConfigs[i].transparentBlue = 0; -- lclVisualConfigs[i].transparentAlpha = 0; -- lclVisualConfigs[i].transparentIndex = 0; -- i++; -- } -- } -- } -+ for (buffers = 0; buffers < 2; buffers++) { -+ for (stencil = 0; stencil < 2; stencil++) { -+ for (accum = 0; accum < 2; accum++) { -+ lclVisualConfigs[i].vid = -1; -+ lclVisualConfigs[i].class = -1; -+ lclVisualConfigs[i].rgba = TRUE; -+ lclVisualConfigs[i].redSize = -1; -+ lclVisualConfigs[i].greenSize = -1; -+ lclVisualConfigs[i].blueSize = -1; -+ lclVisualConfigs[i].redMask = -1; -+ lclVisualConfigs[i].greenMask = -1; -+ lclVisualConfigs[i].blueMask = -1; -+ lclVisualConfigs[i].alphaMask = 0; -+ if (accum) { -+ lclVisualConfigs[i].accumRedSize = 16; -+ lclVisualConfigs[i].accumGreenSize = 16; -+ lclVisualConfigs[i].accumBlueSize = 16; -+ lclVisualConfigs[i].accumAlphaSize = 16; -+ } else { -+ lclVisualConfigs[i].accumRedSize = 0; -+ lclVisualConfigs[i].accumGreenSize = 0; -+ lclVisualConfigs[i].accumBlueSize = 0; -+ lclVisualConfigs[i].accumAlphaSize = 0; -+ } -+ lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; -+ lclVisualConfigs[i].stereo = stereo ? TRUE : FALSE; -+ lclVisualConfigs[i].bufferSize = -1; -+ -+ lclVisualConfigs[i].depthSize = depth? 24 : 0; -+ lclVisualConfigs[i].stencilSize = stencil ? 8 : 0; -+ lclVisualConfigs[i].auxBuffers = aux ? 2 : 0; -+ lclVisualConfigs[i].level = 0; -+ lclVisualConfigs[i].visualRating = GLX_NONE_EXT; -+ lclVisualConfigs[i].transparentPixel = 0; -+ lclVisualConfigs[i].transparentRed = 0; -+ lclVisualConfigs[i].transparentGreen = 0; -+ lclVisualConfigs[i].transparentBlue = 0; -+ lclVisualConfigs[i].transparentAlpha = 0; -+ lclVisualConfigs[i].transparentIndex = 0; -+ i++; -+ } -+ } -+ } - } -- } -+ } -+ } - } - if (i != lclNumConfigs) - GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs"); -@@ -1171,7 +1033,7 @@ static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp, - *ndepthp, *depthp, *rootDepthp); - } - -- -+#if 0 - static void fixup_visuals(int screen) - { - ScreenPtr pScreen = screenInfo.screens[screen]; -@@ -1204,27 +1066,35 @@ static void fixup_visuals(int screen) - } - } - } -+#endif -+static void __glXAquaScreenDestroy(__GLXscreen *screen) { - --static void init_screen_visuals(int screen) --{ -- ScreenPtr pScreen = screenInfo.screens[screen]; -- __GLcontextModes *modes; -- int *used; -- int i, j; -+ GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen); -+ __glXScreenDestroy(screen); - -+ free(screen); -+} -+ -+static void init_screen_visuals(__GLXAquaScreen *screen) { -+ ScreenPtr pScreen = screen->base.pScreen; -+ -+ __GLcontextModes *modes; -+ int *used; -+ int i, j; -+ - GLAQUA_DEBUG_MSG("init_screen_visuals\n"); - - /* FIXME: Change 'used' to be a array of bits (rather than of ints), - * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less - * FIXME: than 64 or 128 the stack array can be used instead of calling -- * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to -+ * FIXME: malloc / free. If nothing else, convert 'used' to - * FIXME: array of bytes instead of ints! - */ -- used = (int *)__glXMalloc(pScreen->numVisuals * sizeof(int)); -- __glXMemset(used, 0, pScreen->numVisuals * sizeof(int)); -+ used = (int *)malloc(pScreen->numVisuals * sizeof(int)); -+ memset(used, 0, pScreen->numVisuals * sizeof(int)); - - i = 0; -- for ( modes = glAquaScreens[screen].modes -+ for ( modes = screen -> base.modes - ; modes != NULL - ; modes = modes->next ) { - const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); -@@ -1261,102 +1131,70 @@ static void init_screen_visuals(int screen) - i++; - } - -- __glXFree(used); -+ free(used); - } - --static Bool glAquaScreenProbe(int screen) --{ -- ScreenPtr pScreen; -- glAquaScreenRec *screenPriv; -- -- GLAQUA_DEBUG_MSG("glAquaScreenProbe\n"); -+static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { -+ __GLXAquaScreen *screen; -+ GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n"); -+ if (screen == NULL) return NULL; - -- /* -- * Set up the current screen's visuals. -- */ -- __glDDXScreenInfo.modes = glAquaScreens[screen].modes; -- __glDDXScreenInfo.pVisualPriv = glAquaScreens[screen].priv; -- __glDDXScreenInfo.numVisuals = -- __glDDXScreenInfo.numUsableVisuals = glAquaScreens[screen].num_vis; -+ screen = malloc(sizeof *screen); - -- /* -- * Set the current screen's createContext routine. This could be -- * wrapped by a DDX GLX context creation routine. -- */ -- __glDDXScreenInfo.createContext = glAquaCreateContext; -+ __glXScreenInit(&screen->base, pScreen); - -- /* -- * The ordering of the rgb compenents might have been changed by the -- * driver after mi initialized them. -- */ -- fixup_visuals(screen); -+ screen->base.destroy = __glXAquaScreenDestroy; -+ screen->base.createContext = __glXAquaScreenCreateContext; -+ screen->base.pScreen = pScreen; - -- /* -- * Find the GLX visuals that are supported by this screen and create -- * XMesa's visuals. -- */ -- init_screen_visuals(screen); -+ init_screen_visuals(screen); - -- /* -- * Wrap RealizeWindow and UnrealizeWindow on this screen -- */ -- pScreen = screenInfo.screens[screen]; -- screenPriv = &glAquaScreens[screen]; -- screenPriv->RealizeWindow = pScreen->RealizeWindow; -- pScreen->RealizeWindow = glAquaRealizeWindow; -- screenPriv->UnrealizeWindow = pScreen->UnrealizeWindow; -- pScreen->UnrealizeWindow = glAquaUnrealizeWindow; -- -- return TRUE; --} -- --static GLboolean glAquaSwapBuffers(__GLXdrawablePrivate *glxPriv) --{ -- // swap buffers on only *one* of the contexts -- // (e.g. the last one for drawing) -- __GLcontext *gc = (__GLcontext *)glxPriv->drawGlxc->gc; -- CGLError gl_err; -- -- GLAQUA_DEBUG_MSG("glAquaSwapBuffers\n"); -- -- if (gc != NULL && gc->ctx != NULL) -- { -- gl_err = CGLFlushDrawable(gc->ctx); -- if (gl_err != 0) -- ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err)); -- } -- -- return GL_TRUE; -+ return &screen->base; - } - --static void glAquaDestroyDrawablePrivate(__GLdrawablePrivate *glPriv) --{ -+static void __glXAquaDrawableDestroy(__GLXdrawable *base) { - GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n"); - - /* It doesn't work to call DRIDestroySurface here, the drawable's - already gone.. But dri.c notices the window destruction and - frees the surface itself. */ - -- free(glPriv->private); -- glPriv->private = NULL; -+ free(base); - } - --static void glAquaCreateBuffer(__GLXdrawablePrivate *glxPriv) -+static __GLXdrawable * -+__glXAquaContextCreateDrawable(__GLXcontext *context, -+ DrawablePtr pDraw, -+ XID drawId) - { -- GLAquaDrawableRec *aquaPriv = malloc(sizeof(GLAquaDrawableRec)); -- __GLdrawablePrivate *glPriv = &glxPriv->glPriv; -+ __GLXAquaDrawable *glxPriv; -+ __GLXscreen *pGlxScreen; -+ -+ GLAQUA_DEBUG_MSG("glAquaContextCreateDrawable(%p,%p,%d)\n", context, pDraw, drawId); -+ if (glxPriv == NULL) return NULL; -+ glxPriv = xalloc(sizeof *glxPriv); -+ -+ memset(glxPriv, 0, sizeof *glxPriv); - -- aquaPriv->sid = 0; -- aquaPriv->pDraw = NULL; -+ if (!__glXDrawableInit(&glxPriv->base, context, pDraw, drawId)) { -+ xfree(glxPriv); -+ return NULL; -+ } -+ -+ glxPriv->base.destroy = __glXAquaDrawableDestroy; -+ glxPriv->base.resize = __glXAquaDrawableResize; -+ glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers; -+ -+ pGlxScreen = __glXActiveScreens[pDraw->pScreen->myNum]; - -- GLAQUA_DEBUG_MSG("glAquaCreateBuffer\n"); -+ if (glxPriv->base.type == DRAWABLE_WINDOW) { -+ VisualID vid = wVisual((WindowPtr)pDraw); - -- // replace swapBuffers (original is never called) -- glxPriv->swapBuffers = glAquaSwapBuffers; -+ glxPriv->base.modes = _gl_context_modes_find_visual(pGlxScreen->modes, vid); -+ } else -+ glxPriv->base.modes = glxPriv->base.pGlxPixmap->modes; - -- // stash private data -- glPriv->private = aquaPriv; -- glPriv->freePrivate = glAquaDestroyDrawablePrivate; -+ return &glxPriv->base; - } - - static void glAquaResetExtension(void) -@@ -1377,3 +1215,1239 @@ GLuint __glFloorLog2(GLuint val) - } - return c; - } -+ -+static void setup_dispatch_table(void) { -+ struct _glapi_table *disp=_glapi_get_dispatch(); -+ -+ SET_NewList(disp, glNewList); -+ SET_EndList(disp, glEndList); -+ SET_CallList(disp, glCallList); -+ SET_CallLists(disp, glCallLists); -+ SET_DeleteLists(disp, glDeleteLists); -+ SET_GenLists(disp, glGenLists); -+ SET_ListBase(disp, glListBase); -+ SET_Begin(disp, glBegin); -+ SET_Bitmap(disp, glBitmap); -+ SET_Color3b(disp, glColor3b); -+ SET_Color3bv(disp, glColor3bv); -+ SET_Color3d(disp, glColor3d); -+ SET_Color3dv(disp, glColor3dv); -+ SET_Color3f(disp, glColor3f); -+ SET_Color3fv(disp, glColor3fv); -+ SET_Color3i(disp, glColor3i); -+ SET_Color3iv(disp, glColor3iv); -+ SET_Color3s(disp, glColor3s); -+ SET_Color3sv(disp, glColor3sv); -+ SET_Color3ub(disp, glColor3ub); -+ SET_Color3ubv(disp, glColor3ubv); -+ SET_Color3ui(disp, glColor3ui); -+ SET_Color3uiv(disp, glColor3uiv); -+ SET_Color3us(disp, glColor3us); -+ SET_Color3usv(disp, glColor3usv); -+ SET_Color4b(disp, glColor4b); -+ SET_Color4bv(disp, glColor4bv); -+ SET_Color4d(disp, glColor4d); -+ SET_Color4dv(disp, glColor4dv); -+ SET_Color4f(disp, glColor4f); -+ SET_Color4fv(disp, glColor4fv); -+ SET_Color4i(disp, glColor4i); -+ SET_Color4iv(disp, glColor4iv); -+ SET_Color4s(disp, glColor4s); -+ SET_Color4sv(disp, glColor4sv); -+ SET_Color4ub(disp, glColor4ub); -+ SET_Color4ubv(disp, glColor4ubv); -+ SET_Color4ui(disp, glColor4ui); -+ SET_Color4uiv(disp, glColor4uiv); -+ SET_Color4us(disp, glColor4us); -+ SET_Color4usv(disp, glColor4usv); -+ SET_EdgeFlag(disp, glEdgeFlag); -+ SET_EdgeFlagv(disp, glEdgeFlagv); -+ SET_End(disp, glEnd); -+ SET_Indexd(disp, glIndexd); -+ SET_Indexdv(disp, glIndexdv); -+ SET_Indexf(disp, glIndexf); -+ SET_Indexfv(disp, glIndexfv); -+ SET_Indexi(disp, glIndexi); -+ SET_Indexiv(disp, glIndexiv); -+ SET_Indexs(disp, glIndexs); -+ SET_Indexsv(disp, glIndexsv); -+ SET_Normal3b(disp, glNormal3b); -+ SET_Normal3bv(disp, glNormal3bv); -+ SET_Normal3d(disp, glNormal3d); -+ SET_Normal3dv(disp, glNormal3dv); -+ SET_Normal3f(disp, glNormal3f); -+ SET_Normal3fv(disp, glNormal3fv); -+ SET_Normal3i(disp, glNormal3i); -+ SET_Normal3iv(disp, glNormal3iv); -+ SET_Normal3s(disp, glNormal3s); -+ SET_Normal3sv(disp, glNormal3sv); -+ SET_RasterPos2d(disp, glRasterPos2d); -+ SET_RasterPos2dv(disp, glRasterPos2dv); -+ SET_RasterPos2f(disp, glRasterPos2f); -+ SET_RasterPos2fv(disp, glRasterPos2fv); -+ SET_RasterPos2i(disp, glRasterPos2i); -+ SET_RasterPos2iv(disp, glRasterPos2iv); -+ SET_RasterPos2s(disp, glRasterPos2s); -+ SET_RasterPos2sv(disp, glRasterPos2sv); -+ SET_RasterPos3d(disp, glRasterPos3d); -+ SET_RasterPos3dv(disp, glRasterPos3dv); -+ SET_RasterPos3f(disp, glRasterPos3f); -+ SET_RasterPos3fv(disp, glRasterPos3fv); -+ SET_RasterPos3i(disp, glRasterPos3i); -+ SET_RasterPos3iv(disp, glRasterPos3iv); -+ SET_RasterPos3s(disp, glRasterPos3s); -+ SET_RasterPos3sv(disp, glRasterPos3sv); -+ SET_RasterPos4d(disp, glRasterPos4d); -+ SET_RasterPos4dv(disp, glRasterPos4dv); -+ SET_RasterPos4f(disp, glRasterPos4f); -+ SET_RasterPos4fv(disp, glRasterPos4fv); -+ SET_RasterPos4i(disp, glRasterPos4i); -+ SET_RasterPos4iv(disp, glRasterPos4iv); -+ SET_RasterPos4s(disp, glRasterPos4s); -+ SET_RasterPos4sv(disp, glRasterPos4sv); -+ SET_Rectd(disp, glRectd); -+ SET_Rectdv(disp, glRectdv); -+ SET_Rectf(disp, glRectf); -+ SET_Rectfv(disp, glRectfv); -+ SET_Recti(disp, glRecti); -+ SET_Rectiv(disp, glRectiv); -+ SET_Rects(disp, glRects); -+ SET_Rectsv(disp, glRectsv); -+ SET_TexCoord1d(disp, glTexCoord1d); -+ SET_TexCoord1dv(disp, glTexCoord1dv); -+ SET_TexCoord1f(disp, glTexCoord1f); -+ SET_TexCoord1fv(disp, glTexCoord1fv); -+ SET_TexCoord1i(disp, glTexCoord1i); -+ SET_TexCoord1iv(disp, glTexCoord1iv); -+ SET_TexCoord1s(disp, glTexCoord1s); -+ SET_TexCoord1sv(disp, glTexCoord1sv); -+ SET_TexCoord2d(disp, glTexCoord2d); -+ SET_TexCoord2dv(disp, glTexCoord2dv); -+ SET_TexCoord2f(disp, glTexCoord2f); -+ SET_TexCoord2fv(disp, glTexCoord2fv); -+ SET_TexCoord2i(disp, glTexCoord2i); -+ SET_TexCoord2iv(disp, glTexCoord2iv); -+ SET_TexCoord2s(disp, glTexCoord2s); -+ SET_TexCoord2sv(disp, glTexCoord2sv); -+ SET_TexCoord3d(disp, glTexCoord3d); -+ SET_TexCoord3dv(disp, glTexCoord3dv); -+ SET_TexCoord3f(disp, glTexCoord3f); -+ SET_TexCoord3fv(disp, glTexCoord3fv); -+ SET_TexCoord3i(disp, glTexCoord3i); -+ SET_TexCoord3iv(disp, glTexCoord3iv); -+ SET_TexCoord3s(disp, glTexCoord3s); -+ SET_TexCoord3sv(disp, glTexCoord3sv); -+ SET_TexCoord4d(disp, glTexCoord4d); -+ SET_TexCoord4dv(disp, glTexCoord4dv); -+ SET_TexCoord4f(disp, glTexCoord4f); -+ SET_TexCoord4fv(disp, glTexCoord4fv); -+ SET_TexCoord4i(disp, glTexCoord4i); -+ SET_TexCoord4iv(disp, glTexCoord4iv); -+ SET_TexCoord4s(disp, glTexCoord4s); -+ SET_TexCoord4sv(disp, glTexCoord4sv); -+ SET_Vertex2d(disp, glVertex2d); -+ SET_Vertex2dv(disp, glVertex2dv); -+ SET_Vertex2f(disp, glVertex2f); -+ SET_Vertex2fv(disp, glVertex2fv); -+ SET_Vertex2i(disp, glVertex2i); -+ SET_Vertex2iv(disp, glVertex2iv); -+ SET_Vertex2s(disp, glVertex2s); -+ SET_Vertex2sv(disp, glVertex2sv); -+ SET_Vertex3d(disp, glVertex3d); -+ SET_Vertex3dv(disp, glVertex3dv); -+ SET_Vertex3f(disp, glVertex3f); -+ SET_Vertex3fv(disp, glVertex3fv); -+ SET_Vertex3i(disp, glVertex3i); -+ SET_Vertex3iv(disp, glVertex3iv); -+ SET_Vertex3s(disp, glVertex3s); -+ SET_Vertex3sv(disp, glVertex3sv); -+ SET_Vertex4d(disp, glVertex4d); -+ SET_Vertex4dv(disp, glVertex4dv); -+ SET_Vertex4f(disp, glVertex4f); -+ SET_Vertex4fv(disp, glVertex4fv); -+ SET_Vertex4i(disp, glVertex4i); -+ SET_Vertex4iv(disp, glVertex4iv); -+ SET_Vertex4s(disp, glVertex4s); -+ SET_Vertex4sv(disp, glVertex4sv); -+ SET_ClipPlane(disp, glClipPlane); -+ SET_ColorMaterial(disp, glColorMaterial); -+ SET_CullFace(disp, glCullFace); -+ SET_Fogf(disp, glFogf); -+ SET_Fogfv(disp, glFogfv); -+ SET_Fogi(disp, glFogi); -+ SET_Fogiv(disp, glFogiv); -+ SET_FrontFace(disp, glFrontFace); -+ SET_Hint(disp, glHint); -+ SET_Lightf(disp, glLightf); -+ SET_Lightfv(disp, glLightfv); -+ SET_Lighti(disp, glLighti); -+ SET_Lightiv(disp, glLightiv); -+ SET_LightModelf(disp, glLightModelf); -+ SET_LightModelfv(disp, glLightModelfv); -+ SET_LightModeli(disp, glLightModeli); -+ SET_LightModeliv(disp, glLightModeliv); -+ SET_LineStipple(disp, glLineStipple); -+ SET_LineWidth(disp, glLineWidth); -+ SET_Materialf(disp, glMaterialf); -+ SET_Materialfv(disp, glMaterialfv); -+ SET_Materiali(disp, glMateriali); -+ SET_Materialiv(disp, glMaterialiv); -+ SET_PointSize(disp, glPointSize); -+ SET_PolygonMode(disp, glPolygonMode); -+ SET_PolygonStipple(disp, glPolygonStipple); -+ SET_Scissor(disp, glScissor); -+ SET_ShadeModel(disp, glShadeModel); -+ SET_TexParameterf(disp, glTexParameterf); -+ SET_TexParameterfv(disp, glTexParameterfv); -+ SET_TexParameteri(disp, glTexParameteri); -+ SET_TexParameteriv(disp, glTexParameteriv); -+ SET_TexImage1D(disp, glTexImage1D); -+ SET_TexImage2D(disp, glTexImage2D); -+ SET_TexEnvf(disp, glTexEnvf); -+ SET_TexEnvfv(disp, glTexEnvfv); -+ SET_TexEnvi(disp, glTexEnvi); -+ SET_TexEnviv(disp, glTexEnviv); -+ SET_TexGend(disp, glTexGend); -+ SET_TexGendv(disp, glTexGendv); -+ SET_TexGenf(disp, glTexGenf); -+ SET_TexGenfv(disp, glTexGenfv); -+ SET_TexGeni(disp, glTexGeni); -+ SET_TexGeniv(disp, glTexGeniv); -+ SET_FeedbackBuffer(disp, glFeedbackBuffer); -+ SET_SelectBuffer(disp, glSelectBuffer); -+ SET_RenderMode(disp, glRenderMode); -+ SET_InitNames(disp, glInitNames); -+ SET_LoadName(disp, glLoadName); -+ SET_PassThrough(disp, glPassThrough); -+ SET_PopName(disp, glPopName); -+ SET_PushName(disp, glPushName); -+ SET_DrawBuffer(disp, glDrawBuffer); -+ SET_Clear(disp, glClear); -+ SET_ClearAccum(disp, glClearAccum); -+ SET_ClearIndex(disp, glClearIndex); -+ SET_ClearColor(disp, glClearColor); -+ SET_ClearStencil(disp, glClearStencil); -+ SET_ClearDepth(disp, glClearDepth); -+ SET_StencilMask(disp, glStencilMask); -+ SET_ColorMask(disp, glColorMask); -+ SET_DepthMask(disp, glDepthMask); -+ SET_IndexMask(disp, glIndexMask); -+ SET_Accum(disp, glAccum); -+ SET_Disable(disp, glDisable); -+ SET_Enable(disp, glEnable); -+ SET_Finish(disp, glFinish); -+ SET_Flush(disp, glFlush); -+ SET_PopAttrib(disp, glPopAttrib); -+ SET_PushAttrib(disp, glPushAttrib); -+ SET_Map1d(disp, glMap1d); -+ SET_Map1f(disp, glMap1f); -+ SET_Map2d(disp, glMap2d); -+ SET_Map2f(disp, glMap2f); -+ SET_MapGrid1d(disp, glMapGrid1d); -+ SET_MapGrid1f(disp, glMapGrid1f); -+ SET_MapGrid2d(disp, glMapGrid2d); -+ SET_MapGrid2f(disp, glMapGrid2f); -+ SET_EvalCoord1d(disp, glEvalCoord1d); -+ SET_EvalCoord1dv(disp, glEvalCoord1dv); -+ SET_EvalCoord1f(disp, glEvalCoord1f); -+ SET_EvalCoord1fv(disp, glEvalCoord1fv); -+ SET_EvalCoord2d(disp, glEvalCoord2d); -+ SET_EvalCoord2dv(disp, glEvalCoord2dv); -+ SET_EvalCoord2f(disp, glEvalCoord2f); -+ SET_EvalCoord2fv(disp, glEvalCoord2fv); -+ SET_EvalMesh1(disp, glEvalMesh1); -+ SET_EvalPoint1(disp, glEvalPoint1); -+ SET_EvalMesh2(disp, glEvalMesh2); -+ SET_EvalPoint2(disp, glEvalPoint2); -+ SET_AlphaFunc(disp, glAlphaFunc); -+ SET_BlendFunc(disp, glBlendFunc); -+ SET_LogicOp(disp, glLogicOp); -+ SET_StencilFunc(disp, glStencilFunc); -+ SET_StencilOp(disp, glStencilOp); -+ SET_DepthFunc(disp, glDepthFunc); -+ SET_PixelZoom(disp, glPixelZoom); -+ SET_PixelTransferf(disp, glPixelTransferf); -+ SET_PixelTransferi(disp, glPixelTransferi); -+ SET_PixelStoref(disp, glPixelStoref); -+ SET_PixelStorei(disp, glPixelStorei); -+ SET_PixelMapfv(disp, glPixelMapfv); -+ SET_PixelMapuiv(disp, glPixelMapuiv); -+ SET_PixelMapusv(disp, glPixelMapusv); -+ SET_ReadBuffer(disp, glReadBuffer); -+ SET_CopyPixels(disp, glCopyPixels); -+ SET_ReadPixels(disp, glReadPixels); -+ SET_DrawPixels(disp, glDrawPixels); -+ SET_GetBooleanv(disp, glGetBooleanv); -+ SET_GetClipPlane(disp, glGetClipPlane); -+ SET_GetDoublev(disp, glGetDoublev); -+ SET_GetError(disp, glGetError); -+ SET_GetFloatv(disp, glGetFloatv); -+ SET_GetIntegerv(disp, glGetIntegerv); -+ SET_GetLightfv(disp, glGetLightfv); -+ SET_GetLightiv(disp, glGetLightiv); -+ SET_GetMapdv(disp, glGetMapdv); -+ SET_GetMapfv(disp, glGetMapfv); -+ SET_GetMapiv(disp, glGetMapiv); -+ SET_GetMaterialfv(disp, glGetMaterialfv); -+ SET_GetMaterialiv(disp, glGetMaterialiv); -+ SET_GetPixelMapfv(disp, glGetPixelMapfv); -+ SET_GetPixelMapuiv(disp, glGetPixelMapuiv); -+ SET_GetPixelMapusv(disp, glGetPixelMapusv); -+ SET_GetPolygonStipple(disp, glGetPolygonStipple); -+ SET_GetString(disp, glGetString); -+ SET_GetTexEnvfv(disp, glGetTexEnvfv); -+ SET_GetTexEnviv(disp, glGetTexEnviv); -+ SET_GetTexGendv(disp, glGetTexGendv); -+ SET_GetTexGenfv(disp, glGetTexGenfv); -+ SET_GetTexGeniv(disp, glGetTexGeniv); -+ SET_GetTexImage(disp, glGetTexImage); -+ SET_GetTexParameterfv(disp, glGetTexParameterfv); -+ SET_GetTexParameteriv(disp, glGetTexParameteriv); -+ SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv); -+ SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv); -+ SET_IsEnabled(disp, glIsEnabled); -+ SET_IsList(disp, glIsList); -+ SET_DepthRange(disp, glDepthRange); -+ SET_Frustum(disp, glFrustum); -+ SET_LoadIdentity(disp, glLoadIdentity); -+ SET_LoadMatrixf(disp, glLoadMatrixf); -+ SET_LoadMatrixd(disp, glLoadMatrixd); -+ SET_MatrixMode(disp, glMatrixMode); -+ SET_MultMatrixf(disp, glMultMatrixf); -+ SET_MultMatrixd(disp, glMultMatrixd); -+ SET_Ortho(disp, glOrtho); -+ SET_PopMatrix(disp, glPopMatrix); -+ SET_PushMatrix(disp, glPushMatrix); -+ SET_Rotated(disp, glRotated); -+ SET_Rotatef(disp, glRotatef); -+ SET_Scaled(disp, glScaled); -+ SET_Scalef(disp, glScalef); -+ SET_Translated(disp, glTranslated); -+ SET_Translatef(disp, glTranslatef); -+ SET_Viewport(disp, glViewport); -+ SET_ArrayElement(disp, glArrayElement); -+ SET_BindTexture(disp, glBindTexture); -+ SET_ColorPointer(disp, glColorPointer); -+ SET_DisableClientState(disp, glDisableClientState); -+ SET_DrawArrays(disp, glDrawArrays); -+ SET_DrawElements(disp, glDrawElements); -+ SET_EdgeFlagPointer(disp, glEdgeFlagPointer); -+ SET_EnableClientState(disp, glEnableClientState); -+ SET_IndexPointer(disp, glIndexPointer); -+ SET_Indexub(disp, glIndexub); -+ SET_Indexubv(disp, glIndexubv); -+ SET_InterleavedArrays(disp, glInterleavedArrays); -+ SET_NormalPointer(disp, glNormalPointer); -+ SET_PolygonOffset(disp, glPolygonOffset); -+ SET_TexCoordPointer(disp, glTexCoordPointer); -+ SET_VertexPointer(disp, glVertexPointer); -+ SET_AreTexturesResident(disp, glAreTexturesResident); -+ SET_CopyTexImage1D(disp, glCopyTexImage1D); -+ SET_CopyTexImage2D(disp, glCopyTexImage2D); -+ SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D); -+ SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D); -+ SET_DeleteTextures(disp, glDeleteTextures); -+ SET_GenTextures(disp, glGenTextures); -+ SET_GetPointerv(disp, glGetPointerv); -+ SET_IsTexture(disp, glIsTexture); -+ SET_PrioritizeTextures(disp, glPrioritizeTextures); -+ SET_TexSubImage1D(disp, glTexSubImage1D); -+ SET_TexSubImage2D(disp, glTexSubImage2D); -+ SET_PopClientAttrib(disp, glPopClientAttrib); -+ SET_PushClientAttrib(disp, glPushClientAttrib); -+ SET_BlendColor(disp, glBlendColor); -+ SET_BlendEquation(disp, glBlendEquation); -+ SET_DrawRangeElements(disp, glDrawRangeElements); -+ SET_ColorTable(disp, glColorTable); -+ SET_ColorTableParameterfv(disp, glColorTableParameterfv); -+ SET_ColorTableParameteriv(disp, glColorTableParameteriv); -+ SET_CopyColorTable(disp, glCopyColorTable); -+ SET_GetColorTable(disp, glGetColorTable); -+ SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv); -+ SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv); -+ SET_ColorSubTable(disp, glColorSubTable); -+ SET_CopyColorSubTable(disp, glCopyColorSubTable); -+ SET_ConvolutionFilter1D(disp, glConvolutionFilter1D); -+ SET_ConvolutionFilter2D(disp, glConvolutionFilter2D); -+ SET_ConvolutionParameterf(disp, glConvolutionParameterf); -+ SET_ConvolutionParameterfv(disp, glConvolutionParameterfv); -+ SET_ConvolutionParameteri(disp, glConvolutionParameteri); -+ SET_ConvolutionParameteriv(disp, glConvolutionParameteriv); -+ SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D); -+ SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D); -+ SET_GetConvolutionFilter(disp, glGetConvolutionFilter); -+ SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv); -+ SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv); -+ SET_GetSeparableFilter(disp, glGetSeparableFilter); -+ SET_SeparableFilter2D(disp, glSeparableFilter2D); -+ SET_GetHistogram(disp, glGetHistogram); -+ SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv); -+ SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv); -+ SET_GetMinmax(disp, glGetMinmax); -+ SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv); -+ SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv); -+ SET_Histogram(disp, glHistogram); -+ SET_Minmax(disp, glMinmax); -+ SET_ResetHistogram(disp, glResetHistogram); -+ SET_ResetMinmax(disp, glResetMinmax); -+ SET_TexImage3D(disp, glTexImage3D); -+ SET_TexSubImage3D(disp, glTexSubImage3D); -+ SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D); -+ SET_ActiveTextureARB(disp, glActiveTextureARB); -+ SET_ClientActiveTextureARB(disp, glClientActiveTextureARB); -+ SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB); -+ SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB); -+ SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB); -+ SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB); -+ SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB); -+ SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB); -+ SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB); -+ SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB); -+ SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB); -+ SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB); -+ SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB); -+ SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB); -+ SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB); -+ SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB); -+ SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB); -+ SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB); -+ SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB); -+ SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB); -+ SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB); -+ SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB); -+ SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB); -+ SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB); -+ SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB); -+ SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB); -+ SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB); -+ SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB); -+ SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB); -+ SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB); -+ SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB); -+ SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB); -+ SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB); -+ SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB); -+ SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB); -+ SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB); -+ SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB); -+ SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB); -+ SET_SampleCoverageARB(disp, glSampleCoverageARB); -+ SET_DrawBuffersARB(disp, glDrawBuffersARB); -+/* SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT); -+ SET_GetTexFilterFuncSGIS(disp, glGetTexFilterFuncSGIS); -+ SET_TexFilterFuncSGIS(disp, glTexFilterFuncSGIS); -+ SET_GetHistogramEXT(disp, glGetHistogramEXT); -+ SET_GetHistogramParameterfvEXT(disp, glGetHistogramParameterfvEXT); -+ SET_GetHistogramParameterivEXT(disp, glGetHistogramParameterivEXT); -+ SET_GetMinmaxEXT(disp, glGetMinmaxEXT); -+ SET_GetMinmaxParameterfvEXT(disp, glGetMinmaxParameterfvEXT); -+ SET_GetMinmaxParameterivEXT(disp, glGetMinmaxParameterivEXT); -+ SET_GetConvolutionFilterEXT(disp, glGetConvolutionFilterEXT); -+ SET_GetConvolutionParameterfvEXT(disp, glGetConvolutionParameterfvEXT); -+ SET_GetConvolutionParameterivEXT(disp, glGetConvolutionParameterivEXT); -+ SET_GetSeparableFilterEXT(disp, glGetSeparableFilterEXT); -+ SET_GetColorTableSGI(disp, glGetColorTableSGI); -+ SET_GetColorTableParameterfvSGI(disp, glGetColorTableParameterfvSGI); -+ SET_GetColorTableParameterivSGI(disp, glGetColorTableParameterivSGI); -+ SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX); -+ SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS); -+ SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS); -+ SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS); -+ SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS); -+ SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS); -+ SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS); -+ SET_TexImage4DSGIS(disp, glTexImage4DSGIS); -+ SET_TexSubImage4DSGIS(disp, glTexSubImage4DSGIS); */ -+ SET_AreTexturesResidentEXT(disp, glAreTexturesResident); -+ SET_GenTexturesEXT(disp, glGenTextures); -+ SET_IsTextureEXT(disp, glIsTexture); -+/* SET_DetailTexFuncSGIS(disp, glDetailTexFuncSGIS); -+ SET_GetDetailTexFuncSGIS(disp, glGetDetailTexFuncSGIS); -+ SET_SharpenTexFuncSGIS(disp, glSharpenTexFuncSGIS); -+ SET_GetSharpenTexFuncSGIS(disp, glGetSharpenTexFuncSGIS); -+ SET_SampleMaskSGIS(disp, glSampleMaskSGIS); -+ SET_SamplePatternSGIS(disp, glSamplePatternSGIS); -+ SET_ColorPointerEXT(disp, glColorPointerEXT); -+ SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT); -+ SET_IndexPointerEXT(disp, glIndexPointerEXT); -+ SET_NormalPointerEXT(disp, glNormalPointerEXT); -+ SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT); -+ SET_VertexPointerEXT(disp, glVertexPointerEXT); -+ SET_SpriteParameterfSGIX(disp, glSpriteParameterfSGIX); -+ SET_SpriteParameterfvSGIX(disp, glSpriteParameterfvSGIX); -+ SET_SpriteParameteriSGIX(disp, glSpriteParameteriSGIX); -+ SET_SpriteParameterivSGIX(disp, glSpriteParameterivSGIX); -+ SET_PointParameterfEXT(disp, glPointParameterfEXT); -+ SET_PointParameterfvEXT(disp, glPointParameterfvEXT); -+ SET_GetInstrumentsSGIX(disp, glGetInstrumentsSGIX); -+ SET_InstrumentsBufferSGIX(disp, glInstrumentsBufferSGIX); -+ SET_PollInstrumentsSGIX(disp, glPollInstrumentsSGIX); -+ SET_ReadInstrumentsSGIX(disp, glReadInstrumentsSGIX); -+ SET_StartInstrumentsSGIX(disp, glStartInstrumentsSGIX); -+ SET_StopInstrumentsSGIX(disp, glStopInstrumentsSGIX); -+ SET_FrameZoomSGIX(disp, glFrameZoomSGIX); -+ SET_TagSampleBufferSGIX(disp, glTagSampleBufferSGIX); -+ SET_ReferencePlaneSGIX(disp, glReferencePlaneSGIX); -+ SET_FlushRasterSGIX(disp, glFlushRasterSGIX); -+ SET_GetListParameterfvSGIX(disp, glGetListParameterfvSGIX); -+ SET_GetListParameterivSGIX(disp, glGetListParameterivSGIX); -+ SET_ListParameterfSGIX(disp, glListParameterfSGIX); -+ SET_ListParameterfvSGIX(disp, glListParameterfvSGIX); -+ SET_ListParameteriSGIX(disp, glListParameteriSGIX); -+ SET_ListParameterivSGIX(disp, glListParameterivSGIX); -+ SET_FragmentColorMaterialSGIX(disp, glFragmentColorMaterialSGIX); -+ SET_FragmentLightfSGIX(disp, glFragmentLightfSGIX); -+ SET_FragmentLightfvSGIX(disp, glFragmentLightfvSGIX); -+ SET_FragmentLightiSGIX(disp, glFragmentLightiSGIX); -+ SET_FragmentLightivSGIX(disp, glFragmentLightivSGIX); -+ SET_FragmentLightModelfSGIX(disp, glFragmentLightModelfSGIX); -+ SET_FragmentLightModelfvSGIX(disp, glFragmentLightModelfvSGIX); -+ SET_FragmentLightModeliSGIX(disp, glFragmentLightModeliSGIX); -+ SET_FragmentLightModelivSGIX(disp, glFragmentLightModelivSGIX); -+ SET_FragmentMaterialfSGIX(disp, glFragmentMaterialfSGIX); -+ SET_FragmentMaterialfvSGIX(disp, glFragmentMaterialfvSGIX); -+ SET_FragmentMaterialiSGIX(disp, glFragmentMaterialiSGIX); -+ SET_FragmentMaterialivSGIX(disp, glFragmentMaterialivSGIX); -+ SET_GetFragmentLightfvSGIX(disp, glGetFragmentLightfvSGIX); -+ SET_GetFragmentLightivSGIX(disp, glGetFragmentLightivSGIX); -+ SET_GetFragmentMaterialfvSGIX(disp, glGetFragmentMaterialfvSGIX); -+ SET_GetFragmentMaterialivSGIX(disp, glGetFragmentMaterialivSGIX); -+ SET_LightEnviSGIX(disp, glLightEnviSGIX); -+ SET_VertexWeightfEXT(disp, glVertexWeightfEXT); -+ SET_VertexWeightfvEXT(disp, glVertexWeightfvEXT); -+ SET_VertexWeightPointerEXT(disp, glVertexWeightPointerEXT); -+ SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV); -+ SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV); -+ SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV); -+ SET_CombinerParameterfNV(disp, glCombinerParameterfNV); -+ SET_CombinerParameterivNV(disp, glCombinerParameterivNV); -+ SET_CombinerParameteriNV(disp, glCombinerParameteriNV); -+ SET_CombinerInputNV(disp, glCombinerInputNV); -+ SET_CombinerOutputNV(disp, glCombinerOutputNV); -+ SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV); -+ SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV); -+ SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV); -+ SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV); -+ SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV); -+ SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV); -+ SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV); -+ SET_ResizeBuffersMESA(disp, glResizeBuffersMESA); -+ SET_WindowPos2dMESA(disp, glWindowPos2dMESA); -+ SET_WindowPos2dvMESA(disp, glWindowPos2dvMESA); -+ SET_WindowPos2fMESA(disp, glWindowPos2fMESA); -+ SET_WindowPos2fvMESA(disp, glWindowPos2fvMESA); -+ SET_WindowPos2iMESA(disp, glWindowPos2iMESA); -+ SET_WindowPos2ivMESA(disp, glWindowPos2ivMESA); -+ SET_WindowPos2sMESA(disp, glWindowPos2sMESA); -+ SET_WindowPos2svMESA(disp, glWindowPos2svMESA); -+ SET_WindowPos3dMESA(disp, glWindowPos3dMESA); -+ SET_WindowPos3dvMESA(disp, glWindowPos3dvMESA); -+ SET_WindowPos3fMESA(disp, glWindowPos3fMESA); -+ SET_WindowPos3fvMESA(disp, glWindowPos3fvMESA); -+ SET_WindowPos3iMESA(disp, glWindowPos3iMESA); -+ SET_WindowPos3ivMESA(disp, glWindowPos3ivMESA); -+ SET_WindowPos3sMESA(disp, glWindowPos3sMESA); -+ SET_WindowPos3svMESA(disp, glWindowPos3svMESA); -+ SET_WindowPos4dMESA(disp, glWindowPos4dMESA); -+ SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA); -+ SET_WindowPos4fMESA(disp, glWindowPos4fMESA); -+ SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA); -+ SET_WindowPos4iMESA(disp, glWindowPos4iMESA); -+ SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA); -+ SET_WindowPos4sMESA(disp, glWindowPos4sMESA); -+ SET_WindowPos4svMESA(disp, glWindowPos4svMESA); -+ SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT); -+ SET_IndexMaterialEXT(disp, glIndexMaterialEXT); -+ SET_IndexFuncEXT(disp, glIndexFuncEXT); -+ SET_LockArraysEXT(disp, glLockArraysEXT); -+ SET_UnlockArraysEXT(disp, glUnlockArraysEXT); -+ SET_CullParameterdvEXT(disp, glCullParameterdvEXT); -+ SET_CullParameterfvEXT(disp, glCullParameterfvEXT); -+ SET_HintPGI(disp, glHintPGI); -+ SET_FogCoordfEXT(disp, glFogCoordfEXT); -+ SET_FogCoordfvEXT(disp, glFogCoordfvEXT); -+ SET_FogCoorddEXT(disp, glFogCoorddEXT); -+ SET_FogCoorddvEXT(disp, glFogCoorddvEXT); -+ SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT); -+ SET_GetColorTableEXT(disp, glGetColorTableEXT); -+ SET_GetColorTableParameterivEXT(disp, glGetColorTableParameterivEXT); -+ SET_GetColorTableParameterfvEXT(disp, glGetColorTableParameterfvEXT); -+ SET_TbufferMask3DFX(disp, glTbufferMask3DFX); -+ SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB); -+ SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB); -+ SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB); -+ SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB); -+ SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB); -+ SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB); -+ SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB); -+ SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT); -+ SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT); -+ SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT); -+ SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT); -+ SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT); -+ SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT); -+ SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT); -+ SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT); -+ SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT); -+ SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT); -+ SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT); -+ SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT); -+ SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT); -+ SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT); -+ SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT); -+ SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT); -+ SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT); -+ SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV); -+ SET_BindProgramNV(disp, glBindProgramNV); -+ SET_DeleteProgramsNV(disp, glDeleteProgramsNV); -+ SET_ExecuteProgramNV(disp, glExecuteProgramNV); -+ SET_GenProgramsNV(disp, glGenProgramsNV); -+ SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV); -+ SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV); -+ SET_GetProgramivNV(disp, glGetProgramivNV); -+ SET_GetProgramStringNV(disp, glGetProgramStringNV); -+ SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV); -+ SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB); -+ SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB); -+ SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB); -+ SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV); -+ SET_IsProgramNV(disp, glIsProgramNV); -+ SET_LoadProgramNV(disp, glLoadProgramNV); -+ SET_ProgramParameter4dNV(disp, glProgramParameter4dNV); -+ SET_ProgramParameter4dvNV(disp, glProgramParameter4dvNV); -+ SET_ProgramParameter4fNV(disp, glProgramParameter4fNV); -+ SET_ProgramParameter4fvNV(disp, glProgramParameter4fvNV); -+ SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV); -+ SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV); -+ SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV); -+ SET_TrackMatrixNV(disp, glTrackMatrixNV); -+ SET_VertexAttribPointerNV(disp, glVertexAttribPointerNV); -+ SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB); -+ SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB); -+ SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB); -+ SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB); -+ SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB); -+ SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB); -+ SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB); -+ SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB); -+ SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB); -+ SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB); -+ SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB); -+ SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB); -+ SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB); -+ SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB); -+ SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB); -+ SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB); -+ SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB); -+ SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB); -+ SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB); -+ SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB); -+ SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB); -+ SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB); -+ SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB); -+ SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB); -+ SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB); -+ SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB); -+ SET_VertexAttribs1dvNV(disp, glVertexAttribs1dvNV); -+ SET_VertexAttribs1fvNV(disp, glVertexAttribs1fvNV); -+ SET_VertexAttribs1svNV(disp, glVertexAttribs1svNV); -+ SET_VertexAttribs2dvNV(disp, glVertexAttribs2dvNV); -+ SET_VertexAttribs2fvNV(disp, glVertexAttribs2fvNV); -+ SET_VertexAttribs2svNV(disp, glVertexAttribs2svNV); -+ SET_VertexAttribs3dvNV(disp, glVertexAttribs3dvNV); -+ SET_VertexAttribs3fvNV(disp, glVertexAttribs3fvNV); -+ SET_VertexAttribs3svNV(disp, glVertexAttribs3svNV); -+ SET_VertexAttribs4dvNV(disp, glVertexAttribs4dvNV); -+ SET_VertexAttribs4fvNV(disp, glVertexAttribs4fvNV); -+ SET_VertexAttribs4svNV(disp, glVertexAttribs4svNV); -+ SET_VertexAttribs4ubvNV(disp, glVertexAttribs4ubvNV); -+ SET_PointParameteriNV(disp, glPointParameteriNV); -+ SET_PointParameterivNV(disp, glPointParameterivNV); -+ SET_MultiDrawArraysEXT(disp, glMultiDrawArraysEXT); -+ SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT); -+ SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT); -+ SET_DeleteFencesNV(disp, glDeleteFencesNV); -+ SET_GenFencesNV(disp, glGenFencesNV); -+ SET_IsFenceNV(disp, glIsFenceNV); -+ SET_TestFenceNV(disp, glTestFenceNV); -+ SET_GetFenceivNV(disp, glGetFenceivNV); -+ SET_FinishFenceNV(disp, glFinishFenceNV); -+ SET_SetFenceNV(disp, glSetFenceNV); -+ SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB); -+ SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB); -+ SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB); -+ SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB); -+ SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB); -+ SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB); -+ SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB); -+ SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB); -+ SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB); -+ SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB); -+ SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB); -+ SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB); -+ SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB); -+ SET_ProgramStringARB(disp, glProgramStringARB); -+ SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB); -+ SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB); -+ SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB); -+ SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB); -+ SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB); -+ SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB); -+ SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB); -+ SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB); -+ SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB); -+ SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB); -+ SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB); -+ SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB); -+ SET_GetProgramivARB(disp, glGetProgramivARB); -+ SET_GetProgramStringARB(disp, glGetProgramStringARB); -+ SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV); -+ SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV); -+ SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV); -+ SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV); -+ SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV); -+ SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV); -+ SET_BindBufferARB(disp, glBindBufferARB); -+ SET_BufferDataARB(disp, glBufferDataARB); -+ SET_BufferSubDataARB(disp, glBufferSubDataARB); -+ SET_DeleteBuffersARB(disp, glDeleteBuffersARB); -+ SET_GenBuffersARB(disp, glGenBuffersARB); -+ SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB); -+ SET_GetBufferPointervARB(disp, glGetBufferPointervARB); -+ SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB); -+ SET_IsBufferARB(disp, glIsBufferARB); -+ SET_MapBufferARB(disp, glMapBufferARB); -+ SET_UnmapBufferARB(disp, glUnmapBufferARB); -+ SET_DepthBoundsEXT(disp, glDepthBoundsEXT); -+ SET_GenQueriesARB(disp, glGenQueriesARB); -+ SET_DeleteQueriesARB(disp, glDeleteQueriesARB); -+ SET_IsQueryARB(disp, glIsQueryARB); -+ SET_BeginQueryARB(disp, glBeginQueryARB); -+ SET_EndQueryARB(disp, glEndQueryARB); -+ SET_GetQueryivARB(disp, glGetQueryivARB); -+ SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB); -+ SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB); -+ SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM); -+ SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM); -+ SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT); -+ SET_DeleteObjectARB(disp, glDeleteObjectARB); -+ SET_GetHandleARB(disp, glGetHandleARB); -+ SET_DetachObjectARB(disp, glDetachObjectARB); -+ SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB); -+ SET_ShaderSourceARB(disp, glShaderSourceARB); -+ SET_CompileShaderARB(disp, glCompileShaderARB); -+ SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB); -+ SET_AttachObjectARB(disp, glAttachObjectARB); -+ SET_LinkProgramARB(disp, glLinkProgramARB); -+ SET_UseProgramObjectARB(disp, glUseProgramObjectARB); -+ SET_ValidateProgramARB(disp, glValidateProgramARB); -+ SET_Uniform1fARB(disp, glUniform1fARB); -+ SET_Uniform2fARB(disp, glUniform2fARB); -+ SET_Uniform3fARB(disp, glUniform3fARB); -+ SET_Uniform4fARB(disp, glUniform4fARB); -+ SET_Uniform1iARB(disp, glUniform1iARB); -+ SET_Uniform2iARB(disp, glUniform2iARB); -+ SET_Uniform3iARB(disp, glUniform3iARB); -+ SET_Uniform4iARB(disp, glUniform4iARB); -+ SET_Uniform1fvARB(disp, glUniform1fvARB); -+ SET_Uniform2fvARB(disp, glUniform2fvARB); -+ SET_Uniform3fvARB(disp, glUniform3fvARB); -+ SET_Uniform4fvARB(disp, glUniform4fvARB); -+ SET_Uniform1ivARB(disp, glUniform1ivARB); -+ SET_Uniform2ivARB(disp, glUniform2ivARB); -+ SET_Uniform3ivARB(disp, glUniform3ivARB); -+ SET_Uniform4ivARB(disp, glUniform4ivARB); -+ SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB); -+ SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB); -+ SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB); -+ SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB); -+ SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB); -+ SET_GetInfoLogARB(disp, glGetInfoLogARB); -+ SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB); -+ SET_GetUniformLocationARB(disp, glGetUniformLocationARB); -+ SET_GetActiveUniformARB(disp, glGetActiveUniformARB); -+ SET_GetUniformfvARB(disp, glGetUniformfvARB); -+ SET_GetUniformivARB(disp, glGetUniformivARB); -+ SET_GetShaderSourceARB(disp, glGetShaderSourceARB); -+ SET_BindAttribLocationARB(disp, glBindAttribLocationARB); -+ SET_GetActiveAttribARB(disp, glGetActiveAttribARB); -+ SET_GetAttribLocationARB(disp, glGetAttribLocationARB); -+ SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV); -+ SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV); -+ SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV); -+ SET_VertexAttrib1dNV(disp, glVertexAttrib1dNV); -+ SET_VertexAttrib1dvNV(disp, glVertexAttrib1dvNV); -+ SET_VertexAttrib1fNV(disp, glVertexAttrib1fNV); -+ SET_VertexAttrib1fvNV(disp, glVertexAttrib1fvNV); -+ SET_VertexAttrib1sNV(disp, glVertexAttrib1sNV); -+ SET_VertexAttrib1svNV(disp, glVertexAttrib1svNV); -+ SET_VertexAttrib2dNV(disp, glVertexAttrib2dNV); -+ SET_VertexAttrib2dvNV(disp, glVertexAttrib2dvNV); -+ SET_VertexAttrib2fNV(disp, glVertexAttrib2fNV); -+ SET_VertexAttrib2fvNV(disp, glVertexAttrib2fvNV); -+ SET_VertexAttrib2sNV(disp, glVertexAttrib2sNV); -+ SET_VertexAttrib2svNV(disp, glVertexAttrib2svNV); -+ SET_VertexAttrib3dNV(disp, glVertexAttrib3dNV); -+ SET_VertexAttrib3dvNV(disp, glVertexAttrib3dvNV); -+ SET_VertexAttrib3fNV(disp, glVertexAttrib3fNV); -+ SET_VertexAttrib3fvNV(disp, glVertexAttrib3fvNV); -+ SET_VertexAttrib3sNV(disp, glVertexAttrib3sNV); -+ SET_VertexAttrib3svNV(disp, glVertexAttrib3svNV); -+ SET_VertexAttrib4dNV(disp, glVertexAttrib4dNV); -+ SET_VertexAttrib4dvNV(disp, glVertexAttrib4dvNV); -+ SET_VertexAttrib4fNV(disp, glVertexAttrib4fNV); -+ SET_VertexAttrib4fvNV(disp, glVertexAttrib4fvNV); -+ SET_VertexAttrib4sNV(disp, glVertexAttrib4sNV); -+ SET_VertexAttrib4svNV(disp, glVertexAttrib4svNV); -+ SET_VertexAttrib4ubNV(disp, glVertexAttrib4ubNV); -+ SET_VertexAttrib4ubvNV(disp, glVertexAttrib4ubvNV); -+ SET_GenFragmentShadersATI(disp, glGenFragmentShadersATI); -+ SET_BindFragmentShaderATI(disp, glBindFragmentShaderATI); -+ SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderATI); -+ SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderATI); -+ SET_EndFragmentShaderATI(disp, glEndFragmentShaderATI); -+ SET_PassTexCoordATI(disp, glPassTexCoordATI); -+ SET_SampleMapATI(disp, glSampleMapATI); -+ SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1ATI); -+ SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2ATI); -+ SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3ATI); -+ SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1ATI); -+ SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2ATI); -+ SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3ATI); -+ SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantATI); -+ SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT); -+ SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT); -+ SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT); -+ SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT); -+ SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT); -+ SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT); -+ SET_IsFramebufferEXT(disp, glIsFramebufferEXT); -+ SET_BindFramebufferEXT(disp, glBindFramebufferEXT); -+ SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT); -+ SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT); -+ SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT); -+ SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT); -+ SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT); -+ SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT); -+ SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT); -+ SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT); -+ SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT); -+ SET_StencilFuncSeparate(disp, glStencilFuncSeparate); -+ SET_StencilOpSeparate(disp, glStencilOpSeparate); -+ SET_StencilMaskSeparate(disp, glStencilMaskSeparate); -+ SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT); -+ SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT); -+ SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT); -+ SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB); -+ SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB); -+ SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB); -+ SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB); -+ SET_SampleCoverageARB(disp, glSampleCoverageARB); -+ SET_DrawBuffersARB(disp, glDrawBuffersARB); -+ SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT); -+ SET_GetTexFilterFuncSGIS(disp, glGetTexFilterFuncSGIS); -+ SET_TexFilterFuncSGIS(disp, glTexFilterFuncSGIS); -+ SET_GetHistogramEXT(disp, glGetHistogramEXT); -+ SET_GetHistogramParameterfvEXT(disp, glGetHistogramParameterfvEXT); -+ SET_GetHistogramParameterivEXT(disp, glGetHistogramParameterivEXT); -+ SET_GetMinmaxEXT(disp, glGetMinmaxEXT); -+ SET_GetMinmaxParameterfvEXT(disp, glGetMinmaxParameterfvEXT); -+ SET_GetMinmaxParameterivEXT(disp, glGetMinmaxParameterivEXT); -+ SET_GetConvolutionFilterEXT(disp, glGetConvolutionFilterEXT); -+ SET_GetConvolutionParameterfvEXT(disp, glGetConvolutionParameterfvEXT); -+ SET_GetConvolutionParameterivEXT(disp, glGetConvolutionParameterivEXT); -+ SET_GetSeparableFilterEXT(disp, glGetSeparableFilterEXT); -+ SET_GetColorTableSGI(disp, glGetColorTableSGI); -+ SET_GetColorTableParameterfvSGI(disp, glGetColorTableParameterfvSGI); -+ SET_GetColorTableParameterivSGI(disp, glGetColorTableParameterivSGI); -+ SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX); -+ SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS); -+ SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS); -+ SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS); -+ SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS); -+ SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS); -+ SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS); -+ SET_TexImage4DSGIS(disp, glTexImage4DSGIS); -+ SET_TexSubImage4DSGIS(disp, glTexSubImage4DSGIS); -+ SET_AreTexturesResidentEXT(disp, glAreTexturesResidentEXT); -+ SET_GenTexturesEXT(disp, glGenTexturesEXT); -+ SET_IsTextureEXT(disp, glIsTextureEXT); -+ SET_DetailTexFuncSGIS(disp, glDetailTexFuncSGIS); -+ SET_GetDetailTexFuncSGIS(disp, glGetDetailTexFuncSGIS); -+ SET_SharpenTexFuncSGIS(disp, glSharpenTexFuncSGIS); -+ SET_GetSharpenTexFuncSGIS(disp, glGetSharpenTexFuncSGIS); -+ SET_SampleMaskSGIS(disp, glSampleMaskSGIS); -+ SET_SamplePatternSGIS(disp, glSamplePatternSGIS); -+ SET_ColorPointerEXT(disp, glColorPointerEXT); -+ SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT); -+ SET_IndexPointerEXT(disp, glIndexPointerEXT); -+ SET_NormalPointerEXT(disp, glNormalPointerEXT); -+ SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT); -+ SET_VertexPointerEXT(disp, glVertexPointerEXT); -+ SET_SpriteParameterfSGIX(disp, glSpriteParameterfSGIX); -+ SET_SpriteParameterfvSGIX(disp, glSpriteParameterfvSGIX); -+ SET_SpriteParameteriSGIX(disp, glSpriteParameteriSGIX); -+ SET_SpriteParameterivSGIX(disp, glSpriteParameterivSGIX); -+ SET_PointParameterfEXT(disp, glPointParameterfEXT); -+ SET_PointParameterfvEXT(disp, glPointParameterfvEXT); -+ SET_GetInstrumentsSGIX(disp, glGetInstrumentsSGIX); -+ SET_InstrumentsBufferSGIX(disp, glInstrumentsBufferSGIX); -+ SET_PollInstrumentsSGIX(disp, glPollInstrumentsSGIX); -+ SET_ReadInstrumentsSGIX(disp, glReadInstrumentsSGIX); -+ SET_StartInstrumentsSGIX(disp, glStartInstrumentsSGIX); -+ SET_StopInstrumentsSGIX(disp, glStopInstrumentsSGIX); -+ SET_FrameZoomSGIX(disp, glFrameZoomSGIX); -+ SET_TagSampleBufferSGIX(disp, glTagSampleBufferSGIX); -+ SET_ReferencePlaneSGIX(disp, glReferencePlaneSGIX); -+ SET_FlushRasterSGIX(disp, glFlushRasterSGIX); -+ SET_GetListParameterfvSGIX(disp, glGetListParameterfvSGIX); -+ SET_GetListParameterivSGIX(disp, glGetListParameterivSGIX); -+ SET_ListParameterfSGIX(disp, glListParameterfSGIX); -+ SET_ListParameterfvSGIX(disp, glListParameterfvSGIX); -+ SET_ListParameteriSGIX(disp, glListParameteriSGIX); -+ SET_ListParameterivSGIX(disp, glListParameterivSGIX); -+ SET_FragmentColorMaterialSGIX(disp, glFragmentColorMaterialSGIX); -+ SET_FragmentLightfSGIX(disp, glFragmentLightfSGIX); -+ SET_FragmentLightfvSGIX(disp, glFragmentLightfvSGIX); -+ SET_FragmentLightiSGIX(disp, glFragmentLightiSGIX); -+ SET_FragmentLightivSGIX(disp, glFragmentLightivSGIX); -+ SET_FragmentLightModelfSGIX(disp, glFragmentLightModelfSGIX); -+ SET_FragmentLightModelfvSGIX(disp, glFragmentLightModelfvSGIX); -+ SET_FragmentLightModeliSGIX(disp, glFragmentLightModeliSGIX); -+ SET_FragmentLightModelivSGIX(disp, glFragmentLightModelivSGIX); -+ SET_FragmentMaterialfSGIX(disp, glFragmentMaterialfSGIX); -+ SET_FragmentMaterialfvSGIX(disp, glFragmentMaterialfvSGIX); -+ SET_FragmentMaterialiSGIX(disp, glFragmentMaterialiSGIX); -+ SET_FragmentMaterialivSGIX(disp, glFragmentMaterialivSGIX); -+ SET_GetFragmentLightfvSGIX(disp, glGetFragmentLightfvSGIX); -+ SET_GetFragmentLightivSGIX(disp, glGetFragmentLightivSGIX); -+ SET_GetFragmentMaterialfvSGIX(disp, glGetFragmentMaterialfvSGIX); -+ SET_GetFragmentMaterialivSGIX(disp, glGetFragmentMaterialivSGIX); -+ SET_LightEnviSGIX(disp, glLightEnviSGIX); -+ SET_VertexWeightfEXT(disp, glVertexWeightfEXT); -+ SET_VertexWeightfvEXT(disp, glVertexWeightfvEXT); -+ SET_VertexWeightPointerEXT(disp, glVertexWeightPointerEXT); -+ SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV); -+ SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV); -+ SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV); -+ SET_CombinerParameterfNV(disp, glCombinerParameterfNV); -+ SET_CombinerParameterivNV(disp, glCombinerParameterivNV); -+ SET_CombinerParameteriNV(disp, glCombinerParameteriNV); -+ SET_CombinerInputNV(disp, glCombinerInputNV); -+ SET_CombinerOutputNV(disp, glCombinerOutputNV); -+ SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV); -+ SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV); -+ SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV); -+ SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV); -+ SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV); -+ SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV); -+ SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV); -+ SET_ResizeBuffersMESA(disp, glResizeBuffersMESA); -+ SET_WindowPos2dMESA(disp, glWindowPos2dMESA); -+ SET_WindowPos2dvMESA(disp, glWindowPos2dvMESA); -+ SET_WindowPos2fMESA(disp, glWindowPos2fMESA); -+ SET_WindowPos2fvMESA(disp, glWindowPos2fvMESA); -+ SET_WindowPos2iMESA(disp, glWindowPos2iMESA); -+ SET_WindowPos2ivMESA(disp, glWindowPos2ivMESA); -+ SET_WindowPos2sMESA(disp, glWindowPos2sMESA); -+ SET_WindowPos2svMESA(disp, glWindowPos2svMESA); -+ SET_WindowPos3dMESA(disp, glWindowPos3dMESA); -+ SET_WindowPos3dvMESA(disp, glWindowPos3dvMESA); -+ SET_WindowPos3fMESA(disp, glWindowPos3fMESA); -+ SET_WindowPos3fvMESA(disp, glWindowPos3fvMESA); -+ SET_WindowPos3iMESA(disp, glWindowPos3iMESA); -+ SET_WindowPos3ivMESA(disp, glWindowPos3ivMESA); -+ SET_WindowPos3sMESA(disp, glWindowPos3sMESA); -+ SET_WindowPos3svMESA(disp, glWindowPos3svMESA); -+ SET_WindowPos4dMESA(disp, glWindowPos4dMESA); -+ SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA); -+ SET_WindowPos4fMESA(disp, glWindowPos4fMESA); -+ SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA); -+ SET_WindowPos4iMESA(disp, glWindowPos4iMESA); -+ SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA); -+ SET_WindowPos4sMESA(disp, glWindowPos4sMESA); -+ SET_WindowPos4svMESA(disp, glWindowPos4svMESA); -+ SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT); -+ SET_IndexMaterialEXT(disp, glIndexMaterialEXT); -+ SET_IndexFuncEXT(disp, glIndexFuncEXT); -+ SET_LockArraysEXT(disp, glLockArraysEXT); -+ SET_UnlockArraysEXT(disp, glUnlockArraysEXT); -+ SET_CullParameterdvEXT(disp, glCullParameterdvEXT); -+ SET_CullParameterfvEXT(disp, glCullParameterfvEXT); -+ SET_HintPGI(disp, glHintPGI); -+ SET_FogCoordfEXT(disp, glFogCoordfEXT); -+ SET_FogCoordfvEXT(disp, glFogCoordfvEXT); -+ SET_FogCoorddEXT(disp, glFogCoorddEXT); -+ SET_FogCoorddvEXT(disp, glFogCoorddvEXT); -+ SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT); -+ SET_GetColorTableEXT(disp, glGetColorTableEXT); -+ SET_GetColorTableParameterivEXT(disp, glGetColorTableParameterivEXT); -+ SET_GetColorTableParameterfvEXT(disp, glGetColorTableParameterfvEXT); -+ SET_TbufferMask3DFX(disp, glTbufferMask3DFX); -+ SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB); -+ SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB); -+ SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB); -+ SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB); -+ SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB); -+ SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB); -+ SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB); -+ SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT); -+ SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT); -+ SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT); -+ SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT); -+ SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT); -+ SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT); -+ SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT); -+ SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT); -+ SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT); -+ SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT); -+ SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT); -+ SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT); -+ SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT); -+ SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT); -+ SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT); -+ SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT); -+ SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT); -+ SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV); -+ SET_BindProgramNV(disp, glBindProgramNV); -+ SET_DeleteProgramsNV(disp, glDeleteProgramsNV); -+ SET_ExecuteProgramNV(disp, glExecuteProgramNV); -+ SET_GenProgramsNV(disp, glGenProgramsNV); -+ SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV); -+ SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV); -+ SET_GetProgramivNV(disp, glGetProgramivNV); -+ SET_GetProgramStringNV(disp, glGetProgramStringNV); -+ SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV); -+ SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB); -+ SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB); -+ SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB); -+ SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV); -+ SET_IsProgramNV(disp, glIsProgramNV); -+ SET_LoadProgramNV(disp, glLoadProgramNV); -+ SET_ProgramParameter4dNV(disp, glProgramParameter4dNV); -+ SET_ProgramParameter4dvNV(disp, glProgramParameter4dvNV); -+ SET_ProgramParameter4fNV(disp, glProgramParameter4fNV); -+ SET_ProgramParameter4fvNV(disp, glProgramParameter4fvNV); -+ SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV); -+ SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV); -+ SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV); -+ SET_TrackMatrixNV(disp, glTrackMatrixNV); -+ SET_VertexAttribPointerNV(disp, glVertexAttribPointerNV); -+ SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB); -+ SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB); -+ SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB); -+ SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB); -+ SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB); -+ SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB); -+ SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB); -+ SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB); -+ SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB); -+ SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB); -+ SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB); -+ SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB); -+ SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB); -+ SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB); -+ SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB); -+ SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB); -+ SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB); -+ SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB); -+ SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB); -+ SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB); -+ SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB); -+ SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB); -+ SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB); -+ SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB); -+ SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB); -+ SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB); -+ SET_VertexAttribs1dvNV(disp, glVertexAttribs1dvNV); -+ SET_VertexAttribs1fvNV(disp, glVertexAttribs1fvNV); -+ SET_VertexAttribs1svNV(disp, glVertexAttribs1svNV); -+ SET_VertexAttribs2dvNV(disp, glVertexAttribs2dvNV); -+ SET_VertexAttribs2fvNV(disp, glVertexAttribs2fvNV); -+ SET_VertexAttribs2svNV(disp, glVertexAttribs2svNV); -+ SET_VertexAttribs3dvNV(disp, glVertexAttribs3dvNV); -+ SET_VertexAttribs3fvNV(disp, glVertexAttribs3fvNV); -+ SET_VertexAttribs3svNV(disp, glVertexAttribs3svNV); -+ SET_VertexAttribs4dvNV(disp, glVertexAttribs4dvNV); -+ SET_VertexAttribs4fvNV(disp, glVertexAttribs4fvNV); -+ SET_VertexAttribs4svNV(disp, glVertexAttribs4svNV); -+ SET_VertexAttribs4ubvNV(disp, glVertexAttribs4ubvNV); -+ SET_PointParameteriNV(disp, glPointParameteriNV); -+ SET_PointParameterivNV(disp, glPointParameterivNV); -+ SET_MultiDrawArraysEXT(disp, glMultiDrawArraysEXT); -+ SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT); -+ SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT); -+ SET_DeleteFencesNV(disp, glDeleteFencesNV); -+ SET_GenFencesNV(disp, glGenFencesNV); -+ SET_IsFenceNV(disp, glIsFenceNV); -+ SET_TestFenceNV(disp, glTestFenceNV); -+ SET_GetFenceivNV(disp, glGetFenceivNV); -+ SET_FinishFenceNV(disp, glFinishFenceNV); -+ SET_SetFenceNV(disp, glSetFenceNV); -+ SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB); -+ SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB); -+ SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB); -+ SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB); -+ SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB); -+ SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB); -+ SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB); -+ SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB); -+ SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB); -+ SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB); -+ SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB); -+ SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB); -+ SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB); -+ SET_ProgramStringARB(disp, glProgramStringARB); -+ SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB); -+ SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB); -+ SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB); -+ SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB); -+ SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB); -+ SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB); -+ SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB); -+ SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB); -+ SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB); -+ SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB); -+ SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB); -+ SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB); -+ SET_GetProgramivARB(disp, glGetProgramivARB); -+ SET_GetProgramStringARB(disp, glGetProgramStringARB); -+ SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV); -+ SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV); -+ SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV); -+ SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV); -+ SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV); -+ SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV); -+ SET_BindBufferARB(disp, glBindBufferARB); -+ SET_BufferDataARB(disp, glBufferDataARB); -+ SET_BufferSubDataARB(disp, glBufferSubDataARB); -+ SET_DeleteBuffersARB(disp, glDeleteBuffersARB); -+ SET_GenBuffersARB(disp, glGenBuffersARB); -+ SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB); -+ SET_GetBufferPointervARB(disp, glGetBufferPointervARB); -+ SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB); -+ SET_IsBufferARB(disp, glIsBufferARB); -+ SET_MapBufferARB(disp, glMapBufferARB); -+ SET_UnmapBufferARB(disp, glUnmapBufferARB); -+ SET_DepthBoundsEXT(disp, glDepthBoundsEXT); -+ SET_GenQueriesARB(disp, glGenQueriesARB); -+ SET_DeleteQueriesARB(disp, glDeleteQueriesARB); -+ SET_IsQueryARB(disp, glIsQueryARB); -+ SET_BeginQueryARB(disp, glBeginQueryARB); -+ SET_EndQueryARB(disp, glEndQueryARB); -+ SET_GetQueryivARB(disp, glGetQueryivARB); -+ SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB); -+ SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB); -+ SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM); -+ SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM); -+ SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT); -+ SET_DeleteObjectARB(disp, glDeleteObjectARB); -+ SET_GetHandleARB(disp, glGetHandleARB); -+ SET_DetachObjectARB(disp, glDetachObjectARB); -+ SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB); -+ SET_ShaderSourceARB(disp, glShaderSourceARB); -+ SET_CompileShaderARB(disp, glCompileShaderARB); -+ SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB); -+ SET_AttachObjectARB(disp, glAttachObjectARB); -+ SET_LinkProgramARB(disp, glLinkProgramARB); -+ SET_UseProgramObjectARB(disp, glUseProgramObjectARB); -+ SET_ValidateProgramARB(disp, glValidateProgramARB); -+ SET_Uniform1fARB(disp, glUniform1fARB); -+ SET_Uniform2fARB(disp, glUniform2fARB); -+ SET_Uniform3fARB(disp, glUniform3fARB); -+ SET_Uniform4fARB(disp, glUniform4fARB); -+ SET_Uniform1iARB(disp, glUniform1iARB); -+ SET_Uniform2iARB(disp, glUniform2iARB); -+ SET_Uniform3iARB(disp, glUniform3iARB); -+ SET_Uniform4iARB(disp, glUniform4iARB); -+ SET_Uniform1fvARB(disp, glUniform1fvARB); -+ SET_Uniform2fvARB(disp, glUniform2fvARB); -+ SET_Uniform3fvARB(disp, glUniform3fvARB); -+ SET_Uniform4fvARB(disp, glUniform4fvARB); -+ SET_Uniform1ivARB(disp, glUniform1ivARB); -+ SET_Uniform2ivARB(disp, glUniform2ivARB); -+ SET_Uniform3ivARB(disp, glUniform3ivARB); -+ SET_Uniform4ivARB(disp, glUniform4ivARB); -+ SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB); -+ SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB); -+ SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB); -+ SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB); -+ SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB); -+ SET_GetInfoLogARB(disp, glGetInfoLogARB); -+ SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB); -+ SET_GetUniformLocationARB(disp, glGetUniformLocationARB); -+ SET_GetActiveUniformARB(disp, glGetActiveUniformARB); -+ SET_GetUniformfvARB(disp, glGetUniformfvARB); -+ SET_GetUniformivARB(disp, glGetUniformivARB); -+ SET_GetShaderSourceARB(disp, glGetShaderSourceARB); -+ SET_BindAttribLocationARB(disp, glBindAttribLocationARB); -+ SET_GetActiveAttribARB(disp, glGetActiveAttribARB); -+ SET_GetAttribLocationARB(disp, glGetAttribLocationARB); -+ SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV); -+ SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV); -+ SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV); -+ SET_VertexAttrib1dNV(disp, glVertexAttrib1dNV); -+ SET_VertexAttrib1dvNV(disp, glVertexAttrib1dvNV); -+ SET_VertexAttrib1fNV(disp, glVertexAttrib1fNV); -+ SET_VertexAttrib1fvNV(disp, glVertexAttrib1fvNV); -+ SET_VertexAttrib1sNV(disp, glVertexAttrib1sNV); -+ SET_VertexAttrib1svNV(disp, glVertexAttrib1svNV); -+ SET_VertexAttrib2dNV(disp, glVertexAttrib2dNV); -+ SET_VertexAttrib2dvNV(disp, glVertexAttrib2dvNV); -+ SET_VertexAttrib2fNV(disp, glVertexAttrib2fNV); -+ SET_VertexAttrib2fvNV(disp, glVertexAttrib2fvNV); -+ SET_VertexAttrib2sNV(disp, glVertexAttrib2sNV); -+ SET_VertexAttrib2svNV(disp, glVertexAttrib2svNV); -+ SET_VertexAttrib3dNV(disp, glVertexAttrib3dNV); -+ SET_VertexAttrib3dvNV(disp, glVertexAttrib3dvNV); -+ SET_VertexAttrib3fNV(disp, glVertexAttrib3fNV); -+ SET_VertexAttrib3fvNV(disp, glVertexAttrib3fvNV); -+ SET_VertexAttrib3sNV(disp, glVertexAttrib3sNV); -+ SET_VertexAttrib3svNV(disp, glVertexAttrib3svNV); -+ SET_VertexAttrib4dNV(disp, glVertexAttrib4dNV); -+ SET_VertexAttrib4dvNV(disp, glVertexAttrib4dvNV); -+ SET_VertexAttrib4fNV(disp, glVertexAttrib4fNV); -+ SET_VertexAttrib4fvNV(disp, glVertexAttrib4fvNV); -+ SET_VertexAttrib4sNV(disp, glVertexAttrib4sNV); -+ SET_VertexAttrib4svNV(disp, glVertexAttrib4svNV); -+ SET_VertexAttrib4ubNV(disp, glVertexAttrib4ubNV); -+ SET_VertexAttrib4ubvNV(disp, glVertexAttrib4ubvNV); -+ SET_GenFragmentShadersATI(disp, glGenFragmentShadersATI); -+ SET_BindFragmentShaderATI(disp, glBindFragmentShaderATI); -+ SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderATI); -+ SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderATI); -+ SET_EndFragmentShaderATI(disp, glEndFragmentShaderATI); -+ SET_PassTexCoordATI(disp, glPassTexCoordATI); -+ SET_SampleMapATI(disp, glSampleMapATI); -+ SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1ATI); -+ SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2ATI); -+ SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3ATI); -+ SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1ATI); -+ SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2ATI); -+ SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3ATI); -+ SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantATI); -+ SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT); -+ SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT); -+ SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT); -+ SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT); -+ SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT); -+ SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT); -+ SET_IsFramebufferEXT(disp, glIsFramebufferEXT); -+ SET_BindFramebufferEXT(disp, glBindFramebufferEXT); -+ SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT); -+ SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT); -+ SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT); -+ SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT); -+ SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT); -+ SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT); -+ SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT); -+ SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT); -+ SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT); -+ SET_StencilFuncSeparate(disp, glStencilFuncSeparate); -+ SET_StencilOpSeparate(disp, glStencilOpSeparate); -+ SET_StencilMaskSeparate(disp, glStencilMaskSeparate); -+ SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT); -+ SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT); -+ SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT); */ -+ -+} -diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am -index 8184f60..7c1730e 100644 ---- a/GL/glx/Makefile.am -+++ b/GL/glx/Makefile.am -@@ -14,7 +14,6 @@ AM_CFLAGS = \ - -I@MESA_SOURCE@/src/mesa/glapi \ - -I@MESA_SOURCE@/src/mesa/main \ - -DXFree86Server \ -- -DNO_LIBCWRAPPER \ - @GLX_DEFINES@ - - # none yet -@@ -41,18 +40,20 @@ libglxdri_la_SOURCES = \ - - libglx_la_SOURCES = \ - g_disptab.h \ -+ glxbyteorder.h \ - glxcmds.c \ - glxcmdsswap.c \ - glxcontext.h \ - glxdrawable.h \ - glxext.c \ - glxext.h \ -- glxvisuals.c \ -+ glxglcore.c \ - glxscreens.c \ - glxscreens.h \ - glxserver.h \ - glxutil.c \ - glxutil.h \ -+ glxvisuals.c \ - indirect_dispatch.c \ - indirect_dispatch.h \ - indirect_dispatch_swap.c \ -diff --git a/GL/glx/glxbyteorder.h b/GL/glx/glxbyteorder.h -new file mode 100644 -index 0000000..cdf6b15 ---- /dev/null -+++ b/GL/glx/glxbyteorder.h -@@ -0,0 +1,61 @@ -+/* -+ * (C) Copyright IBM Corporation 2006, 2007 -+ * 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, sub license, -+ * 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 NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS 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. -+ */ -+ -+/** -+ * \file glxbyteorder.h -+ * Platform glue for handling byte-ordering issues in GLX protocol. -+ * -+ * \author Ian Romanick -+ */ -+#if !defined(__GLXBYTEORDER_H__) -+#define __GLXBYTEORDER_H__ -+ -+#ifdef HAVE_DIX_CONFIG_H -+#include -+#endif -+ -+#if HAVE_BYTESWAP_H -+#include -+#elif defined(USE_SYS_ENDIAN_H) -+#include -+#elif defined(__APPLE__) -+#include -+#define bswap_16 OSSwapInt16 -+#define bswap_32 OSSwapInt32 -+#define bswap_64 OSSwapInt64 -+#else -+#define bswap_16(value) \ -+ ((((value) & 0xff) << 8) | ((value) >> 8)) -+ -+#define bswap_32(value) \ -+ (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \ -+ (uint32_t)bswap_16((uint16_t)((value) >> 16))) -+ -+#define bswap_64(value) \ -+ (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \ -+ << 32) | \ -+ (uint64_t)bswap_32((uint32_t)((value) >> 32))) -+#endif -+ -+#endif /* !defined(__GLXBYTEORDER_H__) */ -diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c -index 1585b36..900a347 100644 ---- a/GL/glx/glxcmds.c -+++ b/GL/glx/glxcmds.c -@@ -59,19 +59,6 @@ - #include "indirect_table.h" - #include "indirect_util.h" - --_X_HIDDEN int --glxCountBits(int word) --{ -- int ret = 0; -- -- while (word) { -- ret += (word & 1); -- word >>= 1; -- } -- -- return ret; --} -- - /************************************************************************/ - - void -@@ -1031,6 +1019,7 @@ __glXCreateARGBConfig(__GLXscreen *screen) - VisualPtr visual; - int i; - -+ /* search for a 32-bit visual */ - visual = NULL; - for (i = 0; i < screen->pScreen->numVisuals; i++) - if (screen->pScreen->visuals[i].nplanes == 32) { -@@ -1049,8 +1038,22 @@ __glXCreateARGBConfig(__GLXscreen *screen) - if (modes == NULL) - return; - -- modes->next = screen->modes; -- screen->modes = modes; -+ /* Insert this new mode at the TAIL of the linked list. -+ * Previously, the mode was incorrectly inserted at the head of the -+ * list, causing find_mesa_visual() to be off by one. This would -+ * GLX clients to blow up if they attempted to use the last mode -+ * in the list! -+ */ -+ { -+ __GLcontextModes *prev = NULL, *m; -+ for (m = screen->modes; m; m = m->next) -+ prev = m; -+ if (prev) -+ prev->next = modes; -+ else -+ screen->modes = modes; -+ } -+ - screen->numUsableVisuals++; - screen->numVisuals++; - -@@ -1116,6 +1119,9 @@ int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap) - } - pGlxScreen = __glXActiveScreens[screen]; - -+ /* Create the "extra" 32bpp ARGB visual, if not already added. -+ * XXX This is questionable place to do so! Re-examine this someday. -+ */ - __glXCreateARGBConfig(pGlxScreen); - - reply.numFBConfigs = pGlxScreen->numUsableVisuals; -@@ -1254,13 +1260,15 @@ static int ValidateCreateDrawable(ClientPtr client, - ** Create a GLX Pixmap from an X Pixmap. - */ - int DoCreateGLXPixmap(__GLXclientState *cl, XID fbconfigId, -- GLuint screenNum, XID pixmapId, XID glxPixmapId) -+ GLuint screenNum, XID pixmapId, XID glxPixmapId, -+ CARD32 *attribs, CARD32 numAttribs) - { - ClientPtr client = cl->client; - DrawablePtr pDraw; - __GLXpixmap *pGlxPixmap; - __GLcontextModes *modes; -- int retval; -+ GLenum target = 0; -+ int retval, i; - - retval = ValidateCreateDrawable (client, screenNum, fbconfigId, - pixmapId, glxPixmapId, -@@ -1279,11 +1287,37 @@ int DoCreateGLXPixmap(__GLXclientState *cl, XID fbconfigId, - pGlxPixmap->pGlxScreen = __glXgetActiveScreen(screenNum); - pGlxPixmap->pScreen = pDraw->pScreen; - pGlxPixmap->idExists = True; -+#ifdef XF86DRI - pGlxPixmap->pDamage = NULL; -+#endif - pGlxPixmap->refcnt = 0; - - pGlxPixmap->modes = modes; - -+ 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 (!target) { -+ int w = pDraw->width, h = pDraw->height; -+ -+ if (h & (h - 1) || w & (w - 1)) -+ target = GL_TEXTURE_RECTANGLE_ARB; -+ else -+ target = GL_TEXTURE_2D; -+ } -+ -+ pGlxPixmap->target = target; -+ - /* - ** Bump the ref count on the X pixmap so it won't disappear. - */ -@@ -1296,14 +1330,16 @@ int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) - { - xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; - return DoCreateGLXPixmap( cl, req->visual, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, NULL, 0 ); - } - - int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc) - { - xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; - return DoCreateGLXPixmap( cl, req->fbconfig, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, -+ (CARD32*)(req + 1), -+ req->numAttribs ); - } - - int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -@@ -1311,7 +1347,7 @@ int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) - xGLXCreateGLXPixmapWithConfigSGIXReq *req = - (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; - return DoCreateGLXPixmap( cl, req->fbconfig, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, NULL, 0 ); - } - - -@@ -1673,7 +1709,6 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) - xGLXGetDrawableAttributesReply reply; - CARD32 attributes[4]; - int numAttribs; -- PixmapPtr pixmap; - - glxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes); - if (!glxPixmap) { -@@ -1688,19 +1723,11 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) - reply.numAttribs = numAttribs; - - attributes[0] = GLX_TEXTURE_TARGET_EXT; -+ attributes[1] = glxPixmap->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : -+ GLX_TEXTURE_RECTANGLE_EXT; - attributes[2] = GLX_Y_INVERTED_EXT; - attributes[3] = GL_FALSE; - -- /* XXX this is merely less wrong, see fdo bug #8991 */ -- pixmap = (PixmapPtr) glxPixmap->pDraw; -- if (!(glxCountBits(pixmap->drawable.width) == 1 && -- glxCountBits(pixmap->drawable.height) == 1) -- /* || strstr(CALL_GetString(GL_EXTENSIONS, -- "GL_ARB_texture_non_power_of_two")) */) -- attributes[1] = GLX_TEXTURE_RECTANGLE_EXT; -- else -- attributes[1] = GLX_TEXTURE_2D_EXT; -- - if (client->swapped) { - __glXSwapGetDrawableAttributesReply(client, &reply, attributes); - } else { -diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c -index d59dfdb..12bc030 100644 ---- a/GL/glx/glxcmdsswap.c -+++ b/GL/glx/glxcmdsswap.c -@@ -266,7 +266,7 @@ int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) - __GLX_SWAP_INT(&req->glxpixmap); - - return DoCreateGLXPixmap( cl, req->visual, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, NULL, 0 ); - } - - int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc) -@@ -279,9 +279,12 @@ int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc) - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->pixmap); - __GLX_SWAP_INT(&req->glxpixmap); -+ __GLX_SWAP_INT(&req->numAttribs); - - return DoCreateGLXPixmap( cl, req->fbconfig, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, -+ (CARD32*)(req + 1), -+ req->numAttribs ); - } - - int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -@@ -297,7 +300,7 @@ int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc - __GLX_SWAP_INT(&req->glxpixmap); - - return DoCreateGLXPixmap( cl, req->fbconfig, req->screen, -- req->pixmap, req->glxpixmap ); -+ req->pixmap, req->glxpixmap, NULL, 0 ); - } - - int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) -@@ -496,11 +499,11 @@ int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) - GLXDrawable *drawId; - int *buffer; - -+ __GLX_DECLARE_SWAP_VARIABLES; -+ - (void) drawId; - (void) buffer; - -- __GLX_DECLARE_SWAP_VARIABLES; -- - pc += __GLX_VENDPRIV_HDR_SIZE; - - __GLX_SWAP_SHORT(&req->length); -diff --git a/GL/glx/glxcontext.h b/GL/glx/glxcontext.h -index a54e323..eb10ee2 100644 ---- a/GL/glx/glxcontext.h -+++ b/GL/glx/glxcontext.h -@@ -40,9 +40,6 @@ - ** - */ - --/* XXX: should be defined somewhere globally */ --#define CAPI -- - #include "GL/internal/glcore.h" - - typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap; -diff --git a/GL/glx/glxdrawable.h b/GL/glx/glxdrawable.h -index 20e9b43..b7ecad9 100644 ---- a/GL/glx/glxdrawable.h -+++ b/GL/glx/glxdrawable.h -@@ -42,6 +42,10 @@ - - #include - -+#ifdef XF86DRI -+#include -+#endif -+ - typedef struct { - - DrawablePtr pDraw; -@@ -50,7 +54,13 @@ typedef struct { - ScreenPtr pScreen; - Bool idExists; - int refcnt; -+ GLenum target; -+#ifdef XF86DRI - DamagePtr pDamage; -+ __DRIcontext *pDRICtx; -+ GLint texname; -+ unsigned long offset; -+#endif - } __GLXpixmap; - - struct __GLXdrawable { -diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c -index 788b87d..685683d 100644 ---- a/GL/glx/glxdri.c -+++ b/GL/glx/glxdri.c -@@ -76,6 +76,11 @@ struct __GLXDRIscreen { - xf86EnterVTProc *enterVT; - xf86LeaveVTProc *leaveVT; - -+ DRITexOffsetStartProcPtr texOffsetStart; -+ DRITexOffsetFinishProcPtr texOffsetFinish; -+ __GLXpixmap* texOffsetOverride[16]; -+ GLuint lastTexOffsetOverride; -+ - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; - }; - -@@ -125,30 +130,75 @@ struct __GLXDRIdrawable { - static const char CREATE_NEW_SCREEN_FUNC[] = - "__driCreateNewScreen_" STRINGIFY (INTERNAL_VERSION); - --/* The DRI driver entry point version wasn't bumped when the -- * copySubBuffer functionality was added to the DRI drivers, but the -- * functionality is still conditional on the value of the -- * internal_api_version passed to __driCreateNewScreen. However, the -- * screen constructor doesn't fail for a DRI driver that's older than -- * the passed in version number, so there's no way we can know for -- * sure that we can actually use the copySubBuffer functionality. But -- * since the earliest (and at this point only) released mesa version -- * (6.5) that uses the 20050727 entry point does have copySubBuffer, -- * we'll just settle for that. We still have to pass in a higher to -- * the screen constructor to enable the functionality. -- */ --#define COPY_SUB_BUFFER_INTERNAL_VERSION 20060314 - - static void --__glXDRIleaveServer(void) -+__glXDRIleaveServer(GLboolean rendering) - { -- DRIBlockHandler(NULL, NULL, NULL); -+ int i; -+ -+ for (i = 0; rendering && i < screenInfo.numScreens; i++) { -+ __GLXDRIscreen * const screen = -+ (__GLXDRIscreen *) __glXgetActiveScreen(i); -+ GLuint lastOverride = screen->lastTexOffsetOverride; -+ -+ if (lastOverride) { -+ __GLXpixmap **texOffsetOverride = screen->texOffsetOverride; -+ int j; -+ -+ for (j = 0; j < lastOverride; j++) { -+ __GLXpixmap *pGlxPix = texOffsetOverride[j]; -+ -+ if (pGlxPix && pGlxPix->texname) { -+ pGlxPix->offset = -+ screen->texOffsetStart((PixmapPtr)pGlxPix->pDraw); -+ } -+ } -+ } -+ } -+ -+ DRIBlockHandler(NULL, NULL, NULL); -+ -+ for (i = 0; rendering && i < screenInfo.numScreens; i++) { -+ __GLXDRIscreen * const screen = -+ (__GLXDRIscreen *) __glXgetActiveScreen(i); -+ GLuint lastOverride = screen->lastTexOffsetOverride; -+ -+ if (lastOverride) { -+ __GLXpixmap **texOffsetOverride = screen->texOffsetOverride; -+ int j; -+ -+ for (j = 0; j < lastOverride; j++) { -+ __GLXpixmap *pGlxPix = texOffsetOverride[j]; -+ -+ if (pGlxPix && pGlxPix->texname) { -+ screen->driScreen.setTexOffset(pGlxPix->pDRICtx, -+ pGlxPix->texname, -+ pGlxPix->offset, -+ pGlxPix->pDraw->depth, -+ ((PixmapPtr)pGlxPix->pDraw)-> -+ devKind); -+ } -+ } -+ } -+ } - } - - static void --__glXDRIenterServer(void) -+__glXDRIenterServer(GLboolean rendering) - { -- DRIWakeupHandler(NULL, 0, NULL); -+ int i; -+ -+ for (i = 0; rendering && i < screenInfo.numScreens; i++) { -+ __GLXDRIscreen * const screen = -+ (__GLXDRIscreen *) __glXgetActiveScreen(i); -+ -+ if (screen->lastTexOffsetOverride) { -+ CALL_Flush(GET_DISPATCH(), ()); -+ break; -+ } -+ } -+ -+ DRIWakeupHandler(NULL, 0, NULL); - } - - /** -@@ -322,19 +372,68 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - int buffer, - __GLXpixmap *glxPixmap) - { -- RegionPtr pRegion; -+ RegionPtr pRegion = NULL; - PixmapPtr pixmap; -- int bpp; -- GLenum target, format, type; -+ int bpp, override = 0; -+ GLenum format, type; -+ ScreenPtr pScreen = glxPixmap->pScreen; -+ __GLXDRIscreen * const screen = -+ (__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum); - - pixmap = (PixmapPtr) glxPixmap->pDraw; -+ -+ if (screen->texOffsetStart && screen->driScreen.setTexOffset) { -+ __GLXpixmap **texOffsetOverride = screen->texOffsetOverride; -+ int i, firstEmpty = 16, texname; -+ -+ for (i = 0; i < 16; i++) { -+ if (texOffsetOverride[i] == glxPixmap) -+ goto alreadyin; -+ -+ if (firstEmpty == 16 && !texOffsetOverride[i]) -+ firstEmpty = i; -+ } -+ -+ if (firstEmpty == 16) { -+ ErrorF("%s: Failed to register texture offset override\n", __func__); -+ goto nooverride; -+ } -+ -+ if (firstEmpty >= screen->lastTexOffsetOverride) -+ screen->lastTexOffsetOverride = firstEmpty + 1; -+ -+ texOffsetOverride[firstEmpty] = glxPixmap; -+ -+alreadyin: -+ override = 1; -+ -+ glxPixmap->pDRICtx = &((__GLXDRIcontext*)baseContext)->driContext; -+ -+ CALL_GetIntegerv(GET_DISPATCH(), (glxPixmap->target == GL_TEXTURE_2D ? -+ GL_TEXTURE_BINDING_2D : -+ GL_TEXTURE_BINDING_RECTANGLE_NV, -+ &texname)); -+ -+ if (texname == glxPixmap->texname) -+ return Success; -+ -+ glxPixmap->texname = texname; -+ -+ screen->driScreen.setTexOffset(glxPixmap->pDRICtx, texname, 0, -+ pixmap->drawable.depth, pixmap->devKind); -+ } -+nooverride: -+ - if (!glxPixmap->pDamage) { -- glxPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone, -- TRUE, glxPixmap->pScreen, NULL); -- if (!glxPixmap->pDamage) -- return BadAlloc; -+ if (!override) { -+ glxPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone, -+ TRUE, pScreen, NULL); -+ if (!glxPixmap->pDamage) -+ return BadAlloc; -+ -+ DamageRegister ((DrawablePtr) pixmap, glxPixmap->pDamage); -+ } - -- DamageRegister ((DrawablePtr) pixmap, glxPixmap->pDamage); - pRegion = NULL; - } else { - pRegion = DamageRegion(glxPixmap->pDamage); -@@ -347,30 +446,22 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - bpp = 4; - format = GL_BGRA; - type = --#if X_BYTE_ORDER == X_LITTLE_ENDIAN -- GL_UNSIGNED_BYTE; --#else -- GL_UNSIGNED_INT_8_8_8_8_REV; -+#if X_BYTE_ORDER == X_BIG_ENDIAN -+ !override ? GL_UNSIGNED_INT_8_8_8_8_REV : - #endif -+ GL_UNSIGNED_BYTE; - } else { - bpp = 2; - format = GL_RGB; - type = GL_UNSIGNED_SHORT_5_6_5; - } - -- if (!(glxCountBits(pixmap->drawable.width) == 1 && -- glxCountBits(pixmap->drawable.height) == 1) -- /* || strstr(CALL_GetString(GL_EXTENSIONS, -- "GL_ARB_texture_non_power_of_two")) */) -- target = GL_TEXTURE_RECTANGLE_ARB; -- else -- target = GL_TEXTURE_2D; -- - CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, - pixmap->devKind / bpp) ); -+ - if (pRegion == NULL) - { -- if (pixmap->drawable.depth == 24) -+ if (!override && pixmap->drawable.depth == 24) - glxFillAlphaChannel(pixmap, - pixmap->drawable.x, - pixmap->drawable.y, -@@ -383,7 +474,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - pixmap->drawable.y) ); - - CALL_TexImage2D( GET_DISPATCH(), -- (target, -+ (glxPixmap->target, - 0, - bpp == 4 ? 4 : 3, - pixmap->drawable.width, -@@ -391,8 +482,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - 0, - format, - type, -- pixmap->devPrivate.ptr) ); -- } else { -+ override ? NULL : pixmap->devPrivate.ptr) ); -+ } else if (!override) { - int i, numRects; - BoxPtr p; - -@@ -413,7 +504,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - pixmap->drawable.y + p[i].y1) ); - - CALL_TexSubImage2D( GET_DISPATCH(), -- (target, -+ (glxPixmap->target, - 0, - p[i].x1, p[i].y1, - p[i].x2 - p[i].x1, p[i].y2 - p[i].y1, -@@ -423,7 +514,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, - } - } - -- DamageEmpty(glxPixmap->pDamage); -+ if (!override) -+ DamageEmpty(glxPixmap->pDamage); - - return Success; - } -@@ -433,6 +525,40 @@ __glXDRIreleaseTexImage(__GLXcontext *baseContext, - int buffer, - __GLXpixmap *pixmap) - { -+ ScreenPtr pScreen = pixmap->pScreen; -+ __GLXDRIscreen * const screen = -+ (__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum); -+ GLuint lastOverride = screen->lastTexOffsetOverride; -+ -+ if (lastOverride) { -+ __GLXpixmap **texOffsetOverride = screen->texOffsetOverride; -+ int i; -+ -+ for (i = 0; i < lastOverride; i++) { -+ if (texOffsetOverride[i] == pixmap) { -+ if (screen->texOffsetFinish) -+ screen->texOffsetFinish((PixmapPtr)pixmap->pDraw); -+ -+ texOffsetOverride[i] = NULL; -+ -+ if (i + 1 == lastOverride) { -+ lastOverride = 0; -+ -+ while (i--) { -+ if (texOffsetOverride[i]) { -+ lastOverride = i + 1; -+ break; -+ } -+ } -+ -+ screen->lastTexOffsetOverride = lastOverride; -+ -+ break; -+ } -+ } -+ } -+ } -+ - return Success; - } - -@@ -482,6 +608,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, - context->base.loseCurrent = __glXDRIcontextLoseCurrent; - context->base.copy = __glXDRIcontextCopy; - context->base.forceCurrent = __glXDRIcontextForceCurrent; -+ context->base.pScreen = screen->base.pScreen; - - context->base.textureFromPixmap = &__glXDRItextureFromPixmap; - -@@ -624,9 +751,16 @@ static __DRIscreen *findScreen(__DRInativeDisplay *dpy, int scrn) - - static GLboolean windowExists(__DRInativeDisplay *dpy, __DRIid draw) - { -- WindowPtr pWin = (WindowPtr) LookupIDByType(draw, RT_WINDOW); -- -- return pWin == NULL ? GL_FALSE : GL_TRUE; -+ DrawablePtr pDrawable = (DrawablePtr) LookupIDByType(draw, RT_WINDOW); -+ int unused; -+ drm_clip_rect_t *pRects; -+ -+ return pDrawable ? DRIGetDrawableInfo(pDrawable->pScreen, pDrawable, -+ (unsigned*)&unused, (unsigned*)&unused, -+ &unused, &unused, &unused, &unused, -+ &unused, &pRects, &unused, &unused, -+ &unused, &pRects) -+ : GL_FALSE; - } - - static GLboolean createContext(__DRInativeDisplay *dpy, int screen, -@@ -652,9 +786,9 @@ static GLboolean createContext(__DRInativeDisplay *dpy, int screen, - fakeID = FakeClientID(0); - *(XID *) contextID = fakeID; - -- __glXDRIenterServer(); -+ __glXDRIenterServer(GL_FALSE); - retval = DRICreateContext(pScreen, visual, fakeID, hw_context); -- __glXDRIleaveServer(); -+ __glXDRIleaveServer(GL_FALSE); - return retval; - } - -@@ -663,9 +797,9 @@ static GLboolean destroyContext(__DRInativeDisplay *dpy, int screen, - { - GLboolean retval; - -- __glXDRIenterServer(); -+ __glXDRIenterServer(GL_FALSE); - retval = DRIDestroyContext(screenInfo.screens[screen], context); -- __glXDRIleaveServer(); -+ __glXDRIleaveServer(GL_FALSE); - return retval; - } - -@@ -680,12 +814,10 @@ createDrawable(__DRInativeDisplay *dpy, int screen, - if (!pDrawable) - return GL_FALSE; - -- __glXDRIenterServer(); -- retval = DRICreateDrawable(screenInfo.screens[screen], -- drawable, -- pDrawable, -- hHWDrawable); -- __glXDRIleaveServer(); -+ __glXDRIenterServer(GL_FALSE); -+ retval = DRICreateDrawable(screenInfo.screens[screen], __pGlxClient, -+ pDrawable, hHWDrawable); -+ __glXDRIleaveServer(GL_FALSE); - return retval; - } - -@@ -699,11 +831,10 @@ destroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable) - if (!pDrawable) - return GL_FALSE; - -- __glXDRIenterServer(); -- retval = DRIDestroyDrawable(screenInfo.screens[screen], -- drawable, -- pDrawable); -- __glXDRIleaveServer(); -+ __glXDRIenterServer(GL_FALSE); -+ retval = DRIDestroyDrawable(screenInfo.screens[screen], __pGlxClient, -+ pDrawable); -+ __glXDRIleaveServer(GL_FALSE); - return retval; - } - -@@ -740,20 +871,44 @@ getDrawableInfo(__DRInativeDisplay *dpy, int screen, - return GL_FALSE; - } - -- __glXDRIenterServer(); -+ __glXDRIenterServer(GL_FALSE); - retval = DRIGetDrawableInfo(screenInfo.screens[screen], - pDrawable, index, stamp, - x, y, width, height, - numClipRects, &pClipRects, - backX, backY, - numBackClipRects, &pBackClipRects); -- __glXDRIleaveServer(); -+ __glXDRIleaveServer(GL_FALSE); - - if (*numClipRects > 0) { - size = sizeof (drm_clip_rect_t) * *numClipRects; - *ppClipRects = xalloc (size); -- if (*ppClipRects != NULL) -- memcpy (*ppClipRects, pClipRects, size); -+ -+ /* Clip cliprects to screen dimensions (redirected windows) */ -+ if (*ppClipRects != NULL) { -+ ScreenPtr pScreen = screenInfo.screens[screen]; -+ int i, j; -+ -+ for (i = 0, j = 0; i < *numClipRects; i++) { -+ (*ppClipRects)[j].x1 = max(pClipRects[i].x1, 0); -+ (*ppClipRects)[j].y1 = max(pClipRects[i].y1, 0); -+ (*ppClipRects)[j].x2 = min(pClipRects[i].x2, pScreen->width); -+ (*ppClipRects)[j].y2 = min(pClipRects[i].y2, pScreen->height); -+ -+ if ((*ppClipRects)[j].x1 < (*ppClipRects)[j].x2 && -+ (*ppClipRects)[j].y1 < (*ppClipRects)[j].y2) { -+ j++; -+ } -+ } -+ -+ if (*numClipRects != j) { -+ *numClipRects = j; -+ *ppClipRects = xrealloc (*ppClipRects, -+ sizeof (drm_clip_rect_t) * -+ *numClipRects); -+ } -+ } else -+ *numClipRects = 0; - } - else { - *ppClipRects = NULL; -@@ -769,7 +924,7 @@ getDrawableInfo(__DRInativeDisplay *dpy, int screen, - *ppBackClipRects = NULL; - } - -- return GL_TRUE; -+ return retval; - } - - static int -@@ -815,7 +970,6 @@ static Bool - glxDRIEnterVT (int index, int flags) - { - __GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index); -- Bool ret; - - LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); - -@@ -852,7 +1006,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - __DRIframebuffer framebuffer; - int fd = -1; - int status; -- int api_ver = COPY_SUB_BUFFER_INTERNAL_VERSION; -+ int api_ver = 20070121; - drm_magic_t magic; - drmVersionPtr version; - int newlyopened; -@@ -867,13 +1021,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - size_t buffer_size; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - -- if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) { -- LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n"); -- return NULL; -- } -- -- if (!DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) { -- LogMessage(X_ERROR, -+ if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") || -+ !DRIQueryDirectRenderingCapable(pScreen, &isCapable) || -+ !isCapable) { -+ LogMessage(X_INFO, - "AIGLX: Screen %d is not DRI capable\n", pScreen->myNum); - return NULL; - } -@@ -1034,6 +1185,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) - goto handle_error; - } - -+ DRIGetTexOffsetFuncs(pScreen, &screen->texOffsetStart, -+ &screen->texOffsetFinish); -+ - __glXScreenInit(&screen->base, pScreen); - - buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL); -diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c -index 1f6c7f3..b35175e 100644 ---- a/GL/glx/glxext.c -+++ b/GL/glx/glxext.c -@@ -62,6 +62,11 @@ xGLXSingleReply __glXReply; - static __GLXclientState *__glXClients[MAXCLIENTS + 1]; - - /* -+** Client that called into GLX dispatch. -+*/ -+ClientPtr __pGlxClient; -+ -+/* - ** Forward declarations. - */ - static int __glXDispatch(ClientPtr); -@@ -167,10 +172,12 @@ static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id) - - pGlxPixmap->idExists = False; - if (!pGlxPixmap->refcnt) { -+#ifdef XF86DRI - if (pGlxPixmap->pDamage) { - DamageUnregister (pGlxPixmap->pDraw, pGlxPixmap->pDamage); - DamageDestroy(pGlxPixmap->pDamage); - } -+#endif - /* - ** The DestroyPixmap routine should decrement the refcount and free - ** only if it's zero. -@@ -238,9 +245,9 @@ GLboolean __glXFreeContext(__GLXcontext *cx) - * the latter case we need to lift the DRI lock manually. */ - - if (!glxBlockClients) { -- __glXleaveServer(); -+ __glXleaveServer(GL_FALSE); - cx->destroy(cx); -- __glXenterServer(); -+ __glXenterServer(GL_FALSE); - } else { - cx->next = glxPendingDestroyContexts; - glxPendingDestroyContexts = cx; -@@ -275,7 +282,7 @@ static GLboolean errorOccured = GL_FALSE; - /* - ** The GL was will call this routine if an error occurs. - */ --void __glXErrorCallBack(__GLinterface *gc, GLenum code) -+void __glXErrorCallBack(GLenum code) - { - errorOccured = GL_TRUE; - } -@@ -439,49 +446,49 @@ void glxResumeClients(void) - AttendClient(__glXClients[i]->client); - } - -- __glXleaveServer(); -+ __glXleaveServer(GL_FALSE); - for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) { - next = cx->next; - - cx->destroy(cx); - } - glxPendingDestroyContexts = NULL; -- __glXenterServer(); -+ __glXenterServer(GL_FALSE); - } - - static void --__glXnopEnterServer(void) -+__glXnopEnterServer(GLboolean rendering) - { - } - - static void --__glXnopLeaveServer(void) -+__glXnopLeaveServer(GLboolean rendering) - { - } - --static void (*__glXenterServerFunc)(void) = __glXnopEnterServer; --static void (*__glXleaveServerFunc)(void) = __glXnopLeaveServer; -+static void (*__glXenterServerFunc)(GLboolean) = __glXnopEnterServer; -+static void (*__glXleaveServerFunc)(GLboolean) = __glXnopLeaveServer; - --void __glXsetEnterLeaveServerFuncs(void (*enter)(void), -- void (*leave)(void)) -+void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean), -+ void (*leave)(GLboolean)) - { - __glXenterServerFunc = enter; - __glXleaveServerFunc = leave; - } - - --void __glXenterServer(void) -+void __glXenterServer(GLboolean rendering) - { - glxServerLeaveCount--; - - if (glxServerLeaveCount == 0) -- (*__glXenterServerFunc)(); -+ (*__glXenterServerFunc)(rendering); - } - --void __glXleaveServer(void) -+void __glXleaveServer(GLboolean rendering) - { - if (glxServerLeaveCount == 0) -- (*__glXleaveServerFunc)(); -+ (*__glXleaveServerFunc)(rendering); - - glxServerLeaveCount++; - } -@@ -546,11 +553,14 @@ static int __glXDispatch(ClientPtr client) - opcode, - client->swapped); - if (proc != NULL) { -- __glXleaveServer(); -+ GLboolean rendering = opcode <= X_GLXRenderLarge; -+ __glXleaveServer(rendering); -+ -+ __pGlxClient = client; - - retval = (*proc)(cl, (GLbyte *) stuff); - -- __glXenterServer(); -+ __glXenterServer(rendering); - } - else { - retval = BadRequest; -diff --git a/GL/glx/glxext.h b/GL/glx/glxext.h -index edd66a8..6774e4d 100644 ---- a/GL/glx/glxext.h -+++ b/GL/glx/glxext.h -@@ -66,7 +66,7 @@ typedef struct { - extern GLboolean __glXFreeContext(__GLXcontext *glxc); - extern void __glXFlushContextCache(void); - --extern void __glXErrorCallBack(__GLinterface *gc, GLenum code); -+extern void __glXErrorCallBack(GLenum code); - extern void __glXClearErrorOccured(void); - extern GLboolean __glXErrorOccured(void); - extern void __glXResetLargeCommandStatus(__GLXclientState*); -@@ -80,7 +80,8 @@ extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, - extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId, - GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect); - extern int DoCreateGLXPixmap(__GLXclientState *cl, XID fbconfigId, -- GLuint screenNum, XID pixmapId, XID glxpixmapId); -+ GLuint screenNum, XID pixmapId, XID glxpixmapId, CARD32 *attribs, -+ CARD32 numAttribs); - extern int DoDestroyPixmap(__GLXclientState *cl, XID glxpixmapId); - - extern int DoQueryContext(__GLXclientState *cl, GLXContextID gcId); -diff --git a/GL/glx/glxglcore.c b/GL/glx/glxglcore.c -new file mode 100644 -index 0000000..df9be07 ---- /dev/null -+++ b/GL/glx/glxglcore.c -@@ -0,0 +1,411 @@ -+/************************************************************************** -+ -+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -+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, sub license, 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 NON-INFRINGEMENT. -+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. -+ -+**************************************************************************/ -+ -+/* -+ * Authors: -+ * Kevin E. Martin -+ * Brian E. Paul -+ * -+ */ -+ -+#ifdef HAVE_DIX_CONFIG_H -+#include -+#endif -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "glcontextmodes.h" -+#include "os.h" -+ -+typedef struct __GLXMESAscreen __GLXMESAscreen; -+typedef struct __GLXMESAcontext __GLXMESAcontext; -+typedef struct __GLXMESAdrawable __GLXMESAdrawable; -+ -+struct __GLXMESAscreen { -+ __GLXscreen base; -+ int index; -+ int num_vis; -+ XMesaVisual *xm_vis; -+}; -+ -+struct __GLXMESAcontext { -+ __GLXcontext base; -+ XMesaContext xmesa; -+}; -+ -+struct __GLXMESAdrawable { -+ __GLXdrawable base; -+ XMesaBuffer xm_buf; -+}; -+ -+static XMesaVisual find_mesa_visual(__GLXscreen *screen, VisualID vid); -+ -+ -+static void -+__glXMesaDrawableDestroy(__GLXdrawable *base) -+{ -+ __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -+ -+ if (glxPriv->xm_buf != NULL) -+ XMesaDestroyBuffer(glxPriv->xm_buf); -+ xfree(glxPriv); -+} -+ -+static GLboolean -+__glXMesaDrawableResize(__GLXdrawable *base) -+{ -+ __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -+ -+ XMesaResizeBuffers(glxPriv->xm_buf); -+ -+ return GL_TRUE; -+} -+ -+static GLboolean -+__glXMesaDrawableSwapBuffers(__GLXdrawable *base) -+{ -+ __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -+ -+ /* This is terrifying: XMesaSwapBuffers() ends up calling CopyArea -+ * to do the buffer swap, but this assumes that the server holds -+ * the lock and has its context visible. If another screen uses a -+ * DRI driver, that will have installed the DRI enter/leave server -+ * functions, which lifts the lock during GLX dispatch. This is -+ * why we need to re-take the lock and swap in the server context -+ * before calling XMesaSwapBuffers() here. /me shakes head. */ -+ -+ __glXenterServer(GL_FALSE); -+ -+ XMesaSwapBuffers(glxPriv->xm_buf); -+ -+ __glXleaveServer(GL_FALSE); -+ -+ return GL_TRUE; -+} -+ -+ -+static __GLXdrawable * -+__glXMesaScreenCreateDrawable(__GLXscreen *screen, -+ DrawablePtr pDraw, -+ XID drawId, -+ __GLcontextModes *modes) -+{ -+ __GLXMESAdrawable *glxPriv; -+ XMesaVisual xm_vis; -+ -+ glxPriv = xalloc(sizeof *glxPriv); -+ if (glxPriv == NULL) -+ return NULL; -+ -+ memset(glxPriv, 0, sizeof *glxPriv); -+ -+ if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) { -+ xfree(glxPriv); -+ return NULL; -+ } -+ -+ glxPriv->base.destroy = __glXMesaDrawableDestroy; -+ glxPriv->base.resize = __glXMesaDrawableResize; -+ glxPriv->base.swapBuffers = __glXMesaDrawableSwapBuffers; -+ -+ xm_vis = find_mesa_visual(screen, modes->visualID); -+ if (xm_vis == NULL) { -+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", -+ modes->visualID); -+ xfree(glxPriv); -+ return NULL; -+ } -+ -+ if (glxPriv->base.type == DRAWABLE_WINDOW) { -+ glxPriv->xm_buf = XMesaCreateWindowBuffer(xm_vis, (WindowPtr)pDraw); -+ } else { -+ glxPriv->xm_buf = XMesaCreatePixmapBuffer(xm_vis, (PixmapPtr)pDraw, 0); -+ } -+ -+ return &glxPriv->base; -+} -+ -+static void -+__glXMesaContextDestroy(__GLXcontext *baseContext) -+{ -+ __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -+ -+ XMesaDestroyContext(context->xmesa); -+ __glXContextDestroy(&context->base); -+ xfree(context); -+} -+ -+static int -+__glXMesaContextMakeCurrent(__GLXcontext *baseContext) -+ -+{ -+ __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -+ __GLXMESAdrawable *drawPriv = (__GLXMESAdrawable *) context->base.drawPriv; -+ __GLXMESAdrawable *readPriv = (__GLXMESAdrawable *) context->base.readPriv; -+ -+ return XMesaMakeCurrent2(context->xmesa, -+ drawPriv->xm_buf, -+ readPriv->xm_buf); -+} -+ -+static int -+__glXMesaContextLoseCurrent(__GLXcontext *baseContext) -+{ -+ __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -+ -+ return XMesaLoseCurrent(context->xmesa); -+} -+ -+static int -+__glXMesaContextCopy(__GLXcontext *baseDst, -+ __GLXcontext *baseSrc, -+ unsigned long mask) -+{ -+ __GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst; -+ __GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc; -+ -+ return XMesaCopyContext(src->xmesa, dst->xmesa, mask); -+} -+ -+static int -+__glXMesaContextForceCurrent(__GLXcontext *baseContext) -+{ -+ __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -+ -+ /* GlxSetRenderTables() call for XGL moved in XMesaForceCurrent() */ -+ -+ return XMesaForceCurrent(context->xmesa); -+} -+ -+static __GLXcontext * -+__glXMesaScreenCreateContext(__GLXscreen *screen, -+ __GLcontextModes *modes, -+ __GLXcontext *baseShareContext) -+{ -+ __GLXMESAcontext *context; -+ __GLXMESAcontext *shareContext = (__GLXMESAcontext *) baseShareContext; -+ XMesaVisual xm_vis; -+ XMesaContext xm_share; -+ -+ context = xalloc (sizeof (__GLXMESAcontext)); -+ if (context == NULL) -+ return NULL; -+ -+ memset(context, 0, sizeof *context); -+ -+ context->base.pGlxScreen = screen; -+ context->base.modes = modes; -+ -+ context->base.destroy = __glXMesaContextDestroy; -+ context->base.makeCurrent = __glXMesaContextMakeCurrent; -+ context->base.loseCurrent = __glXMesaContextLoseCurrent; -+ context->base.copy = __glXMesaContextCopy; -+ context->base.forceCurrent = __glXMesaContextForceCurrent; -+ -+ xm_vis = find_mesa_visual(screen, modes->visualID); -+ if (!xm_vis) { -+ ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", -+ modes->visualID); -+ xfree(context); -+ return NULL; -+ } -+ -+ xm_share = shareContext ? shareContext->xmesa : NULL; -+ context->xmesa = XMesaCreateContext(xm_vis, xm_share); -+ if (!context->xmesa) { -+ xfree(context); -+ return NULL; -+ } -+ -+ return &context->base; -+} -+ -+static void -+__glXMesaScreenDestroy(__GLXscreen *screen) -+{ -+ __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen; -+ int i; -+ -+ if (mesaScreen->xm_vis) { -+ for (i = 0; i < mesaScreen->num_vis; i++) { -+ if (mesaScreen->xm_vis[i]) -+ XMesaDestroyVisual(mesaScreen->xm_vis[i]); -+ } -+ -+ xfree(mesaScreen->xm_vis); -+ } -+ -+ __glXScreenDestroy(screen); -+ -+ xfree(screen); -+} -+ -+static XMesaVisual -+find_mesa_visual(__GLXscreen *screen, VisualID vid) -+{ -+ __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen; -+ const __GLcontextModes *modes; -+ unsigned i = 0; -+ -+ for ( modes = screen->modes ; modes != NULL ; modes = modes->next ) { -+ if ( modes->visualID == vid ) { -+ break; -+ } -+ -+ i++; -+ } -+ -+ return (modes != NULL) ? mesaScreen->xm_vis[i] : NULL; -+} -+ -+static void init_screen_visuals(__GLXMESAscreen *screen) -+{ -+ ScreenPtr pScreen = screen->base.pScreen; -+ __GLcontextModes *modes; -+ XMesaVisual *pXMesaVisual; -+ int *used; -+ int i, j, size; -+ -+ /* Alloc space for the list of XMesa visuals */ -+ size = screen->base.numVisuals * sizeof(XMesaVisual); -+ pXMesaVisual = (XMesaVisual *) xalloc(size); -+ memset(pXMesaVisual, 0, size); -+ -+ /* FIXME: Change 'used' to be a array of bits (rather than of ints), -+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less -+ * FIXME: than 64 or 128 the stack array can be used instead of calling -+ * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to -+ * FIXME: array of bytes instead of ints! -+ */ -+ used = (int *) xalloc(pScreen->numVisuals * sizeof(int)); -+ memset(used, 0, pScreen->numVisuals * sizeof(int)); -+ -+ i = 0; -+ for ( modes = screen->base.modes; modes != NULL; modes = modes->next ) { -+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); -+ const int nplanes = (modes->rgbBits - modes->alphaBits); -+ const VisualPtr pVis = pScreen->visuals; -+ -+ for (j = 0; j < pScreen->numVisuals; j++) { -+ if (pVis[j].class == vis_class && -+ pVis[j].nplanes == nplanes && -+ pVis[j].redMask == modes->redMask && -+ pVis[j].greenMask == modes->greenMask && -+ pVis[j].blueMask == modes->blueMask && -+ !used[j]) { -+ -+ /* Create the XMesa visual */ -+ pXMesaVisual[i] = -+ XMesaCreateVisual(pScreen, -+ &pVis[j], -+ modes->rgbMode, -+ (modes->alphaBits > 0), -+ modes->doubleBufferMode, -+ modes->stereoMode, -+ GL_TRUE, /* ximage_flag */ -+ modes->depthBits, -+ modes->stencilBits, -+ modes->accumRedBits, -+ modes->accumGreenBits, -+ modes->accumBlueBits, -+ modes->accumAlphaBits, -+ modes->samples, -+ modes->level, -+ modes->visualRating); -+ /* Set the VisualID */ -+ modes->visualID = pVis[j].vid; -+ -+ /* Mark this visual used */ -+ used[j] = 1; -+ break; -+ } -+ } -+ -+ if ( j == pScreen->numVisuals ) { -+ ErrorF("No matching visual for __GLcontextMode with " -+ "visual class = %d (%d), nplanes = %u\n", -+ vis_class, -+ modes->visualType, -+ (modes->rgbBits - modes->alphaBits) ); -+ } -+ else if ( modes->visualID == -1 ) { -+ FatalError( "Matching visual found, but visualID still -1!\n" ); -+ } -+ -+ i++; -+ } -+ -+ xfree(used); -+ -+ screen->num_vis = pScreen->numVisuals; -+ screen->xm_vis = pXMesaVisual; -+} -+ -+static __GLXscreen * -+__glXMesaScreenProbe(ScreenPtr pScreen) -+{ -+ __GLXMESAscreen *screen; -+ -+ screen = xalloc(sizeof *screen); -+ if (screen == NULL) -+ return NULL; -+ -+ __glXScreenInit(&screen->base, pScreen); -+ -+ screen->base.destroy = __glXMesaScreenDestroy; -+ screen->base.createContext = __glXMesaScreenCreateContext; -+ screen->base.createDrawable = __glXMesaScreenCreateDrawable; -+ screen->base.pScreen = pScreen; -+ -+ /* -+ * Find the GLX visuals that are supported by this screen and create -+ * XMesa's visuals. -+ */ -+ init_screen_visuals(screen); -+ -+ return &screen->base; -+} -+ -+__GLXprovider __glXMesaProvider = { -+ __glXMesaScreenProbe, -+ "MESA", -+ NULL -+}; -+ -+__GLXprovider * -+GlxGetMesaProvider (void) -+{ -+ return &__glXMesaProvider; -+} -diff --git a/GL/glx/glxscreens.h b/GL/glx/glxscreens.h -index a7700f6..bba4557 100644 ---- a/GL/glx/glxscreens.h -+++ b/GL/glx/glxscreens.h -@@ -40,9 +40,6 @@ - ** - */ - --/* XXX: should be defined somewhere globally */ --#define CAPI -- - #include "GL/internal/glcore.h" - - /* -diff --git a/GL/glx/glxserver.h b/GL/glx/glxserver.h -index 49cad73..b6b5592 100644 ---- a/GL/glx/glxserver.h -+++ b/GL/glx/glxserver.h -@@ -110,6 +110,8 @@ void __glXScreenInitVisuals(__GLXscreen *screen); - extern __GLXcontext *__glXLastContext; - extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*); - -+extern ClientPtr __pGlxClient; -+ - int __glXError(int error); - - /* -@@ -131,10 +133,10 @@ struct __GLXprovider { - - void GlxPushProvider(__GLXprovider *provider); - --void __glXsetEnterLeaveServerFuncs(void (*enter)(void), -- void (*leave)(void)); --void __glXenterServer(void); --void __glXleaveServer(void); -+void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean), -+ void (*leave)(GLboolean)); -+void __glXenterServer(GLboolean rendering); -+void __glXleaveServer(GLboolean rendering); - - void glxSuspendClients(void); - void glxResumeClients(void); -diff --git a/GL/glx/glxutil.h b/GL/glx/glxutil.h -index 6cdb5c8..1937ef2 100644 ---- a/GL/glx/glxutil.h -+++ b/GL/glx/glxutil.h -@@ -60,6 +60,4 @@ extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag); - extern void *__glXglDDXScreenInfo(void); - extern void *__glXglDDXExtensionInfo(void); - --extern int glxCountBits(int); -- - #endif /* _glxcmds_h_ */ -diff --git a/GL/glx/indirect_dispatch.c b/GL/glx/indirect_dispatch.c -index d86dedf..00a9f96 100644 ---- a/GL/glx/indirect_dispatch.c -+++ b/GL/glx/indirect_dispatch.c -@@ -33,6 +33,7 @@ - #include "indirect_size_get.h" - #include "indirect_dispatch.h" - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "indirect_util.h" - #include "singlesize.h" - #include "glapitable.h" -diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h -index 78e5e69..24f4bed 100644 ---- a/GL/glx/indirect_dispatch.h -+++ b/GL/glx/indirect_dispatch.h -@@ -379,8 +379,6 @@ extern HIDDEN void __glXDisp_DepthMask(GLbyte * pc); - extern HIDDEN void __glXDispSwap_DepthMask(GLbyte * pc); - extern HIDDEN void __glXDisp_Rotated(GLbyte * pc); - extern HIDDEN void __glXDispSwap_Rotated(GLbyte * pc); --extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc); --extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc); - extern HIDDEN int __glXDisp_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); - extern HIDDEN int __glXDispSwap_GetMaterialiv(struct __GLXclientStateRec *, GLbyte *); - extern HIDDEN void __glXDisp_StencilOp(GLbyte * pc); -@@ -621,6 +619,8 @@ extern HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *); - extern HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *); - extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc); - extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc); -+extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc); -+extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc); - extern HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc); - extern HIDDEN void __glXDispSwap_EvalCoord2dv(GLbyte * pc); - extern HIDDEN void __glXDisp_VertexAttrib3svARB(GLbyte * pc); -diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c -index 136f0d0..c0bb71c 100644 ---- a/GL/glx/indirect_dispatch_swap.c -+++ b/GL/glx/indirect_dispatch_swap.c -@@ -28,24 +28,12 @@ - #include - #include - #include --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --#include --#elif defined(__OpenBSD__) --#include --#define bswap_16 __swap16 --#define bswap_32 __swap32 --#define bswap_64 __swap64 --#else --#include --#define bswap_16 bswap16 --#define bswap_32 bswap32 --#define bswap_64 bswap64 --#endif - #include - #include "indirect_size.h" - #include "indirect_size_get.h" - #include "indirect_dispatch.h" - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "indirect_util.h" - #include "singlesize.h" - #include "glapitable.h" -diff --git a/GL/glx/indirect_program.c b/GL/glx/indirect_program.c -index eae128a..d23a0a9 100644 ---- a/GL/glx/indirect_program.c -+++ b/GL/glx/indirect_program.c -@@ -35,6 +35,7 @@ - #endif - - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "glxext.h" - #include "singlesize.h" - #include "unpack.h" -@@ -46,20 +47,6 @@ - #include "dispatch.h" - #include "glapioffsets.h" - --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --#include --#elif defined(__OpenBSD__) --#include --#define bswap_16 __swap16 --#define bswap_32 __swap32 --#define bswap_64 __swap64 --#else --#include --#define bswap_16 bswap16 --#define bswap_32 bswap32 --#define bswap_64 bswap64 --#endif -- - static int DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte *pc, - unsigned get_programiv_offset, unsigned get_program_string_offset, - Bool do_swap); -diff --git a/GL/glx/indirect_reqsize.c b/GL/glx/indirect_reqsize.c -index d3e2bc5..954eecd 100644 ---- a/GL/glx/indirect_reqsize.c -+++ b/GL/glx/indirect_reqsize.c -@@ -28,16 +28,10 @@ - - #include - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "indirect_size.h" - #include "indirect_reqsize.h" - --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --# include --# define SWAP_32(v) do { (v) = bswap_32(v); } while(0) --#else --# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0) --#endif -- - #define __GLX_PAD(x) (((x) + 3) & ~3) - - #if defined(__CYGWIN__) || defined(__MINGW32__) -@@ -56,15 +50,15 @@ - - - int --__glXCallListsReqSize( const GLbyte * pc, Bool swap ) -+__glXCallListsReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 0); -- GLenum type = * (GLenum *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 0); -+ GLenum type = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( n ); -- SWAP_32( type ); -+ n = bswap_32(n); -+ type = bswap_32(type); - } - - compsize = __glCallLists_size(type); -@@ -72,22 +66,22 @@ __glXCallListsReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXBitmapReqSize( const GLbyte * pc, Bool swap ) -+__glXBitmapReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLsizei width = *(GLsizei *)(pc + 20); -- GLsizei height = *(GLsizei *)(pc + 24); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLsizei width = *(GLsizei *) (pc + 20); -+ GLsizei height = *(GLsizei *) (pc + 24); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( width ); -- SWAP_32( height ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ width = bswap_32(width); -+ height = bswap_32(height); - } - - return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1, -@@ -96,13 +90,13 @@ __glXBitmapReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXFogfvReqSize( const GLbyte * pc, Bool swap ) -+__glXFogfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 0); -+ GLenum pname = *(GLenum *) (pc + 0); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glFogfv_size(pname); -@@ -110,13 +104,13 @@ __glXFogfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXLightfvReqSize( const GLbyte * pc, Bool swap ) -+__glXLightfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glLightfv_size(pname); -@@ -124,13 +118,13 @@ __glXLightfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXLightModelfvReqSize( const GLbyte * pc, Bool swap ) -+__glXLightModelfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 0); -+ GLenum pname = *(GLenum *) (pc + 0); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glLightModelfv_size(pname); -@@ -138,13 +132,13 @@ __glXLightModelfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXMaterialfvReqSize( const GLbyte * pc, Bool swap ) -+__glXMaterialfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glMaterialfv_size(pname); -@@ -152,18 +146,18 @@ __glXMaterialfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXPolygonStippleReqSize( const GLbyte * pc, Bool swap ) -+__glXPolygonStippleReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); - } - - return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1, -@@ -172,13 +166,13 @@ __glXPolygonStippleReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexParameterfvReqSize( const GLbyte * pc, Bool swap ) -+__glXTexParameterfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glTexParameterfv_size(pname); -@@ -186,26 +180,26 @@ __glXTexParameterfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexImage1DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexImage1DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 32); -- GLenum format = * (GLenum *)(pc + 44); -- GLenum type = * (GLenum *)(pc + 48); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 32); -+ GLenum format = *(GLenum *) (pc + 44); -+ GLenum type = *(GLenum *) (pc + 48); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, 1, 1, -@@ -214,28 +208,28 @@ __glXTexImage1DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexImage2DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexImage2DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 32); -- GLsizei height = *(GLsizei *)(pc + 36); -- GLenum format = * (GLenum *)(pc + 44); -- GLenum type = * (GLenum *)(pc + 48); -- -- if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( format ); -- SWAP_32( type ); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 32); -+ GLsizei height = *(GLsizei *) (pc + 36); -+ GLenum format = *(GLenum *) (pc + 44); -+ GLenum type = *(GLenum *) (pc + 48); -+ -+ if (swap) { -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, height, 1, -@@ -244,13 +238,13 @@ __glXTexImage2DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexEnvfvReqSize( const GLbyte * pc, Bool swap ) -+__glXTexEnvfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glTexEnvfv_size(pname); -@@ -258,13 +252,13 @@ __glXTexEnvfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexGendvReqSize( const GLbyte * pc, Bool swap ) -+__glXTexGendvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glTexGendv_size(pname); -@@ -272,13 +266,13 @@ __glXTexGendvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexGenfvReqSize( const GLbyte * pc, Bool swap ) -+__glXTexGenfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glTexGenfv_size(pname); -@@ -286,50 +280,50 @@ __glXTexGenfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXPixelMapfvReqSize( const GLbyte * pc, Bool swap ) -+__glXPixelMapfvReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei mapsize = *(GLsizei *)(pc + 4); -+ GLsizei mapsize = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( mapsize ); -+ mapsize = bswap_32(mapsize); - } - - return __GLX_PAD((mapsize * 4)); - } - - int --__glXPixelMapusvReqSize( const GLbyte * pc, Bool swap ) -+__glXPixelMapusvReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei mapsize = *(GLsizei *)(pc + 4); -+ GLsizei mapsize = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( mapsize ); -+ mapsize = bswap_32(mapsize); - } - - return __GLX_PAD((mapsize * 2)); - } - - int --__glXDrawPixelsReqSize( const GLbyte * pc, Bool swap ) -+__glXDrawPixelsReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLsizei width = *(GLsizei *)(pc + 20); -- GLsizei height = *(GLsizei *)(pc + 24); -- GLenum format = * (GLenum *)(pc + 28); -- GLenum type = * (GLenum *)(pc + 32); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLsizei width = *(GLsizei *) (pc + 20); -+ GLsizei height = *(GLsizei *) (pc + 24); -+ GLenum format = *(GLenum *) (pc + 28); -+ GLenum type = *(GLenum *) (pc + 32); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, 0, width, height, 1, -@@ -338,38 +332,38 @@ __glXDrawPixelsReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXPrioritizeTexturesReqSize( const GLbyte * pc, Bool swap ) -+__glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 0); -+ GLsizei n = *(GLsizei *) (pc + 0); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 4) + (n * 4)); - } - - int --__glXTexSubImage1DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 36); -- GLenum format = * (GLenum *)(pc + 44); -- GLenum type = * (GLenum *)(pc + 48); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 36); -+ GLenum format = *(GLenum *) (pc + 44); -+ GLenum type = *(GLenum *) (pc + 48); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, 1, 1, -@@ -378,28 +372,28 @@ __glXTexSubImage1DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexSubImage2DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 36); -- GLsizei height = *(GLsizei *)(pc + 40); -- GLenum format = * (GLenum *)(pc + 44); -- GLenum type = * (GLenum *)(pc + 48); -- -- if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( format ); -- SWAP_32( type ); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 36); -+ GLsizei height = *(GLsizei *) (pc + 40); -+ GLenum format = *(GLenum *) (pc + 44); -+ GLenum type = *(GLenum *) (pc + 48); -+ -+ if (swap) { -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, height, 1, -@@ -408,26 +402,26 @@ __glXTexSubImage2DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXColorTableReqSize( const GLbyte * pc, Bool swap ) -+__glXColorTableReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 28); -- GLenum format = * (GLenum *)(pc + 32); -- GLenum type = * (GLenum *)(pc + 36); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 28); -+ GLenum format = *(GLenum *) (pc + 32); -+ GLenum type = *(GLenum *) (pc + 36); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, 1, 1, -@@ -436,13 +430,13 @@ __glXColorTableReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXColorTableParameterfvReqSize( const GLbyte * pc, Bool swap ) -+__glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glColorTableParameterfv_size(pname); -@@ -450,26 +444,26 @@ __glXColorTableParameterfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXColorSubTableReqSize( const GLbyte * pc, Bool swap ) -+__glXColorSubTableReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei count = *(GLsizei *)(pc + 28); -- GLenum format = * (GLenum *)(pc + 32); -- GLenum type = * (GLenum *)(pc + 36); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei count = *(GLsizei *) (pc + 28); -+ GLenum format = *(GLenum *) (pc + 32); -+ GLenum type = *(GLenum *) (pc + 36); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( count ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ count = bswap_32(count); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, count, 1, 1, -@@ -478,26 +472,26 @@ __glXColorSubTableReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXConvolutionFilter1DReqSize( const GLbyte * pc, Bool swap ) -+__glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 28); -- GLenum format = * (GLenum *)(pc + 36); -- GLenum type = * (GLenum *)(pc + 40); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 28); -+ GLenum format = *(GLenum *) (pc + 36); -+ GLenum type = *(GLenum *) (pc + 40); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, 1, 1, -@@ -506,28 +500,28 @@ __glXConvolutionFilter1DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXConvolutionFilter2DReqSize( const GLbyte * pc, Bool swap ) -+__glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -+ GLint row_length = *(GLint *) (pc + 4); - GLint image_height = 0; -- GLint skip_images = 0; -- GLint skip_rows = * (GLint *)(pc + 8); -- GLint alignment = * (GLint *)(pc + 16); -- GLenum target = * (GLenum *)(pc + 20); -- GLsizei width = *(GLsizei *)(pc + 28); -- GLsizei height = *(GLsizei *)(pc + 32); -- GLenum format = * (GLenum *)(pc + 36); -- GLenum type = * (GLenum *)(pc + 40); -- -- if (swap) { -- SWAP_32( row_length ); -- SWAP_32( skip_rows ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( format ); -- SWAP_32( type ); -+ GLint skip_images = 0; -+ GLint skip_rows = *(GLint *) (pc + 8); -+ GLint alignment = *(GLint *) (pc + 16); -+ GLenum target = *(GLenum *) (pc + 20); -+ GLsizei width = *(GLsizei *) (pc + 28); -+ GLsizei height = *(GLsizei *) (pc + 32); -+ GLenum format = *(GLenum *) (pc + 36); -+ GLenum type = *(GLenum *) (pc + 40); -+ -+ if (swap) { -+ row_length = bswap_32(row_length); -+ skip_rows = bswap_32(skip_rows); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, height, 1, -@@ -536,13 +530,13 @@ __glXConvolutionFilter2DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXConvolutionParameterfvReqSize( const GLbyte * pc, Bool swap ) -+__glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 4); -+ GLenum pname = *(GLenum *) (pc + 4); - GLsizei compsize; - - if (swap) { -- SWAP_32( pname ); -+ pname = bswap_32(pname); - } - - compsize = __glConvolutionParameterfv_size(pname); -@@ -550,32 +544,32 @@ __glXConvolutionParameterfvReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexImage3DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexImage3DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -- GLint image_height = * (GLint *)(pc + 8); -- GLint skip_rows = * (GLint *)(pc + 16); -- GLint skip_images = * (GLint *)(pc + 20); -- GLint alignment = * (GLint *)(pc + 32); -- GLenum target = * (GLenum *)(pc + 36); -- GLsizei width = *(GLsizei *)(pc + 48); -- GLsizei height = *(GLsizei *)(pc + 52); -- GLsizei depth = *(GLsizei *)(pc + 56); -- GLenum format = * (GLenum *)(pc + 68); -- GLenum type = * (GLenum *)(pc + 72); -+ GLint row_length = *(GLint *) (pc + 4); -+ GLint image_height = *(GLint *) (pc + 8); -+ GLint skip_rows = *(GLint *) (pc + 16); -+ GLint skip_images = *(GLint *) (pc + 20); -+ GLint alignment = *(GLint *) (pc + 32); -+ GLenum target = *(GLenum *) (pc + 36); -+ GLsizei width = *(GLsizei *) (pc + 48); -+ GLsizei height = *(GLsizei *) (pc + 52); -+ GLsizei depth = *(GLsizei *) (pc + 56); -+ GLenum format = *(GLenum *) (pc + 68); -+ GLenum type = *(GLenum *) (pc + 72); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( image_height ); -- SWAP_32( skip_rows ); -- SWAP_32( skip_images ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( depth ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ image_height = bswap_32(image_height); -+ skip_rows = bswap_32(skip_rows); -+ skip_images = bswap_32(skip_images); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ depth = bswap_32(depth); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, height, depth, -@@ -584,32 +578,32 @@ __glXTexImage3DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXTexSubImage3DReqSize( const GLbyte * pc, Bool swap ) -+__glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap) - { -- GLint row_length = * (GLint *)(pc + 4); -- GLint image_height = * (GLint *)(pc + 8); -- GLint skip_rows = * (GLint *)(pc + 16); -- GLint skip_images = * (GLint *)(pc + 20); -- GLint alignment = * (GLint *)(pc + 32); -- GLenum target = * (GLenum *)(pc + 36); -- GLsizei width = *(GLsizei *)(pc + 60); -- GLsizei height = *(GLsizei *)(pc + 64); -- GLsizei depth = *(GLsizei *)(pc + 68); -- GLenum format = * (GLenum *)(pc + 76); -- GLenum type = * (GLenum *)(pc + 80); -+ GLint row_length = *(GLint *) (pc + 4); -+ GLint image_height = *(GLint *) (pc + 8); -+ GLint skip_rows = *(GLint *) (pc + 16); -+ GLint skip_images = *(GLint *) (pc + 20); -+ GLint alignment = *(GLint *) (pc + 32); -+ GLenum target = *(GLenum *) (pc + 36); -+ GLsizei width = *(GLsizei *) (pc + 60); -+ GLsizei height = *(GLsizei *) (pc + 64); -+ GLsizei depth = *(GLsizei *) (pc + 68); -+ GLenum format = *(GLenum *) (pc + 76); -+ GLenum type = *(GLenum *) (pc + 80); - - if (swap) { -- SWAP_32( row_length ); -- SWAP_32( image_height ); -- SWAP_32( skip_rows ); -- SWAP_32( skip_images ); -- SWAP_32( alignment ); -- SWAP_32( target ); -- SWAP_32( width ); -- SWAP_32( height ); -- SWAP_32( depth ); -- SWAP_32( format ); -- SWAP_32( type ); -+ row_length = bswap_32(row_length); -+ image_height = bswap_32(image_height); -+ skip_rows = bswap_32(skip_rows); -+ skip_images = bswap_32(skip_images); -+ alignment = bswap_32(alignment); -+ target = bswap_32(target); -+ width = bswap_32(width); -+ height = bswap_32(height); -+ depth = bswap_32(depth); -+ format = bswap_32(format); -+ type = bswap_32(type); - } - - return __glXImageSize(format, type, target, width, height, depth, -@@ -618,221 +612,221 @@ __glXTexSubImage3DReqSize( const GLbyte * pc, Bool swap ) - } - - int --__glXDrawBuffersARBReqSize( const GLbyte * pc, Bool swap ) -+__glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 0); -+ GLsizei imageSize = *(GLsizei *) (pc + 20); - - if (swap) { -- SWAP_32( n ); -+ imageSize = bswap_32(imageSize); - } - -- return __GLX_PAD((n * 4)); -+ return __GLX_PAD(imageSize); - } - - int --__glXPointParameterfvEXTReqSize( const GLbyte * pc, Bool swap ) -+__glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap) - { -- GLenum pname = * (GLenum *)(pc + 0); -- GLsizei compsize; -+ GLsizei imageSize = *(GLsizei *) (pc + 24); - - if (swap) { -- SWAP_32( pname ); -+ imageSize = bswap_32(imageSize); - } - -- compsize = __glPointParameterfvEXT_size(pname); -- return __GLX_PAD((compsize * 4)); -+ return __GLX_PAD(imageSize); - } - - int --__glXCompressedTexImage3DARBReqSize( const GLbyte * pc, Bool swap ) -+__glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei imageSize = *(GLsizei *)(pc + 28); -+ GLsizei imageSize = *(GLsizei *) (pc + 28); - - if (swap) { -- SWAP_32( imageSize ); -+ imageSize = bswap_32(imageSize); - } - - return __GLX_PAD(imageSize); - } - - int --__glXCompressedTexImage2DARBReqSize( const GLbyte * pc, Bool swap ) -+__glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei imageSize = *(GLsizei *)(pc + 24); -+ GLsizei imageSize = *(GLsizei *) (pc + 36); - - if (swap) { -- SWAP_32( imageSize ); -+ imageSize = bswap_32(imageSize); - } - - return __GLX_PAD(imageSize); - } - - int --__glXCompressedTexImage1DARBReqSize( const GLbyte * pc, Bool swap ) -+__glXProgramStringARBReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei imageSize = *(GLsizei *)(pc + 20); -+ GLsizei len = *(GLsizei *) (pc + 8); - - if (swap) { -- SWAP_32( imageSize ); -+ len = bswap_32(len); - } - -- return __GLX_PAD(imageSize); -+ return __GLX_PAD(len); - } - - int --__glXCompressedTexSubImage3DARBReqSize( const GLbyte * pc, Bool swap ) -+__glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei imageSize = *(GLsizei *)(pc + 36); -+ GLsizei n = *(GLsizei *) (pc + 0); - - if (swap) { -- SWAP_32( imageSize ); -+ n = bswap_32(n); - } - -- return __GLX_PAD(imageSize); -+ return __GLX_PAD((n * 4)); - } - - int --__glXLoadProgramNVReqSize( const GLbyte * pc, Bool swap ) -+__glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei len = *(GLsizei *)(pc + 8); -+ GLenum pname = *(GLenum *) (pc + 0); -+ GLsizei compsize; - - if (swap) { -- SWAP_32( len ); -+ pname = bswap_32(pname); - } - -- return __GLX_PAD(len); -+ compsize = __glPointParameterfvEXT_size(pname); -+ return __GLX_PAD((compsize * 4)); - } - - int --__glXProgramParameters4dvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLuint num = * (GLuint *)(pc + 8); -+ GLuint num = *(GLuint *) (pc + 8); - - if (swap) { -- SWAP_32( num ); -+ num = bswap_32(num); - } - - return __GLX_PAD((num * 32)); - } - - int --__glXProgramParameters4fvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLuint num = * (GLuint *)(pc + 8); -+ GLuint num = *(GLuint *) (pc + 8); - - if (swap) { -- SWAP_32( num ); -+ num = bswap_32(num); - } - - return __GLX_PAD((num * 16)); - } - - int --__glXVertexAttribs1dvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 8)); - } - - int --__glXVertexAttribs2dvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 16)); - } - - int --__glXVertexAttribs3dvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 24)); - } - - int --__glXVertexAttribs3fvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 12)); - } - - int --__glXVertexAttribs3svNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 6)); - } - - int --__glXVertexAttribs4dvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei n = *(GLsizei *)(pc + 4); -+ GLsizei n = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( n ); -+ n = bswap_32(n); - } - - return __GLX_PAD((n * 32)); - } - - int --__glXProgramNamedParameter4fvNVReqSize( const GLbyte * pc, Bool swap ) -+__glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap) - { -- GLsizei len = *(GLsizei *)(pc + 4); -+ GLsizei len = *(GLsizei *) (pc + 4); - - if (swap) { -- SWAP_32( len ); -+ len = bswap_32(len); - } - - return __GLX_PAD(len); - } - --ALIAS( Fogiv, Fogfv ) --ALIAS( Lightiv, Lightfv ) --ALIAS( LightModeliv, LightModelfv ) --ALIAS( Materialiv, Materialfv ) --ALIAS( TexParameteriv, TexParameterfv ) --ALIAS( TexEnviv, TexEnvfv ) --ALIAS( TexGeniv, TexGenfv ) --ALIAS( PixelMapuiv, PixelMapfv ) --ALIAS( ColorTableParameteriv, ColorTableParameterfv ) --ALIAS( ConvolutionParameteriv, ConvolutionParameterfv ) --ALIAS( CompressedTexSubImage2DARB, CompressedTexImage3DARB ) --ALIAS( CompressedTexSubImage1DARB, CompressedTexImage1DARB ) --ALIAS( RequestResidentProgramsNV, DrawBuffersARB ) --ALIAS( VertexAttribs1fvNV, PixelMapfv ) --ALIAS( VertexAttribs1svNV, PixelMapusv ) --ALIAS( VertexAttribs2fvNV, VertexAttribs1dvNV ) --ALIAS( VertexAttribs2svNV, PixelMapfv ) --ALIAS( VertexAttribs4fvNV, VertexAttribs2dvNV ) --ALIAS( VertexAttribs4svNV, VertexAttribs1dvNV ) --ALIAS( VertexAttribs4ubvNV, PixelMapfv ) --ALIAS( PointParameterivNV, PointParameterfvEXT ) --ALIAS( ProgramStringARB, LoadProgramNV ) --ALIAS( ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB ) --ALIAS( DeleteRenderbuffersEXT, DrawBuffersARB ) --ALIAS( DeleteFramebuffersEXT, DrawBuffersARB ) -+ALIAS(Fogiv, Fogfv) -+ ALIAS(Lightiv, Lightfv) -+ ALIAS(LightModeliv, LightModelfv) -+ ALIAS(Materialiv, Materialfv) -+ ALIAS(TexParameteriv, TexParameterfv) -+ ALIAS(TexEnviv, TexEnvfv) -+ ALIAS(TexGeniv, TexGenfv) -+ ALIAS(PixelMapuiv, PixelMapfv) -+ ALIAS(ColorTableParameteriv, ColorTableParameterfv) -+ ALIAS(ConvolutionParameteriv, ConvolutionParameterfv) -+ ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB) -+ ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB) -+ ALIAS(LoadProgramNV, ProgramStringARB) -+ ALIAS(RequestResidentProgramsNV, DrawBuffersARB) -+ ALIAS(VertexAttribs1fvNV, PixelMapfv) -+ ALIAS(VertexAttribs1svNV, PixelMapusv) -+ ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV) -+ ALIAS(VertexAttribs2svNV, PixelMapfv) -+ ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV) -+ ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV) -+ ALIAS(VertexAttribs4ubvNV, PixelMapfv) -+ ALIAS(PointParameterivNV, PointParameterfvEXT) -+ ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB) -+ ALIAS(DeleteFramebuffersEXT, DrawBuffersARB) -+ ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB) -diff --git a/GL/glx/indirect_reqsize.h b/GL/glx/indirect_reqsize.h -index 23bc41c..26211ee 100644 ---- a/GL/glx/indirect_reqsize.h -+++ b/GL/glx/indirect_reqsize.h -@@ -83,14 +83,15 @@ extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool - extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap); -@@ -109,11 +110,10 @@ extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swa - extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap); --extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap); - extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap); -+extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap); - - # undef HIDDEN - # undef PURE -diff --git a/GL/glx/indirect_size_get.c b/GL/glx/indirect_size_get.c -index 150c6a1..f29ae47 100644 ---- a/GL/glx/indirect_size_get.c -+++ b/GL/glx/indirect_size_get.c -@@ -370,6 +370,7 @@ __glGetBooleanv_size(GLenum e) - case GL_PROJECTION_STACK_DEPTH: - case GL_TEXTURE_STACK_DEPTH: - case GL_ATTRIB_STACK_DEPTH: -+ case GL_CLIENT_ATTRIB_STACK_DEPTH: - case GL_ALPHA_TEST: - case GL_ALPHA_TEST_FUNC: - case GL_ALPHA_TEST_REF: -@@ -448,6 +449,7 @@ __glGetBooleanv_size(GLenum e) - case GL_MAX_NAME_STACK_DEPTH: - case GL_MAX_PROJECTION_STACK_DEPTH: - case GL_MAX_TEXTURE_STACK_DEPTH: -+ case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - case GL_SUBPIXEL_BITS: - case GL_INDEX_BITS: - case GL_RED_BITS: -@@ -639,7 +641,7 @@ __glGetBooleanv_size(GLenum e) - case GL_PROGRAM_ERROR_POSITION_ARB: - case GL_DEPTH_CLAMP_NV: - case GL_NUM_COMPRESSED_TEXTURE_FORMATS: --/* case GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB:*/ -+/* case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:*/ - case GL_MAX_VERTEX_UNITS_ARB: - case GL_ACTIVE_VERTEX_UNITS_ARB: - case GL_WEIGHT_SUM_UNITY_ARB: -@@ -699,6 +701,8 @@ __glGetBooleanv_size(GLenum e) - /* case GL_POINT_SPRITE_NV:*/ - case GL_POINT_SPRITE_R_MODE_NV: - case GL_MAX_VERTEX_ATTRIBS_ARB: -+ case GL_MAX_TEXTURE_COORDS_ARB: -+ case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - case GL_DEPTH_BOUNDS_TEST_EXT: - case GL_STENCIL_TEST_TWO_SIDE_EXT: - case GL_ACTIVE_STENCIL_FACE_EXT: -@@ -1005,8 +1009,6 @@ __glGetProgramivARB_size(GLenum e) - case GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: -- case GL_MAX_TEXTURE_COORDS_ARB: -- case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: - case GL_PROGRAM_FORMAT_ARB: - case GL_PROGRAM_INSTRUCTIONS_ARB: - case GL_MAX_PROGRAM_INSTRUCTIONS_ARB: -diff --git a/GL/glx/indirect_texture_compression.c b/GL/glx/indirect_texture_compression.c -index 11f63c2..3c09663 100644 ---- a/GL/glx/indirect_texture_compression.c -+++ b/GL/glx/indirect_texture_compression.c -@@ -29,6 +29,7 @@ - #endif - - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "glxext.h" - #include "singlesize.h" - #include "unpack.h" -@@ -39,20 +40,6 @@ - #include "glthread.h" - #include "dispatch.h" - --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --#include --#elif defined(__OpenBSD__) --#include --#define bswap_16 __swap16 --#define bswap_32 __swap32 --#define bswap_64 __swap64 --#else --#include --#define bswap_16 bswap16 --#define bswap_32 bswap32 --#define bswap_64 bswap64 --#endif -- - int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc) - { - xGLXSingleReq * const req = (xGLXSingleReq *) pc; -diff --git a/GL/glx/indirect_util.c b/GL/glx/indirect_util.c -index 09b7ab8..58c194c 100644 ---- a/GL/glx/indirect_util.c -+++ b/GL/glx/indirect_util.c -@@ -23,29 +23,21 @@ - * SOFTWARE. - */ - -+#ifdef HAVE_DIX_CONFIG_H -+#include -+#endif -+ - #include - - #include - #include - #include --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --#include --#elif defined(__OpenBSD__) --#include --#define bswap_16 __swap16 --#define bswap_32 __swap32 --#define bswap_64 __swap64 --#else --#include --#define bswap_16 bswap16 --#define bswap_32 bswap32 --#define bswap_64 bswap64 --#endif - #include - #include "indirect_size.h" - #include "indirect_size_get.h" - #include "indirect_dispatch.h" - #include "glxserver.h" -+#include "glxbyteorder.h" - #include "singlesize.h" - #include "glapitable.h" - #include "glapi.h" -diff --git a/GL/glx/renderpix.c b/GL/glx/renderpix.c -index cd2a78d..2fe6301 100644 ---- a/GL/glx/renderpix.c -+++ b/GL/glx/renderpix.c -@@ -1,4 +1,3 @@ --/* $XFree86$ */ - /* - ** License Applicability. Except to the extent portions of this file are - ** made subject to an alternative license as permitted in the SGI Free -diff --git a/GL/glx/renderpixswap.c b/GL/glx/renderpixswap.c -index 0a9f60f..8455807 100644 ---- a/GL/glx/renderpixswap.c -+++ b/GL/glx/renderpixswap.c -@@ -1,4 +1,3 @@ --/* $XFree86$ */ - /* - ** License Applicability. Except to the extent portions of this file are - ** made subject to an alternative license as permitted in the SGI Free -diff --git a/GL/glx/singlepix.c b/GL/glx/singlepix.c -index 98898aa..d6b96de 100644 ---- a/GL/glx/singlepix.c -+++ b/GL/glx/singlepix.c -@@ -1,4 +1,3 @@ --/* $XFree86$ */ - /* - ** License Applicability. Except to the extent portions of this file are - ** made subject to an alternative license as permitted in the SGI Free -diff --git a/GL/glx/singlesize.h b/GL/glx/singlesize.h -index 5d25b24..1cce1bc 100644 ---- a/GL/glx/singlesize.h -+++ b/GL/glx/singlesize.h -@@ -1,4 +1,3 @@ --/* $XFree86$ */ - #ifdef HAVE_DIX_CONFIG_H - #include - #endif -diff --git a/GL/glx/swap_interval.c b/GL/glx/swap_interval.c -index f049ce5..24abd69 100644 ---- a/GL/glx/swap_interval.c -+++ b/GL/glx/swap_interval.c -@@ -39,20 +39,7 @@ - #include "glthread.h" - #include "dispatch.h" - #include "glapioffsets.h" -- --#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) --#include --#elif defined(__OpenBSD__) --#include --#define bswap_16 __swap16 --#define bswap_32 __swap32 --#define bswap_64 __swap64 --#else --#include --#define bswap_16 bswap16 --#define bswap_32 bswap32 --#define bswap_64 bswap64 --#endif -+#include "glxbyteorder.h" - - static int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap); - -diff --git a/GL/glx/xfont.c b/GL/glx/xfont.c -index b24c77d..9629cf1 100644 ---- a/GL/glx/xfont.c -+++ b/GL/glx/xfont.c -@@ -1,4 +1,3 @@ --/* $XFree86$ */ - /* - ** License Applicability. Except to the extent portions of this file are - ** made subject to an alternative license as permitted in the SGI Free -diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am -index 18eebfc..99d3834 100644 ---- a/GL/mesa/Makefile.am -+++ b/GL/mesa/Makefile.am -@@ -1,15 +1,15 @@ --SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi -+SUBDIRS = main math swrast swrast_setup tnl shader X glapi vbo - - noinst_LTLIBRARIES = libGLcore.la - - libGLcore_la_SOURCES = dummy.c - libGLcore_la_LIBADD = main/libmain.la \ - math/libmath.la \ -- array_cache/libac.la \ - swrast/libswrast.la \ - swrast_setup/libss.la \ - tnl/libtnl.la \ - shader/libshader.la \ - shader/grammar/libgrammar.la \ - shader/slang/libslang.la \ -+ vbo/libvbo.la \ - X/libX.la -diff --git a/GL/mesa/X/Makefile.am b/GL/mesa/X/Makefile.am -index 2a9f422..ace1181 100644 ---- a/GL/mesa/X/Makefile.am -+++ b/GL/mesa/X/Makefile.am -@@ -2,7 +2,6 @@ noinst_LTLIBRARIES = libX.la - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -@@ -21,18 +20,13 @@ INCLUDES = -I@MESA_SOURCE@/include \ - AM_CFLAGS = \ - $(DIX_CFLAGS) \ - -DXFree86Server \ -- @GLX_DEFINES@ \ -- -DXFree86Server -- --libX_la_SOURCES = xf86glx.c \ -- xf86glx_util.c \ -- xf86glx_util.h \ -- xf86glxint.h -+ @GLX_DEFINES@ - - nodist_libX_la_SOURCES = \ - xm_api.c \ - xm_buffer.c \ - xm_dd.c \ -+ xm_image.c \ - xm_line.c \ - xm_span.c \ - xm_tri.c \ -diff --git a/GL/mesa/X/xf86glx.c b/GL/mesa/X/xf86glx.c -deleted file mode 100644 -index 47c87f6..0000000 ---- a/GL/mesa/X/xf86glx.c -+++ /dev/null -@@ -1,432 +0,0 @@ --/************************************************************************** -- --Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. --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, sub license, 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 NON-INFRINGEMENT. --IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. -- --**************************************************************************/ -- --/* -- * Authors: -- * Kevin E. Martin -- * Brian E. Paul -- * -- */ -- --#ifdef HAVE_DIX_CONFIG_H --#include --#endif -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include "context.h" --#include "xmesaP.h" --#include "context.h" -- --#include "glcontextmodes.h" --#include "os.h" -- --/* -- * This define is for the glcore.h header file. -- * If you add it here, then make sure you also add it in -- * ../../../glx/Imakefile. -- */ --#if 0 --#define DEBUG --#include --#undef DEBUG --#else --#include --#endif -- --typedef struct __GLXMESAscreen __GLXMESAscreen; --typedef struct __GLXMESAcontext __GLXMESAcontext; --typedef struct __GLXMESAdrawable __GLXMESAdrawable; -- --struct __GLXMESAscreen { -- __GLXscreen base; -- int index; -- int num_vis; -- XMesaVisual *xm_vis; --}; -- --struct __GLXMESAcontext { -- __GLXcontext base; -- XMesaContext xmesa; --}; -- --struct __GLXMESAdrawable { -- __GLXdrawable base; -- XMesaBuffer xm_buf; --}; -- --static XMesaVisual find_mesa_visual(__GLXscreen *screen, VisualID vid); -- -- --static void --__glXMesaDrawableDestroy(__GLXdrawable *base) --{ -- __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -- -- if (glxPriv->xm_buf != NULL) -- XMesaDestroyBuffer(glxPriv->xm_buf); -- xfree(glxPriv); --} -- --static GLboolean --__glXMesaDrawableResize(__GLXdrawable *base) --{ -- __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -- -- XMesaResizeBuffers(glxPriv->xm_buf); -- -- return GL_TRUE; --} -- --static GLboolean --__glXMesaDrawableSwapBuffers(__GLXdrawable *base) --{ -- __GLXMESAdrawable *glxPriv = (__GLXMESAdrawable *) base; -- -- /* This is terrifying: XMesaSwapBuffers() ends up calling CopyArea -- * to do the buffer swap, but this assumes that the server holds -- * the lock and has its context visible. If another screen uses a -- * DRI driver, that will have installed the DRI enter/leave server -- * functions, which lifts the lock during GLX dispatch. This is -- * why we need to re-take the lock and swap in the server context -- * before calling XMesaSwapBuffers() here. /me shakes head. */ -- -- __glXenterServer(); -- -- XMesaSwapBuffers(glxPriv->xm_buf); -- -- __glXleaveServer(); -- -- return GL_TRUE; --} -- -- --static __GLXdrawable * --__glXMesaScreenCreateDrawable(__GLXscreen *screen, -- DrawablePtr pDraw, -- XID drawId, -- __GLcontextModes *modes) --{ -- __GLXMESAdrawable *glxPriv; -- XMesaVisual xm_vis; -- -- glxPriv = xalloc(sizeof *glxPriv); -- if (glxPriv == NULL) -- return NULL; -- -- memset(glxPriv, 0, sizeof *glxPriv); -- -- if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) { -- xfree(glxPriv); -- return NULL; -- } -- -- glxPriv->base.destroy = __glXMesaDrawableDestroy; -- glxPriv->base.resize = __glXMesaDrawableResize; -- glxPriv->base.swapBuffers = __glXMesaDrawableSwapBuffers; -- -- xm_vis = find_mesa_visual(screen, modes->visualID); -- if (xm_vis == NULL) { -- ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", -- modes->visualID); -- xfree(glxPriv); -- return NULL; -- } -- -- if (glxPriv->base.type == DRAWABLE_WINDOW) { -- glxPriv->xm_buf = XMesaCreateWindowBuffer(xm_vis, (WindowPtr)pDraw); -- } else { -- glxPriv->xm_buf = XMesaCreatePixmapBuffer(xm_vis, (PixmapPtr)pDraw, 0); -- } -- -- return &glxPriv->base; --} -- --static void --__glXMesaContextDestroy(__GLXcontext *baseContext) --{ -- __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -- -- XMesaDestroyContext(context->xmesa); -- __glXContextDestroy(&context->base); -- xfree(context); --} -- --static int --__glXMesaContextMakeCurrent(__GLXcontext *baseContext) -- --{ -- __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -- __GLXMESAdrawable *drawPriv = (__GLXMESAdrawable *) context->base.drawPriv; -- __GLXMESAdrawable *readPriv = (__GLXMESAdrawable *) context->base.readPriv; -- -- return XMesaMakeCurrent2(context->xmesa, -- drawPriv->xm_buf, -- readPriv->xm_buf); --} -- --static int --__glXMesaContextLoseCurrent(__GLXcontext *baseContext) --{ -- __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -- -- return XMesaLoseCurrent(context->xmesa); --} -- --static int --__glXMesaContextCopy(__GLXcontext *baseDst, -- __GLXcontext *baseSrc, -- unsigned long mask) --{ -- __GLXMESAcontext *dst = (__GLXMESAcontext *) baseDst; -- __GLXMESAcontext *src = (__GLXMESAcontext *) baseSrc; -- -- _mesa_copy_context(&src->xmesa->mesa, &dst->xmesa->mesa, mask); -- return GL_TRUE; --} -- --static int --__glXMesaContextForceCurrent(__GLXcontext *baseContext) --{ -- __GLXMESAcontext *context = (__GLXMESAcontext *) baseContext; -- -- GlxSetRenderTables (context->xmesa->mesa.CurrentDispatch); -- -- return XMesaForceCurrent(context->xmesa); --} -- --static __GLXcontext * --__glXMesaScreenCreateContext(__GLXscreen *screen, -- __GLcontextModes *modes, -- __GLXcontext *baseShareContext) --{ -- __GLXMESAcontext *context; -- __GLXMESAcontext *shareContext = (__GLXMESAcontext *) baseShareContext; -- XMesaVisual xm_vis; -- XMesaContext xm_share; -- -- context = xalloc (sizeof (__GLXMESAcontext)); -- if (context == NULL) -- return NULL; -- -- memset(context, 0, sizeof *context); -- -- context->base.pGlxScreen = screen; -- context->base.modes = modes; -- -- context->base.destroy = __glXMesaContextDestroy; -- context->base.makeCurrent = __glXMesaContextMakeCurrent; -- context->base.loseCurrent = __glXMesaContextLoseCurrent; -- context->base.copy = __glXMesaContextCopy; -- context->base.forceCurrent = __glXMesaContextForceCurrent; -- -- xm_vis = find_mesa_visual(screen, modes->visualID); -- if (!xm_vis) { -- ErrorF("find_mesa_visual returned NULL for visualID = 0x%04x\n", -- modes->visualID); -- xfree(context); -- return NULL; -- } -- -- xm_share = shareContext ? shareContext->xmesa : NULL; -- context->xmesa = XMesaCreateContext(xm_vis, xm_share); -- if (!context->xmesa) { -- xfree(context); -- return NULL; -- } -- -- return &context->base; --} -- --static void --__glXMesaScreenDestroy(__GLXscreen *screen) --{ -- __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen; -- int i; -- -- for (i = 0; i < mesaScreen->num_vis; i++) { -- if (mesaScreen->xm_vis[i]) -- XMesaDestroyVisual(mesaScreen->xm_vis[i]); -- } -- -- xfree(mesaScreen->xm_vis); -- -- __glXScreenDestroy(screen); -- -- xfree(screen); --} -- --static XMesaVisual --find_mesa_visual(__GLXscreen *screen, VisualID vid) --{ -- __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen; -- const __GLcontextModes *modes; -- unsigned i = 0; -- -- for ( modes = screen->modes ; modes != NULL ; modes = modes->next ) { -- if ( modes->visualID == vid ) { -- break; -- } -- -- i++; -- } -- -- return (modes != NULL) ? mesaScreen->xm_vis[i] : NULL; --} -- --static void init_screen_visuals(__GLXMESAscreen *screen) --{ -- ScreenPtr pScreen = screen->base.pScreen; -- __GLcontextModes *modes; -- XMesaVisual *pXMesaVisual; -- int *used; -- int i, j, size; -- -- /* Alloc space for the list of XMesa visuals */ -- size = screen->base.numVisuals * sizeof(XMesaVisual); -- pXMesaVisual = (XMesaVisual *) xalloc(size); -- memset(pXMesaVisual, 0, size); -- -- /* FIXME: Change 'used' to be a array of bits (rather than of ints), -- * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less -- * FIXME: than 64 or 128 the stack array can be used instead of calling -- * FIXME: __glXMalloc / __glXFree. If nothing else, convert 'used' to -- * FIXME: array of bytes instead of ints! -- */ -- used = (int *) xalloc(pScreen->numVisuals * sizeof(int)); -- memset(used, 0, pScreen->numVisuals * sizeof(int)); -- -- i = 0; -- for ( modes = screen->base.modes; modes != NULL; modes = modes->next ) { -- const int vis_class = _gl_convert_to_x_visual_type( modes->visualType ); -- const int nplanes = (modes->rgbBits - modes->alphaBits); -- const VisualPtr pVis = pScreen->visuals; -- -- for (j = 0; j < pScreen->numVisuals; j++) { -- if (pVis[j].class == vis_class && -- pVis[j].nplanes == nplanes && -- pVis[j].redMask == modes->redMask && -- pVis[j].greenMask == modes->greenMask && -- pVis[j].blueMask == modes->blueMask && -- !used[j]) { -- -- /* Create the XMesa visual */ -- pXMesaVisual[i] = -- XMesaCreateVisual(pScreen, -- &pVis[j], -- modes->rgbMode, -- (modes->alphaBits > 0), -- modes->doubleBufferMode, -- modes->stereoMode, -- GL_TRUE, /* ximage_flag */ -- modes->depthBits, -- modes->stencilBits, -- modes->accumRedBits, -- modes->accumGreenBits, -- modes->accumBlueBits, -- modes->accumAlphaBits, -- modes->samples, -- modes->level, -- modes->visualRating); -- /* Set the VisualID */ -- modes->visualID = pVis[j].vid; -- -- /* Mark this visual used */ -- used[j] = 1; -- break; -- } -- } -- -- if ( j == pScreen->numVisuals ) { -- ErrorF("No matching visual for __GLcontextMode with " -- "visual class = %d (%d), nplanes = %u\n", -- vis_class, -- modes->visualType, -- (modes->rgbBits - modes->alphaBits) ); -- } -- else if ( modes->visualID == -1 ) { -- FatalError( "Matching visual found, but visualID still -1!\n" ); -- } -- -- i++; -- } -- -- xfree(used); -- -- screen->num_vis = pScreen->numVisuals; -- screen->xm_vis = pXMesaVisual; --} -- --static __GLXscreen * --__glXMesaScreenProbe(ScreenPtr pScreen) --{ -- __GLXMESAscreen *screen; -- -- screen = xalloc(sizeof *screen); -- if (screen == NULL) -- return NULL; -- -- __glXScreenInit(&screen->base, pScreen); -- -- screen->base.destroy = __glXMesaScreenDestroy; -- screen->base.createContext = __glXMesaScreenCreateContext; -- screen->base.createDrawable = __glXMesaScreenCreateDrawable; -- screen->base.pScreen = pScreen; -- -- /* -- * Find the GLX visuals that are supported by this screen and create -- * XMesa's visuals. -- */ -- init_screen_visuals(screen); -- -- return &screen->base; --} -- --__GLXprovider __glXMesaProvider = { -- __glXMesaScreenProbe, -- "MESA", -- NULL --}; -- --__GLXprovider * --GlxGetMesaProvider (void) --{ -- return &__glXMesaProvider; --} -diff --git a/GL/mesa/X/xf86glx_util.c b/GL/mesa/X/xf86glx_util.c -deleted file mode 100644 -index ffb5280..0000000 ---- a/GL/mesa/X/xf86glx_util.c -+++ /dev/null -@@ -1,151 +0,0 @@ --/************************************************************************** -- --Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. --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, sub license, 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 NON-INFRINGEMENT. --IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. -- --**************************************************************************/ -- --/* -- * Authors: -- * Kevin E. Martin -- * Brian Paul -- */ -- --#ifdef HAVE_DIX_CONFIG_H --#include --#endif -- --#include -- --#include --#include "pixmapstr.h" --#include "xf86glx_util.h" --#include -- --#ifdef ROUNDUP --#undef ROUNDUP --#endif -- --#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3)) -- --XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data) --{ -- XMesaImage *image; -- -- image = (XMesaImage *)xalloc(sizeof(XMesaImage)); -- -- if (image) { -- image->width = width; -- image->height = height; -- image->data = data; -- /* Always pad to 32 bits */ -- image->bytes_per_line = ROUNDUP((bitsPerPixel * width), 32); -- image->bits_per_pixel = bitsPerPixel; -- } -- -- return image; --} -- --void XMesaDestroyImage(XMesaImage *image) --{ -- if (image->data) -- free(image->data); -- xfree(image); --} -- --unsigned long XMesaGetPixel(XMesaImage *image, int x, int y) --{ -- CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line); -- CARD8 *i8; -- CARD16 *i16; -- CARD32 *i32; -- switch (image->bits_per_pixel) { -- case 8: -- i8 = (CARD8 *)row; -- return i8[x]; -- break; -- case 15: -- case 16: -- i16 = (CARD16 *)row; -- return i16[x]; -- break; -- case 24: /* WARNING: architecture specific code */ -- i8 = (CARD8 *)row; -- return (((CARD32)i8[x*3]) | -- (((CARD32)i8[x*3+1])<<8) | -- (((CARD32)i8[x*3+2])<<16)); -- break; -- case 32: -- i32 = (CARD32 *)row; -- return i32[x]; -- break; -- } -- return 0; --} -- --#ifndef XMESA_USE_PUTPIXEL_MACRO --void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel) --{ -- CARD8 *row = (CARD8 *)(image->data + y*image->bytes_per_line); -- CARD8 *i8; -- CARD16 *i16; -- CARD32 *i32; -- switch (image->bits_per_pixel) { -- case 8: -- i8 = (CARD8 *)row; -- i8[x] = (CARD8)pixel; -- break; -- case 15: -- case 16: -- i16 = (CARD16 *)row; -- i16[x] = (CARD16)pixel; -- break; -- case 24: /* WARNING: architecture specific code */ -- i8 = (CARD8 *)__row; -- i8[x*3] = (CARD8)(p); -- i8[x*3+1] = (CARD8)(p>>8); -- i8[x*3+2] = (CARD8)(p>>16); -- case 32: -- i32 = (CARD32 *)row; -- i32[x] = (CARD32)pixel; -- break; -- } --} --#endif -- --void XMesaPutImageHelper(ScreenPtr display, -- DrawablePtr d, GCPtr gc, -- XMesaImage *image, -- int src_x, int src_y, -- int dest_x, int dest_y, -- unsigned int width, unsigned int height) --{ -- /* NOT_DONE: Verify that the following works for all depths */ -- char *src = (image->data + -- src_y * image->bytes_per_line + -- ((src_x * image->bits_per_pixel) >> 3)); -- -- ValidateGC(d, gc); -- (*gc->ops->PutImage)(d, gc, d->depth, dest_x, dest_y, width, height, -- 0, ZPixmap, src); --} -diff --git a/GL/mesa/X/xf86glx_util.h b/GL/mesa/X/xf86glx_util.h -deleted file mode 100644 -index bb31412..0000000 ---- a/GL/mesa/X/xf86glx_util.h -+++ /dev/null -@@ -1,105 +0,0 @@ --/************************************************************************** -- --Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. --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, sub license, 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 NON-INFRINGEMENT. --IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. -- --**************************************************************************/ -- --/* -- * Authors: -- * Kevin E. Martin -- * Brian Paul -- */ -- --#ifdef HAVE_DIX_CONFIG_H --#include --#endif -- --#ifndef _XF86GLX_UTIL_H_ --#define _XF86GLX_UTIL_H_ -- --#ifdef __CYGWIN__ --#undef WIN32 --#undef _WIN32 --#endif -- --#include --#include --#include --#include "GL/xmesa.h" -- --#define XMESA_USE_PUTPIXEL_MACRO -- --struct _XMesaImageRec { -- int width, height; -- char *data; -- int bytes_per_line; /* Padded to 32 bits */ -- int bits_per_pixel; --}; -- --extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, -- char *data); --extern void XMesaDestroyImage(XMesaImage *image); --extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y); --#ifdef XMESA_USE_PUTPIXEL_MACRO --#define XMesaPutPixel(__i,__x,__y,__p) \ --{ \ -- CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \ -- CARD8 *__i8; \ -- CARD16 *__i16; \ -- CARD32 *__i32; \ -- switch (__i->bits_per_pixel) { \ -- case 8: \ -- __i8 = (CARD8 *)__row; \ -- __i8[__x] = (CARD8)__p; \ -- break; \ -- case 15: \ -- case 16: \ -- __i16 = (CARD16 *)__row; \ -- __i16[__x] = (CARD16)__p; \ -- break; \ -- case 24: /* WARNING: architecture specific code */ \ -- __i8 = (CARD8 *)__row; \ -- __i8[__x*3] = (CARD8)(__p); \ -- __i8[__x*3+1] = (CARD8)(__p>>8); \ -- __i8[__x*3+2] = (CARD8)(__p>>16); \ -- break; \ -- case 32: \ -- __i32 = (CARD32 *)__row; \ -- __i32[__x] = (CARD32)__p; \ -- break; \ -- } \ --} --#else --extern void XMesaPutPixel(XMesaImage *image, int x, int y, -- unsigned long pixel); --#endif -- --extern void XMesaPutImageHelper(ScreenPtr display, -- DrawablePtr d, GCPtr gc, -- XMesaImage *image, -- int src_x, int src_y, -- int dest_x, int dest_y, -- unsigned int width, unsigned int height); -- --#endif /* _XF86GLX_UTIL_H_ */ -diff --git a/GL/mesa/X/xf86glxint.h b/GL/mesa/X/xf86glxint.h -deleted file mode 100644 -index 8c7e913..0000000 ---- a/GL/mesa/X/xf86glxint.h -+++ /dev/null -@@ -1,45 +0,0 @@ --/************************************************************************** -- --Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. --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, sub license, 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 NON-INFRINGEMENT. --IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. -- --**************************************************************************/ -- --/* -- * Authors: -- * Kevin E. Martin -- * -- */ -- --#ifdef HAVE_DIX_CONFIG_H --#include --#endif -- --#ifndef _XF86GLXINT_H_ --#define _XF86GLXINT_H_ -- --#include --#include --#include -- --#endif /* _XF86GLXINT_H_ */ -diff --git a/GL/mesa/array_cache/Makefile.am b/GL/mesa/array_cache/Makefile.am -deleted file mode 100644 -index 5016b73..0000000 ---- a/GL/mesa/array_cache/Makefile.am -+++ /dev/null -@@ -1,21 +0,0 @@ --noinst_LTLIBRARIES = libac.la -- --AM_CFLAGS = \ -- $(DIX_CFLAGS) \ -- -DXFree86Server \ -- @GLX_DEFINES@ -- --INCLUDES = -I@MESA_SOURCE@/include \ -- -I../X \ -- -I../array_cache \ -- -I../glapi \ -- -I../main \ -- -I../math \ -- -I../shader \ -- -I../swrast \ -- -I../swrast_setup \ -- -I../tnl \ -- -I.. \ -- -I$(top_srcdir)/hw/xfree86/os-support -- --nodist_libac_la_SOURCES = ac_context.c ac_import.c -diff --git a/GL/mesa/glapi/Makefile.am b/GL/mesa/glapi/Makefile.am -index de457b9..db79114 100644 ---- a/GL/mesa/glapi/Makefile.am -+++ b/GL/mesa/glapi/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -diff --git a/GL/mesa/main/Makefile.am b/GL/mesa/main/Makefile.am -index 64b383d..f8ce137 100644 ---- a/GL/mesa/main/Makefile.am -+++ b/GL/mesa/main/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -@@ -62,13 +61,14 @@ nodist_libmain_la_SOURCES = accum.c \ - matrix.c \ - mipmap.c \ - mm.c \ -- occlude.c \ - pixel.c \ - points.c \ - polygon.c \ -+ queryobj.c \ - rastpos.c \ - rbadaptors.c \ - renderbuffer.c \ -+ shaders.c \ - state.c \ - stencil.c \ - texcompress.c \ -diff --git a/GL/mesa/math/Makefile.am b/GL/mesa/math/Makefile.am -index 5e99d90..c7c5642 100644 ---- a/GL/mesa/math/Makefile.am -+++ b/GL/mesa/math/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -diff --git a/GL/mesa/shader/Makefile.am b/GL/mesa/shader/Makefile.am -index 4bd5736..abde275 100644 ---- a/GL/mesa/shader/Makefile.am -+++ b/GL/mesa/shader/Makefile.am -@@ -9,7 +9,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -@@ -28,8 +27,13 @@ nodist_libshader_la_SOURCES = \ - atifragshader.c \ - nvfragparse.c \ - nvprogram.c \ -- nvvertexec.c \ -- nvvertparse.c \ -+ nvvertparse.c \ -+ prog_debug.c \ -+ prog_execute.c \ -+ prog_instruction.c \ -+ prog_parameter.c \ -+ prog_print.c \ - program.c \ -- shaderobjects.c \ -- shaderobjects_3dlabs.c -+ programopt.c \ -+ prog_statevars.c \ -+ shader_api.c -diff --git a/GL/mesa/shader/grammar/Makefile.am b/GL/mesa/shader/grammar/Makefile.am -index 0974d5b..332c8e9 100644 ---- a/GL/mesa/shader/grammar/Makefile.am -+++ b/GL/mesa/shader/grammar/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../../X \ -- -I../../array_cache \ - -I../../glapi \ - -I../../main \ - -I../../math \ -diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am -index 8f2636e..71498ee 100644 ---- a/GL/mesa/shader/slang/Makefile.am -+++ b/GL/mesa/shader/slang/Makefile.am -@@ -8,7 +8,6 @@ AM_CFLAGS = \ - INCLUDES = -I@MESA_SOURCE@/include \ - -I../grammar \ - -I../../X \ -- -I../../array_cache \ - -I../../glapi \ - -I../../main \ - -I../../math \ -@@ -19,23 +18,24 @@ INCLUDES = -I@MESA_SOURCE@/include \ - -I../.. \ - -I$(top_srcdir)/hw/xfree86/os-support - --nodist_libslang_la_SOURCES = slang_analyse.c \ -- slang_assemble_assignment.c \ -- slang_assemble.c \ -- slang_assemble_conditional.c \ -- slang_assemble_constructor.c \ -- slang_assemble_typeinfo.c \ -+nodist_libslang_la_SOURCES = slang_builtin.c \ -+ slang_codegen.c \ - slang_compile.c \ - slang_compile_function.c \ - slang_compile_operation.c \ - slang_compile_struct.c \ - slang_compile_variable.c \ -- slang_execute.c \ -- slang_execute_x86.c \ -- slang_export.c \ -- slang_library_texsample.c \ -+ slang_emit.c \ -+ slang_ir.c \ -+ slang_label.c \ - slang_library_noise.c \ - slang_link.c \ -+ slang_log.c \ -+ slang_mem.c \ - slang_preprocess.c \ -+ slang_print.c \ -+ slang_simplify.c \ - slang_storage.c \ -- slang_utility.c -+ slang_typeinfo.c \ -+ slang_utility.c \ -+ slang_vartable.c -diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am -index d972af6..bffb1e7 100644 ---- a/GL/mesa/swrast/Makefile.am -+++ b/GL/mesa/swrast/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -@@ -24,7 +23,6 @@ nodist_libswrast_la_SOURCES = s_aaline.c \ - s_aatriangle.c \ - s_accum.c \ - s_alpha.c \ -- s_arbshader.c \ - s_atifragshader.c \ - s_bitmap.c \ - s_blend.c \ -@@ -36,11 +34,11 @@ nodist_libswrast_la_SOURCES = s_aaline.c \ - s_drawpix.c \ - s_feedback.c \ - s_fog.c \ -+ s_fragprog.c \ - s_imaging.c \ - s_lines.c \ - s_logic.c \ - s_masking.c \ -- s_nvfragprog.c \ - s_points.c \ - s_readpix.c \ - s_span.c \ -diff --git a/GL/mesa/swrast_setup/Makefile.am b/GL/mesa/swrast_setup/Makefile.am -index 8d70408..1f3c031 100644 ---- a/GL/mesa/swrast_setup/Makefile.am -+++ b/GL/mesa/swrast_setup/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am -index 717e6fd..b3c8206 100644 ---- a/GL/mesa/tnl/Makefile.am -+++ b/GL/mesa/tnl/Makefile.am -@@ -7,7 +7,6 @@ AM_CFLAGS = \ - - INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ -- -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ -@@ -19,16 +18,9 @@ INCLUDES = -I@MESA_SOURCE@/include \ - -I.. \ - -I$(top_srcdir)/hw/xfree86/os-support - --nodist_libtnl_la_SOURCES = t_array_api.c \ -- t_array_import.c \ -- t_context.c \ -+nodist_libtnl_la_SOURCES = t_context.c \ -+ t_draw.c \ - t_pipeline.c \ -- t_save_api.c \ -- t_save_loopback.c \ -- t_save_playback.c \ -- t_vb_arbprogram.c \ -- t_vb_arbprogram_sse.c \ -- t_vb_arbshader.c \ - t_vb_cull.c \ - t_vb_fog.c \ - t_vb_light.c \ -@@ -42,9 +34,4 @@ nodist_libtnl_la_SOURCES = t_array_api.c \ - t_vertex.c \ - t_vertex_generic.c \ - t_vertex_sse.c \ -- t_vp_build.c \ -- t_vtx_api.c \ -- t_vtx_eval.c \ -- t_vtx_exec.c \ -- t_vtx_generic.c \ -- t_vtx_x86.c -+ t_vp_build.c -diff --git a/GL/mesa/vbo/Makefile.am b/GL/mesa/vbo/Makefile.am -new file mode 100644 -index 0000000..9943f2a ---- /dev/null -+++ b/GL/mesa/vbo/Makefile.am -@@ -0,0 +1,35 @@ -+noinst_LTLIBRARIES = libvbo.la -+ -+AM_CFLAGS = \ -+ $(DIX_CFLAGS) \ -+ -DXFree86Server \ -+ @GLX_DEFINES@ -+ -+INCLUDES = -I@MESA_SOURCE@/include \ -+ -I../X \ -+ -I../glapi \ -+ -I../main \ -+ -I../math \ -+ -I../shader \ -+ -I../shader/slang \ -+ -I../shader/slang \ -+ -I../swrast \ -+ -I../swrast_setup \ -+ -I../tnl \ -+ -I.. \ -+ -I$(top_srcdir)/hw/xfree86/os-support -+ -+nodist_libvbo_la_SOURCES = vbo_context.c \ -+ vbo_exec_api.c \ -+ vbo_exec_array.c \ -+ vbo_exec.c \ -+ vbo_exec_draw.c \ -+ vbo_exec_eval.c \ -+ vbo_rebase.c \ -+ vbo_save_api.c \ -+ vbo_save.c \ -+ vbo_save_draw.c \ -+ vbo_save_loopback.c \ -+ vbo_split.c \ -+ vbo_split_copy.c \ -+ vbo_split_inplace.c -diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh -index c14c683..0cfe1c9 100755 ---- a/GL/symlink-mesa.sh -+++ b/GL/symlink-mesa.sh -@@ -85,15 +85,6 @@ symlink_mesa_math() { - done - } - --symlink_mesa_ac() { -- src_dir src/mesa/array_cache -- dst_dir mesa/array_cache -- -- for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do -- action `basename $src` -- done --} -- - symlink_mesa_swrast() { - src_dir src/mesa/swrast - dst_dir mesa/swrast -@@ -157,6 +148,15 @@ symlink_mesa_shader_slang_library() { - done - } - -+symlink_mesa_vbo() { -+ src_dir src/mesa/vbo -+ dst_dir mesa/vbo -+ -+ for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do -+ action `basename $src` -+ done -+} -+ - symlink_mesa_x() { - src_dir src/mesa/drivers/x11 - dst_dir mesa/X -@@ -168,6 +168,8 @@ symlink_mesa_x() { - action xm_api.c - action xm_buffer.c - action xm_dd.c -+ action xm_image.c -+ action xm_image.h - action xm_line.c - action xm_span.c - action xm_tri.c -@@ -203,7 +205,6 @@ symlink_mesa_x8664() { - symlink_mesa() { - symlink_mesa_main - symlink_mesa_math -- symlink_mesa_ac - symlink_mesa_swrast - symlink_mesa_ss - symlink_mesa_tnl -@@ -215,6 +216,7 @@ symlink_mesa() { - symlink_mesa_glapi - symlink_mesa_ppc - symlink_mesa_sparc -+ symlink_mesa_vbo - symlink_mesa_x86 - symlink_mesa_x8664 - } -@@ -225,9 +227,6 @@ symlink_glx() { - dst_dir glx - - action indirect_size.h -- -- src_dir src/mesa/drivers/dri/common -- - action glcontextmodes.c - action glcontextmodes.h - -@@ -289,9 +288,9 @@ action() { - } - - usage() { -- echo symlink.sh src-dir dst-dir -- echo src-dir: the xc directory of the monolithic source tree -- echo dst-dir: the modular source tree containing proto, app, lib, ... -+ echo symlink-mesa.sh src-dir dst-dir -+ echo src-dir: the Mesa source directory -+ echo dst-dir: the GL subdirectory of the Xserver modular tree - } - - # Check commandline args ---- xorg-server-1.3.0.0.orig/configure.ac 2007-08-11 11:35:59.000000000 +1000 -+++ xorg-server-1.3.0.0/configure.ac 2007-08-11 13:09:14.000000000 +1000 -@@ -1694,7 +1694,6 @@ - GL/Makefile - GL/glx/Makefile - GL/mesa/Makefile --GL/mesa/array_cache/Makefile - GL/mesa/glapi/Makefile - GL/mesa/main/Makefile - GL/mesa/math/Makefile -@@ -1704,6 +1703,7 @@ - GL/mesa/swrast/Makefile - GL/mesa/swrast_setup/Makefile - GL/mesa/tnl/Makefile -+GL/mesa/vbo/Makefile - GL/mesa/X/Makefile - include/Makefile - afb/Makefile -diff --git a/hw/xfree86/dri/Makefile.am b/hw/xfree86/dri/Makefile.am -index 4def387..68f1eae 100644 ---- a/hw/xfree86/dri/Makefile.am -+++ b/hw/xfree86/dri/Makefile.am -@@ -7,7 +7,7 @@ libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ - -I$(top_builddir)/GL/include \ - -I@MESA_SOURCE@/include \ - -DHAVE_XORG_CONFIG_H \ -- @DRIPROTO_CFLAGS@ \ -+ @DIX_CFLAGS@ @DRIPROTO_CFLAGS@ \ - @LIBDRM_CFLAGS@ \ - @GL_CFLAGS@ - libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ -diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c -index 3b0d4db..80e07c5 100644 ---- a/hw/xfree86/dri/dri.c -+++ b/hw/xfree86/dri/dri.c -@@ -43,6 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include - #include - #include -+#include - - #define NEED_REPLIES - #define NEED_EVENTS -@@ -71,10 +72,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "mipointer.h" - #include "xf86_OSproc.h" - -+#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) -+ - #if !defined(PANORAMIX) - extern Bool noPanoramiXExtension; - #endif - -+static int DRIEntPrivIndex = -1; - static int DRIScreenPrivIndex = -1; - static int DRIWindowPrivIndex = -1; - static unsigned long DRIGeneration = 0; -@@ -110,24 +114,205 @@ DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) - } - - -+static void -+DRIOpenDRMCleanup(DRIEntPrivPtr pDRIEntPriv) -+{ -+ if (pDRIEntPriv->pLSAREA != NULL) { -+ drmUnmap(pDRIEntPriv->pLSAREA, pDRIEntPriv->sAreaSize); -+ pDRIEntPriv->pLSAREA = NULL; -+ } -+ if (pDRIEntPriv->hLSAREA != 0) { -+ drmRmMap(pDRIEntPriv->drmFD, pDRIEntPriv->hLSAREA); -+ } -+ if (pDRIEntPriv->drmFD >= 0) { -+ drmClose(pDRIEntPriv->drmFD); -+ pDRIEntPriv->drmFD = 0; -+ } -+} -+ -+int -+DRIMasterFD(ScrnInfoPtr pScrn) -+{ -+ return DRI_ENT_PRIV(pScrn)->drmFD; -+} -+ -+void * -+DRIMasterSareaPointer(ScrnInfoPtr pScrn) -+{ -+ return DRI_ENT_PRIV(pScrn)->pLSAREA; -+} -+ -+drm_handle_t -+DRIMasterSareaHandle(ScrnInfoPtr pScrn) -+{ -+ return DRI_ENT_PRIV(pScrn)->hLSAREA; -+} -+ -+ -+Bool -+DRIOpenDRMMaster(ScrnInfoPtr pScrn, -+ unsigned long sAreaSize, -+ const char *busID, -+ const char *drmDriverName) -+{ -+ drmSetVersion saveSv, sv; -+ Bool drmWasAvailable; -+ DRIEntPrivPtr pDRIEntPriv; -+ DRIEntPrivRec tmp; -+ drmVersionPtr drmlibv; -+ int drmlibmajor, drmlibminor; -+ const char *openBusID; -+ int count; -+ int err; -+ -+ if (DRIEntPrivIndex == -1) -+ DRIEntPrivIndex = xf86AllocateEntityPrivateIndex(); -+ -+ pDRIEntPriv = DRI_ENT_PRIV(pScrn); -+ -+ if (pDRIEntPriv && pDRIEntPriv->drmFD != -1) -+ return TRUE; -+ -+ drmWasAvailable = drmAvailable(); -+ -+ memset(&tmp, 0, sizeof(tmp)); -+ -+ /* Check the DRM lib version. -+ * drmGetLibVersion was not supported in version 1.0, so check for -+ * symbol first to avoid possible crash or hang. -+ */ -+ -+ drmlibmajor = 1; -+ drmlibminor = 0; -+ if (xf86LoaderCheckSymbol("drmGetLibVersion")) { -+ drmlibv = drmGetLibVersion(-1); -+ if (drmlibv != NULL) { -+ drmlibmajor = drmlibv->version_major; -+ drmlibminor = drmlibv->version_minor; -+ drmFreeVersion(drmlibv); -+ } -+ } -+ -+ /* Check if the libdrm can handle falling back to loading based on name -+ * if a busid string is passed. -+ */ -+ openBusID = (drmlibmajor == 1 && drmlibminor >= 2) ? busID : NULL; -+ -+ tmp.drmFD = -1; -+ sv.drm_di_major = 1; -+ sv.drm_di_minor = 1; -+ sv.drm_dd_major = -1; -+ -+ saveSv = sv; -+ count = 10; -+ while (count--) { -+ tmp.drmFD = drmOpen(drmDriverName, openBusID); -+ -+ if (tmp.drmFD < 0) { -+ DRIDrvMsg(-1, X_ERROR, "[drm] drmOpen failed.\n"); -+ goto out_err; -+ } -+ -+ err = drmSetInterfaceVersion(tmp.drmFD, &sv); -+ -+ if (err != -EPERM) -+ break; -+ -+ sv = saveSv; -+ drmClose(tmp.drmFD); -+ tmp.drmFD = -1; -+ usleep(100000); -+ } -+ -+ if (tmp.drmFD <= 0) { -+ DRIDrvMsg(-1, X_ERROR, "[drm] DRM was busy with another master.\n"); -+ goto out_err; -+ } -+ -+ if (!drmWasAvailable) { -+ DRIDrvMsg(-1, X_INFO, -+ "[drm] loaded kernel module for \"%s\" driver.\n", -+ drmDriverName); -+ } -+ -+ if (err != 0) { -+ sv.drm_di_major = 1; -+ sv.drm_di_minor = 0; -+ } -+ -+ DRIDrvMsg(-1, X_INFO, "[drm] DRM interface version %d.%d\n", -+ sv.drm_di_major, sv.drm_di_minor); -+ -+ if (sv.drm_di_major == 1 && sv.drm_di_minor >= 1) -+ err = 0; -+ else -+ err = drmSetBusid(tmp.drmFD, busID); -+ -+ if (err) { -+ DRIDrvMsg(-1, X_ERROR, "[drm] Could not set DRM device bus ID.\n"); -+ goto out_err; -+ } -+ -+ /* -+ * Create a lock-containing sarea. -+ */ -+ -+ if (drmAddMap( tmp.drmFD, 0, sAreaSize, DRM_SHM, -+ DRM_CONTAINS_LOCK, &tmp.hLSAREA) < 0) { -+ DRIDrvMsg(-1, X_INFO, "[drm] Could not create SAREA for DRM lock.\n"); -+ tmp.hLSAREA = 0; -+ goto out_err; -+ } -+ -+ if (drmMap( tmp.drmFD, tmp.hLSAREA, sAreaSize, -+ (drmAddressPtr)(&tmp.pLSAREA)) < 0) { -+ DRIDrvMsg(-1, X_INFO, "[drm] Mapping SAREA for DRM lock failed.\n"); -+ tmp.pLSAREA = NULL; -+ goto out_err; -+ } -+ -+ memset(tmp.pLSAREA, 0, sAreaSize); -+ -+ /* -+ * Reserved contexts are handled by the first opened screen. -+ */ -+ -+ tmp.resOwner = NULL; -+ -+ if (!pDRIEntPriv) -+ pDRIEntPriv = xnfcalloc(sizeof(*pDRIEntPriv), 1); -+ -+ if (!pDRIEntPriv) { -+ DRIDrvMsg(-1, X_INFO, "[drm] Failed to allocate memory for " -+ "DRM device.\n"); -+ goto out_err; -+ } -+ *pDRIEntPriv = tmp; -+ xf86GetEntityPrivate((pScrn)->entityList[0],DRIEntPrivIndex)->ptr = -+ pDRIEntPriv; -+ -+ DRIDrvMsg(-1, X_INFO, "[drm] DRM open master succeeded.\n"); -+ return TRUE; -+ -+ out_err: -+ -+ DRIOpenDRMCleanup(&tmp); -+ return FALSE; -+} -+ -+ - Bool - DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) - { - DRIScreenPrivPtr pDRIPriv; - drm_context_t * reserved; - int reserved_count; -- int i, fd, drmWasAvailable; -+ int i; - Bool xineramaInCore = FALSE; -- int err = 0; -- char *openbusid; -- drmVersionPtr drmlibv; -- int drmlibmajor, drmlibminor, drmdimajor, drmdiminor; -- -- if (DRIGeneration != serverGeneration) { -- if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) -- return FALSE; -- DRIGeneration = serverGeneration; -- } -+ DRIEntPrivPtr pDRIEntPriv; -+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -+ DRIContextFlags flags = 0; -+ DRIContextPrivPtr pDRIContextPriv; - - /* If the DRI extension is disabled, do not initialize the DRI */ - if (noXFree86DRIExtension) { -@@ -151,59 +336,32 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) - } - } - -- drmWasAvailable = drmAvailable(); -- -- /* Check the DRM lib version. -- * drmGetLibVersion was not supported in version 1.0, so check for -- * symbol first to avoid possible crash or hang. -- */ -- drmlibmajor = 1; -- drmlibminor = 0; -- if (xf86LoaderCheckSymbol("drmGetLibVersion")) { -- drmlibv = drmGetLibVersion(-1); -- if (drmlibv != NULL) { -- drmlibmajor = drmlibv->version_major; -- drmlibminor = drmlibv->version_minor; -- drmFreeVersion(drmlibv); -- } -- } -- -- /* Check if the libdrm can handle falling back to loading based on name -- * if a busid string is passed. -- */ -- if (drmlibmajor == 1 && drmlibminor >= 2) -- openbusid = pDRIInfo->busIdString; -- else -- openbusid = NULL; -+ if (!DRIOpenDRMMaster(pScrn, pDRIInfo->SAREASize, -+ pDRIInfo->busIdString, -+ pDRIInfo->drmDriverName)) -+ return FALSE; - -- /* Note that drmOpen will try to load the kernel module, if needed. */ -- fd = drmOpen(pDRIInfo->drmDriverName, openbusid); -- if (fd < 0) { -- /* failed to open DRM */ -- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] drmOpen failed\n"); -- return FALSE; -- } -+ pDRIEntPriv = DRI_ENT_PRIV(pScrn); - -- if (!drmWasAvailable) { -- /* drmOpen loaded the kernel module, print a message to say so */ -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] loaded kernel module for \"%s\" driver\n", -- pDRIInfo->drmDriverName); -+ if (DRIGeneration != serverGeneration) { -+ if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) -+ return FALSE; -+ DRIGeneration = serverGeneration; - } - - pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); - if (!pDRIPriv) { - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -+ DRIScreenPrivIndex = -1; - return FALSE; - } - - pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; -- pDRIPriv->drmFD = fd; -+ pDRIPriv->drmFD = pDRIEntPriv->drmFD; - pDRIPriv->directRenderingSupport = TRUE; - pDRIPriv->pDriverInfo = pDRIInfo; - pDRIPriv->nrWindows = 0; -+ pDRIPriv->nrWindowsVisible = 0; - pDRIPriv->fullscreen = NULL; - - pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx; -@@ -211,124 +369,99 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) - - pDRIPriv->grabbedDRILock = FALSE; - pDRIPriv->drmSIGIOHandlerInstalled = FALSE; -+ *pDRMFD = pDRIPriv->drmFD; - -- if (drmlibmajor == 1 && drmlibminor >= 2) { -- drmSetVersion sv; -- -- /* Get the interface version, asking for 1.1. */ -- sv.drm_di_major = 1; -- sv.drm_di_minor = 1; -- sv.drm_dd_major = -1; -- err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv); -- if (err == 0) { -- drmdimajor = sv.drm_di_major; -- drmdiminor = sv.drm_di_minor; -- } else { -- /* failure, so set it to 1.0.0. */ -- drmdimajor = 1; -- drmdiminor = 0; -+ if (pDRIEntPriv->sAreaGrabbed || pDRIInfo->allocSarea) { -+ -+ if (drmAddMap( pDRIPriv->drmFD, -+ 0, -+ pDRIPriv->pDriverInfo->SAREASize, -+ DRM_SHM, -+ 0, -+ &pDRIPriv->hSAREA) < 0) -+ { -+ pDRIPriv->directRenderingSupport = FALSE; -+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -+ drmClose(pDRIPriv->drmFD); -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] drmAddMap failed\n"); -+ return FALSE; - } -- } -- else { -- /* We can't check the DI DRM interface version, so set it to 1.0.0. */ -- drmdimajor = 1; -- drmdiminor = 0; -- } -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor); -- -- /* If the interface minor number is 1.1, then we've opened a DRM device -- * that already had the busid set through drmOpen. -- */ -- if (drmdimajor == 1 && drmdiminor >= 1) -- err = 0; -- else -- err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString); -- -- if (err < 0) { -- pDRIPriv->directRenderingSupport = FALSE; -- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -- drmClose(pDRIPriv->drmFD); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] drmSetBusid failed (%d, %s), %s\n", -- pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err)); -- return FALSE; -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] added %d byte SAREA at %p\n", -+ pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); -+ -+ /* Backwards compat. */ -+ if (drmMap( pDRIPriv->drmFD, -+ pDRIPriv->hSAREA, -+ pDRIPriv->pDriverInfo->SAREASize, -+ (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) -+ { -+ pDRIPriv->directRenderingSupport = FALSE; -+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -+ drmClose(pDRIPriv->drmFD); -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] drmMap failed\n"); -+ return FALSE; -+ } -+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", -+ pDRIPriv->hSAREA, pDRIPriv->pSAREA); -+ memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); -+ } else { -+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] Using the DRM lock " -+ "SAREA also for drawables.\n"); -+ pDRIPriv->hSAREA = pDRIEntPriv->hLSAREA; -+ pDRIPriv->pSAREA = (XF86DRISAREAPtr) pDRIEntPriv->pLSAREA; -+ pDRIEntPriv->sAreaGrabbed = TRUE; - } - -- *pDRMFD = pDRIPriv->drmFD; -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] created \"%s\" driver at busid \"%s\"\n", -- pDRIPriv->pDriverInfo->drmDriverName, -- pDRIPriv->pDriverInfo->busIdString); -- -- if (drmAddMap( pDRIPriv->drmFD, -- 0, -- pDRIPriv->pDriverInfo->SAREASize, -- DRM_SHM, -- DRM_CONTAINS_LOCK, -- &pDRIPriv->hSAREA) < 0) -- { -- pDRIPriv->directRenderingSupport = FALSE; -- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -- drmClose(pDRIPriv->drmFD); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] drmAddMap failed\n"); -- return FALSE; -- } -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] added %d byte SAREA at %p\n", -- pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); -+ pDRIPriv->hLSAREA = pDRIEntPriv->hLSAREA; -+ pDRIPriv->pLSAREA = pDRIEntPriv->pLSAREA; - -- if (drmMap( pDRIPriv->drmFD, -- pDRIPriv->hSAREA, -- pDRIPriv->pDriverInfo->SAREASize, -- (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) -+ if (!pDRIPriv->pDriverInfo->dontMapFrameBuffer) - { -- pDRIPriv->directRenderingSupport = FALSE; -- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -- drmClose(pDRIPriv->drmFD); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] drmMap failed\n"); -- return FALSE; -+ if (drmAddMap( pDRIPriv->drmFD, -+ (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, -+ pDRIPriv->pDriverInfo->frameBufferSize, -+ DRM_FRAME_BUFFER, -+ 0, -+ &pDRIPriv->pDriverInfo->hFrameBuffer) < 0) -+ { -+ pDRIPriv->directRenderingSupport = FALSE; -+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -+ drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); -+ drmClose(pDRIPriv->drmFD); -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] drmAddMap failed\n"); -+ return FALSE; -+ } -+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", -+ pDRIPriv->pDriverInfo->hFrameBuffer); -+ } else { -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] framebuffer mapped by ddx driver\n"); - } -- memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); -- DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", -- pDRIPriv->hSAREA, pDRIPriv->pSAREA); - -- if (drmAddMap( pDRIPriv->drmFD, -- (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, -- pDRIPriv->pDriverInfo->frameBufferSize, -- DRM_FRAME_BUFFER, -- 0, -- &pDRIPriv->hFrameBuffer) < 0) -- { -- pDRIPriv->directRenderingSupport = FALSE; -- pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -- drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize); -- drmClose(pDRIPriv->drmFD); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] drmAddMap failed\n"); -- return FALSE; -- } -- DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", -- pDRIPriv->hFrameBuffer); -+ if (pDRIEntPriv->resOwner == NULL) { -+ pDRIEntPriv->resOwner = pScreen; - -- /* Add tags for reserved contexts */ -- if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, -- &reserved_count))) { -- int i; -- void *tag; -+ /* Add tags for reserved contexts */ -+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, -+ &reserved_count))) { -+ int i; -+ void *tag; - -- for (i = 0; i < reserved_count; i++) { -- tag = DRICreateContextPrivFromHandle(pScreen, -- reserved[i], -- DRI_CONTEXT_RESERVED); -- drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); -+ for (i = 0; i < reserved_count; i++) { -+ tag = DRICreateContextPrivFromHandle(pScreen, -+ reserved[i], -+ DRI_CONTEXT_RESERVED); -+ drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); -+ } -+ drmFreeReservedContextList(reserved); -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] added %d reserved context%s for kernel\n", -+ reserved_count, reserved_count > 1 ? "s" : ""); - } -- drmFreeReservedContextList(reserved); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] added %d reserved context%s for kernel\n", -- reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* validate max drawable table entry set by driver */ -@@ -346,21 +479,22 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) - pDRIPriv->pSAREA->drawableTable[i].flags = 0; - } - -- return TRUE; --} -+ pDRIPriv->pLockRefCount = &pDRIEntPriv->lockRefCount; -+ pDRIPriv->pLockingContext = &pDRIEntPriv->lockingContext; - --Bool --DRIFinishScreenInit(ScreenPtr pScreen) --{ -- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -- DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; -- DRIContextFlags flags = 0; -- DRIContextPrivPtr pDRIContextPriv; -+ if (!pDRIEntPriv->keepFDOpen) -+ pDRIEntPriv->keepFDOpen = pDRIInfo->keepFDOpen; -+ -+ pDRIEntPriv->refCount++; - -- /* Set up flags for DRICreateContextPriv */ -+ /* Set up flags for DRICreateContextPriv */ - switch (pDRIInfo->driverSwapMethod) { -- case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break; -- case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break; -+ case DRI_KERNEL_SWAP: -+ flags = DRI_CONTEXT_2DONLY; -+ break; -+ case DRI_HIDE_X_CONTEXT: -+ flags = DRI_CONTEXT_PRESERVED; -+ break; - } - - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, -@@ -447,6 +581,15 @@ DRIFinishScreenInit(ScreenPtr pScreen) - break; - } - -+ return TRUE; -+} -+ -+Bool -+DRIFinishScreenInit(ScreenPtr pScreen) -+{ -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; -+ - /* Wrap DRI support */ - if (pDRIInfo->wrap.ValidateTree) { - pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree; -@@ -460,6 +603,10 @@ DRIFinishScreenInit(ScreenPtr pScreen) - pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; - } -+ -+ pDRIPriv->DestroyWindow = pScreen->DestroyWindow; -+ pScreen->DestroyWindow = DRIDestroyWindow; -+ - if (pDRIInfo->wrap.CopyWindow) { - pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow; -@@ -487,8 +634,11 @@ DRICloseScreen(ScreenPtr pScreen) - DRIInfoPtr pDRIInfo; - drm_context_t * reserved; - int reserved_count; -+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -+ DRIEntPrivPtr pDRIEntPriv = DRI_ENT_PRIV(pScrn); -+ Bool closeMaster; - -- if (pDRIPriv && pDRIPriv->directRenderingSupport) { -+ if (pDRIPriv) { - - pDRIInfo = pDRIPriv->pDriverInfo; - -@@ -506,6 +656,10 @@ DRICloseScreen(ScreenPtr pScreen) - pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; - pDRIPriv->wrap.WindowExposures = NULL; - } -+ if (pDRIPriv->DestroyWindow) { -+ pScreen->DestroyWindow = pDRIPriv->DestroyWindow; -+ pDRIPriv->DestroyWindow = NULL; -+ } - if (pDRIInfo->wrap.CopyWindow) { - pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; - pDRIPriv->wrap.CopyWindow = NULL; -@@ -539,41 +693,59 @@ DRICloseScreen(ScreenPtr pScreen) - } - - /* Remove tags for reserved contexts */ -- if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, -+ if (pDRIEntPriv->resOwner == pScreen) { -+ pDRIEntPriv->resOwner = NULL; -+ -+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { -- int i; -+ int i; - -- for (i = 0; i < reserved_count; i++) { -- DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, -- reserved[i])); -+ for (i = 0; i < reserved_count; i++) { -+ DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, -+ reserved[i])); -+ } -+ drmFreeReservedContextList(reserved); -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] removed %d reserved context%s for kernel\n", -+ reserved_count, reserved_count > 1 ? "s" : ""); - } -- drmFreeReservedContextList(reserved); -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] removed %d reserved context%s for kernel\n", -- reserved_count, reserved_count > 1 ? "s" : ""); - } - - /* Make sure signals get unblocked etc. */ - drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); -- pDRIPriv->lockRefCount = 0; -- DRIDrvMsg(pScreen->myNum, X_INFO, -- "[drm] unmapping %d bytes of SAREA %p at %p\n", -- pDRIInfo->SAREASize, -- pDRIPriv->hSAREA, -- pDRIPriv->pSAREA); -- if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { -- DRIDrvMsg(pScreen->myNum, X_ERROR, -- "[drm] unable to unmap %d bytes" -- " of SAREA %p at %p\n", -+ pDRIPriv->pLockRefCount = NULL; -+ closeMaster = (--pDRIEntPriv->refCount == 0) && -+ !pDRIEntPriv->keepFDOpen; -+ if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) { -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] unmapping %d bytes of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); -+ if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { -+ DRIDrvMsg(pScreen->myNum, X_ERROR, -+ "[drm] unable to unmap %d bytes" -+ " of SAREA %p at %p\n", -+ pDRIInfo->SAREASize, -+ pDRIPriv->hSAREA, -+ pDRIPriv->pSAREA); -+ } -+ } else { -+ pDRIEntPriv->sAreaGrabbed = FALSE; - } - -- drmClose(pDRIPriv->drmFD); -+ if (closeMaster || (pDRIEntPriv->drmFD != pDRIPriv->drmFD)) { -+ drmClose(pDRIPriv->drmFD); -+ if (pDRIEntPriv->drmFD == pDRIPriv->drmFD) { -+ DRIDrvMsg(pScreen->myNum, X_INFO, -+ "[drm] Closed DRM master.\n"); -+ pDRIEntPriv->drmFD = -1; -+ } -+ } - - xfree(pDRIPriv); - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; -+ DRIScreenPrivIndex = -1; - } - } - -@@ -1006,9 +1178,96 @@ DRITransitionTo2d(ScreenPtr pScreen) - } - - -+static int -+DRIDCNTreeTraversal(WindowPtr pWin, pointer data) -+{ -+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); -+ -+ if (pDRIDrawablePriv) { -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ if (REGION_NUM_RECTS(&pWin->clipList) > 0) { -+ WindowPtr *pDRIWindows = (WindowPtr*)data; -+ int i = 0; -+ -+ while (pDRIWindows[i]) -+ i++; -+ -+ pDRIWindows[i] = pWin; -+ -+ pDRIPriv->nrWalked++; -+ } -+ -+ if (pDRIPriv->nrWindows == pDRIPriv->nrWalked) -+ return WT_STOPWALKING; -+ } -+ -+ return WT_WALKCHILDREN; -+} -+ -+static void -+DRIDriverClipNotify(ScreenPtr pScreen) -+{ -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ if (pDRIPriv->pDriverInfo->ClipNotify) { -+ WindowPtr *pDRIWindows = xcalloc(sizeof(WindowPtr), pDRIPriv->nrWindows); -+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo; -+ -+ if (pDRIPriv->nrWindows > 0) { -+ pDRIPriv->nrWalked = 0; -+ TraverseTree(WindowTable[pScreen->myNum], DRIDCNTreeTraversal, -+ (pointer)pDRIWindows); -+ } -+ -+ pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); -+ -+ xfree(pDRIWindows); -+ } -+} -+ -+static void -+DRIIncreaseNumberVisible(ScreenPtr pScreen) -+{ -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ switch (++pDRIPriv->nrWindowsVisible) { -+ case 1: -+ DRITransitionTo3d( pScreen ); -+ break; -+ case 2: -+ DRITransitionToSharedBuffers( pScreen ); -+ break; -+ default: -+ break; -+ } -+ -+ DRIDriverClipNotify(pScreen); -+} -+ -+static void -+DRIDecreaseNumberVisible(ScreenPtr pScreen) -+{ -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ switch (--pDRIPriv->nrWindowsVisible) { -+ case 0: -+ DRITransitionTo2d( pScreen ); -+ break; -+ case 1: -+ DRITransitionToPrivateBuffers( pScreen ); -+ break; -+ default: -+ break; -+ } -+ -+ DRIDriverClipNotify(pScreen); -+} -+ - Bool --DRICreateDrawable(ScreenPtr pScreen, Drawable id, -- DrawablePtr pDrawable, drm_drawable_t * hHWDrawable) -+DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, -+ drm_drawable_t * hHWDrawable) - { - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - DRIDrawablePrivPtr pDRIDrawablePriv; -@@ -1018,6 +1277,10 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id, - pWin = (WindowPtr)pDrawable; - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - pDRIDrawablePriv->refCount++; -+ -+ if (!pDRIDrawablePriv->hwDrawable) { -+ drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable); -+ } - } - else { - /* allocate a DRI Window Private record */ -@@ -1026,34 +1289,39 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id, - } - - /* Only create a drm_drawable_t once */ -- if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) { -+ if (drmCreateDrawable(pDRIPriv->drmFD, -+ &pDRIDrawablePriv->hwDrawable)) { - xfree(pDRIDrawablePriv); - return FALSE; - } - - /* add it to the list of DRI drawables for this screen */ -- pDRIDrawablePriv->hwDrawable = *hHWDrawable; - pDRIDrawablePriv->pScreen = pScreen; - pDRIDrawablePriv->refCount = 1; - pDRIDrawablePriv->drawableIndex = -1; -+ pDRIDrawablePriv->nrects = REGION_NUM_RECTS(&pWin->clipList); - - /* save private off of preallocated index */ - pWin->devPrivates[DRIWindowPrivIndex].ptr = - (pointer)pDRIDrawablePriv; - -- switch (++pDRIPriv->nrWindows) { -- case 1: -- DRITransitionTo3d( pScreen ); -- break; -- case 2: -- DRITransitionToSharedBuffers( pScreen ); -- break; -- default: -- break; -- } -+ pDRIPriv->nrWindows++; -+ -+ if (pDRIDrawablePriv->nrects) -+ DRIIncreaseNumberVisible(pScreen); -+ } - -- /* track this in case this window is destroyed */ -- AddResource(id, DRIDrawablePrivResType, (pointer)pWin); -+ /* track this in case the client dies */ -+ AddResource(FakeClientID(client->index), DRIDrawablePrivResType, -+ (pointer)pDrawable->id); -+ -+ if (pDRIDrawablePriv->hwDrawable) { -+ drmUpdateDrawableInfo(pDRIPriv->drmFD, -+ pDRIDrawablePriv->hwDrawable, -+ DRM_DRAWABLE_CLIPRECTS, -+ REGION_NUM_RECTS(&pWin->clipList), -+ REGION_RECTS(&pWin->clipList)); -+ *hHWDrawable = pDRIDrawablePriv->hwDrawable; - } - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ -@@ -1064,21 +1332,59 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id, - return TRUE; - } - --Bool --DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable) -+static void -+DRIDrawablePrivDestroy(WindowPtr pWin) - { -- DRIDrawablePrivPtr pDRIDrawablePriv; -- WindowPtr pWin; -+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); -+ ScreenPtr pScreen; -+ DRIScreenPrivPtr pDRIPriv; -+ -+ if (!pDRIDrawablePriv) -+ return; -+ -+ pScreen = pWin->drawable.pScreen; -+ pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ if (pDRIDrawablePriv->drawableIndex != -1) { -+ /* bump stamp to force outstanding 3D requests to resync */ -+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp -+ = DRIDrawableValidationStamp++; -+ -+ /* release drawable table entry */ -+ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; -+ } -+ -+ pDRIPriv->nrWindows--; - -+ if (pDRIDrawablePriv->nrects) -+ DRIDecreaseNumberVisible(pScreen); - -+ drmDestroyDrawable(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable); -+ -+ xfree(pDRIDrawablePriv); -+ pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; -+} -+ -+static Bool -+DRIDestroyDrawableCB(pointer value, XID id, pointer data) -+{ -+ if (value == data) { -+ /* This calls back DRIDrawablePrivDelete which frees private area */ -+ FreeResourceByType(id, DRIDrawablePrivResType, FALSE); -+ -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ -+Bool -+DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable) -+{ - if (pDrawable->type == DRAWABLE_WINDOW) { -- pWin = (WindowPtr)pDrawable; -- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); -- pDRIDrawablePriv->refCount--; -- if (pDRIDrawablePriv->refCount <= 0) { -- /* This calls back DRIDrawablePrivDelete which frees private area */ -- FreeResourceByType(id, DRIDrawablePrivResType, FALSE); -- } -+ LookupClientResourceComplex(client, DRIDrawablePrivResType, -+ DRIDestroyDrawableCB, -+ (pointer)pDrawable->id); - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ -@@ -1091,48 +1397,26 @@ DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable) - Bool - DRIDrawablePrivDelete(pointer pResource, XID id) - { -- DrawablePtr pDrawable = (DrawablePtr)pResource; -- DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); -- DRIDrawablePrivPtr pDRIDrawablePriv; -- WindowPtr pWin; -+ WindowPtr pWin; - -- if (pDrawable->type == DRAWABLE_WINDOW) { -- pWin = (WindowPtr)pDrawable; -- pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); -- -- if (pDRIDrawablePriv->drawableIndex != -1) { -- /* bump stamp to force outstanding 3D requests to resync */ -- pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp -- = DRIDrawableValidationStamp++; -+ id = (XID)pResource; -+ pWin = LookupIDByType(id, RT_WINDOW); - -- /* release drawable table entry */ -- pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL; -- } -+ if (pWin) { -+ DRIDrawablePrivPtr pDRIDrwPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); - -- if (drmDestroyDrawable(pDRIPriv->drmFD, -- pDRIDrawablePriv->hwDrawable)) { -+ if (!pDRIDrwPriv) - return FALSE; -- } -- xfree(pDRIDrawablePriv); -- pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; -- -- switch (--pDRIPriv->nrWindows) { -- case 0: -- DRITransitionTo2d( pDrawable->pScreen ); -- break; -- case 1: -- DRITransitionToPrivateBuffers( pDrawable->pScreen ); -- break; -- default: -- break; -- } -+ -+ if (--pDRIDrwPriv->refCount == 0) -+ DRIDrawablePrivDestroy(pWin); -+ -+ return TRUE; - } - else { /* pixmap (or for GLX 1.3, a PBuffer) */ - /* NOT_DONE */ - return FALSE; - } -- -- return TRUE; - } - - Bool -@@ -1263,7 +1547,7 @@ DRIGetDrawableInfo(ScreenPtr pScreen, - *backX = *X; - *backY = *Y; - -- if (pDRIPriv->nrWindows == 1 && *numClipRects) { -+ if (pDRIPriv->nrWindowsVisible == 1 && *numClipRects) { - /* Use a single cliprect. */ - - int x0 = *X; -@@ -1276,13 +1560,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen, - if (x1 > pScreen->width) x1 = pScreen->width; - if (y1 > pScreen->height) y1 = pScreen->height; - -- pDRIPriv->private_buffer_rect.x1 = x0; -- pDRIPriv->private_buffer_rect.y1 = y0; -- pDRIPriv->private_buffer_rect.x2 = x1; -- pDRIPriv->private_buffer_rect.y2 = y1; -- -- *numBackClipRects = 1; -- *pBackClipRects = &(pDRIPriv->private_buffer_rect); -+ if (y0 >= y1 || x0 >= x1) { -+ *numBackClipRects = 0; -+ *pBackClipRects = NULL; -+ } else { -+ pDRIPriv->private_buffer_rect.x1 = x0; -+ pDRIPriv->private_buffer_rect.y1 = y0; -+ pDRIPriv->private_buffer_rect.x2 = x1; -+ pDRIPriv->private_buffer_rect.y2 = y1; -+ -+ *numBackClipRects = 1; -+ *pBackClipRects = &(pDRIPriv->private_buffer_rect); -+ } - } else { - /* Use the frontbuffer cliprects for back buffers. */ - *numBackClipRects = 0; -@@ -1313,7 +1602,7 @@ DRIGetDeviceInfo(ScreenPtr pScreen, - { - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - -- *hFrameBuffer = pDRIPriv->hFrameBuffer; -+ *hFrameBuffer = pDRIPriv->pDriverInfo->hFrameBuffer; - *fbOrigin = 0; - *fbSize = pDRIPriv->pDriverInfo->frameBufferSize; - *fbStride = pDRIPriv->pDriverInfo->frameBufferStride; -@@ -1621,16 +1910,45 @@ DRITreeTraversal(WindowPtr pWin, pointer data) - if(pDRIDrawablePriv) { - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -- RegionPtr reg = (RegionPtr)data; - -- REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); -+ if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) { -+ RegionPtr reg = (RegionPtr)data; - -- if(pDRIPriv->nrWindows == 1) -+ REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); -+ pDRIPriv->nrWalked++; -+ } -+ -+ if(pDRIPriv->nrWindows == pDRIPriv->nrWalked) - return WT_STOPWALKING; - } - return WT_WALKCHILDREN; - } - -+Bool -+DRIDestroyWindow(WindowPtr pWin) -+{ -+ ScreenPtr pScreen = pWin->drawable.pScreen; -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ Bool retval = TRUE; -+ -+ DRIDrawablePrivDestroy(pWin); -+ -+ /* call lower wrapped functions */ -+ if(pDRIPriv->DestroyWindow) { -+ /* unwrap */ -+ pScreen->DestroyWindow = pDRIPriv->DestroyWindow; -+ -+ /* call lower layers */ -+ retval = (*pScreen->DestroyWindow)(pWin); -+ -+ /* rewrap */ -+ pDRIPriv->DestroyWindow = pScreen->DestroyWindow; -+ pScreen->DestroyWindow = DRIDestroyWindow; -+ } -+ -+ return retval; -+} -+ - void - DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) - { -@@ -1639,10 +1957,11 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) - - if(!pDRIPriv) return; - -- if(pDRIPriv->nrWindows > 0) { -+ if(pDRIPriv->nrWindowsVisible > 0) { - RegionRec reg; - - REGION_NULL(pScreen, ®); -+ pDRIPriv->nrWalked = 0; - TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); - - if(REGION_NOTEMPTY(pScreen, ®)) { -@@ -1831,14 +2150,28 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy) - if(!pDRIPriv) return; - - if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { -+ int nrects = REGION_NUM_RECTS(&pWin->clipList); - - if(!pDRIPriv->windowsTouched) { - DRILockTree(pScreen); - pDRIPriv->windowsTouched = TRUE; - } - -+ if (nrects && !pDRIDrawablePriv->nrects) -+ DRIIncreaseNumberVisible(pScreen); -+ else if (!nrects && pDRIDrawablePriv->nrects) -+ DRIDecreaseNumberVisible(pScreen); -+ else -+ DRIDriverClipNotify(pScreen); -+ -+ pDRIDrawablePriv->nrects = nrects; -+ - pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp - = DRIDrawableValidationStamp++; -+ -+ drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, -+ DRM_DRAWABLE_CLIPRECTS, -+ nrects, REGION_RECTS(&pWin->clipList)); - } - - /* call lower wrapped functions */ -@@ -1894,28 +2227,46 @@ void - DRILock(ScreenPtr pScreen, int flags) - { - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -- if(!pDRIPriv) return; - -- if (!pDRIPriv->lockRefCount) -- DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags); -- pDRIPriv->lockRefCount++; -+ if(!pDRIPriv || !pDRIPriv->pLockRefCount) return; -+ -+ if (!*pDRIPriv->pLockRefCount) { -+ DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext, flags); -+ *pDRIPriv->pLockingContext = pDRIPriv->myContext; -+ } else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) { -+ DRIDrvMsg(pScreen->myNum, X_ERROR, -+ "[DRI] Locking deadlock.\n" -+ "\tAlready locked with context %d,\n" -+ "\ttrying to lock with context %d.\n", -+ pDRIPriv->pLockingContext, -+ pDRIPriv->myContext); -+ } -+ (*pDRIPriv->pLockRefCount)++; - } - - void - DRIUnlock(ScreenPtr pScreen) - { - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -- if(!pDRIPriv) return; - -- if (pDRIPriv->lockRefCount > 0) { -- pDRIPriv->lockRefCount--; -- } -- else { -- ErrorF("DRIUnlock called when not locked\n"); -+ if(!pDRIPriv || !pDRIPriv->pLockRefCount) return; -+ -+ if (*pDRIPriv->pLockRefCount > 0) { -+ if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) { -+ DRIDrvMsg(pScreen->myNum, X_ERROR, -+ "[DRI] Unlocking inconsistency:\n" -+ "\tContext %d trying to unlock lock held by context %d\n", -+ pDRIPriv->pLockingContext, -+ pDRIPriv->myContext); -+ } -+ (*pDRIPriv->pLockRefCount)--; -+ } else { -+ DRIDrvMsg(pScreen->myNum, X_ERROR, -+ "DRIUnlock called when not locked.\n"); - return; - } -- if (!pDRIPriv->lockRefCount) -- DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext); -+ if (! *pDRIPriv->pLockRefCount) -+ DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext); - } - - void * -@@ -1936,6 +2287,19 @@ DRIGetContext(ScreenPtr pScreen) - return pDRIPriv->myContext; - } - -+void -+DRIGetTexOffsetFuncs(ScreenPtr pScreen, -+ DRITexOffsetStartProcPtr *texOffsetStartFunc, -+ DRITexOffsetFinishProcPtr *texOffsetFinishFunc) -+{ -+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); -+ -+ if (!pDRIPriv) return; -+ -+ *texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart; -+ *texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish; -+} -+ - /* This lets get at the unwrapped functions so that they can correctly - * call the lowerlevel functions, and choose whether they will be - * called at every level of recursion (eg in validatetree). -@@ -2097,8 +2461,8 @@ DRICreatePCIBusID(pciVideoPtr PciInfo) - - tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); - domain = xf86GetPciDomain(tag); -- snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus, -- PciInfo->device, PciInfo->func); -+ snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, -+ PCI_BUS_NO_DOMAIN(PciInfo->bus), PciInfo->device, PciInfo->func); - return busID; - } - -diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h -index dca0edd..98e8b75 100644 ---- a/hw/xfree86/dri/dri.h -+++ b/hw/xfree86/dri/dri.h -@@ -107,9 +107,12 @@ typedef struct { - */ - - #define DRIINFO_MAJOR_VERSION 5 --#define DRIINFO_MINOR_VERSION 0 -+#define DRIINFO_MINOR_VERSION 4 - #define DRIINFO_PATCH_VERSION 0 - -+typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix); -+typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix); -+ - typedef struct { - /* driver call back functions - * -@@ -173,9 +176,30 @@ typedef struct { - /* New with DRI version 4.1.0 */ - void (*TransitionSingleToMulti3D)(ScreenPtr pScreen); - void (*TransitionMultiToSingle3D)(ScreenPtr pScreen); -+ -+ /* New with DRI version 5.1.0 */ -+ void (*ClipNotify)(ScreenPtr pScreen, WindowPtr *ppWin, int num); -+ -+ /* New with DRI version 5.2.0 */ -+ Bool allocSarea; -+ Bool keepFDOpen; -+ -+ /* New with DRI version 5.3.0 */ -+ DRITexOffsetStartProcPtr texOffsetStart; -+ DRITexOffsetFinishProcPtr texOffsetFinish; -+ -+ /* New with DRI version 5.4.0 */ -+ int dontMapFrameBuffer; -+ drm_handle_t hFrameBuffer; /* Handle to framebuffer, either -+ * mapped by DDX driver or DRI */ -+ - } DRIInfoRec, *DRIInfoPtr; - - -+extern Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn, unsigned long sAreaSize, -+ const char *busID, -+ const char *drmDriverName); -+ - extern Bool DRIScreenInit(ScreenPtr pScreen, - DRIInfoPtr pDRIInfo, - int *pDRMFD); -@@ -213,12 +237,12 @@ extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context); - extern Bool DRIContextPrivDelete(pointer pResource, XID id); - - extern Bool DRICreateDrawable(ScreenPtr pScreen, -- Drawable id, -+ ClientPtr client, - DrawablePtr pDrawable, - drm_drawable_t * hHWDrawable); - - extern Bool DRIDestroyDrawable(ScreenPtr pScreen, -- Drawable id, -+ ClientPtr client, - DrawablePtr pDrawable); - - extern Bool DRIDrawablePrivDelete(pointer pResource, -@@ -281,6 +305,8 @@ extern void DRIWindowExposures(WindowPtr pWin, - RegionPtr prgn, - RegionPtr bsreg); - -+extern Bool DRIDestroyWindow(WindowPtr pWin); -+ - extern void DRICopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc); -@@ -341,6 +367,16 @@ extern char *DRICreatePCIBusID(pciVideoPtr PciInfo); - - extern int drmInstallSIGIOHandler(int fd, void (*f)(int, void *, void *)); - extern int drmRemoveSIGIOHandler(int fd); -+extern int DRIMasterFD(ScrnInfoPtr pScrn); -+ -+extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); -+ -+extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn); -+ -+extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen, -+ DRITexOffsetStartProcPtr *texOffsetStartFunc, -+ DRITexOffsetFinishProcPtr *texOffsetFinishFunc); -+ - #define _DRI_H_ - - #endif -diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c -index c437f0f..3aa9245 100644 ---- a/hw/xfree86/dri/drimodule.c -+++ b/hw/xfree86/dri/drimodule.c -@@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "xf86drm.h" - static MODULESETUPPROTO(driSetup); - --extern drmServerInfo DRIDRMServerInfo; -+drmServerInfo DRIDRMServerInfo; - - static XF86ModuleVersionInfo VersRec = - { -@@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin) - drmSetServerInfo(&DRIDRMServerInfo); - - /* Need a non-NULL return value to indicate success */ -- return 1; -+ return (pointer)1; - } - -diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h -index 340c59a..c3b0aee 100644 ---- a/hw/xfree86/dri/dristruct.h -+++ b/hw/xfree86/dri/dristruct.h -@@ -53,6 +53,7 @@ typedef struct _DRIDrawablePrivRec - int drawableIndex; - ScreenPtr pScreen; - int refCount; -+ int nrects; - } DRIDrawablePrivRec, *DRIDrawablePrivPtr; - - struct _DRIContextPrivRec -@@ -72,6 +73,11 @@ struct _DRIContextPrivRec - #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ - (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) - -+#define DRI_ENT_PRIV(pScrn) \ -+ ((DRIEntPrivIndex < 0) ? \ -+ NULL: \ -+ ((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \ -+ DRIEntPrivIndex)->ptr))) - - typedef struct _DRIScreenPrivRec - { -@@ -79,7 +85,6 @@ typedef struct _DRIScreenPrivRec - int drmFD; /* File descriptor for /dev/video/? */ - drm_handle_t hSAREA; /* Handle to SAREA, for mapping */ - XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */ -- drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */ - drm_context_t myContext; /* DDX Driver's context */ - DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */ - DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */ -@@ -87,10 +92,13 @@ typedef struct _DRIScreenPrivRec - void** partial3DContextStore; /* parital 3D context */ - DRIInfoPtr pDriverInfo; - int nrWindows; -+ int nrWindowsVisible; -+ int nrWalked; - drm_clip_rect_t private_buffer_rect; /* management of private buffers */ - DrawablePtr fullscreen; /* pointer to fullscreen drawable */ - drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */ - DRIWrappedFuncsRec wrap; -+ DestroyWindowProcPtr DestroyWindow; - DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES]; - DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */ - Bool createDummyCtx; -@@ -100,6 +108,25 @@ typedef struct _DRIScreenPrivRec - Bool wrapped; - Bool windowsTouched; - int lockRefCount; -+ drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */ -+ XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */ -+ int* pLockRefCount; -+ int* pLockingContext; - } DRIScreenPrivRec, *DRIScreenPrivPtr; - -+ -+typedef struct _DRIEntPrivRec { -+ int drmFD; -+ Bool drmOpened; -+ Bool sAreaGrabbed; -+ drm_handle_t hLSAREA; -+ XF86DRILSAREAPtr pLSAREA; -+ unsigned long sAreaSize; -+ int lockRefCount; -+ int lockingContext; -+ ScreenPtr resOwner; -+ Bool keepFDOpen; -+ int refCount; -+} DRIEntPrivRec, *DRIEntPrivPtr; -+ - #endif /* DRI_STRUCT_H */ -diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h -index a0d6084..1528cc1 100644 ---- a/hw/xfree86/dri/sarea.h -+++ b/hw/xfree86/dri/sarea.h -@@ -89,4 +89,9 @@ typedef struct _XF86DRISAREA { - drm_context_t dummy_context; - } XF86DRISAREARec, *XF86DRISAREAPtr; - -+typedef struct _XF86DRILSAREA { -+ drmLock lock; -+ drmLock otherLocks[31]; -+} XF86DRILSAREARec, *XF86DRILSAREAPtr; -+ - #endif -diff -up xorg-server-1.3.0.0/hw/xfree86/dri/xf86dri.c.newmesa xorg-server-1.3.0.0/hw/xfree86/dri/xf86dri.c ---- xorg-server-1.3.0.0/hw/xfree86/dri/xf86dri.c.newmesa 2006-09-18 16:04:18.000000000 +1000 -+++ xorg-server-1.3.0.0/hw/xfree86/dri/xf86dri.c 2007-08-13 09:05:10.000000000 +1000 -@@ -405,8 +405,7 @@ ProcXF86DRICreateDrawable( - return BadValue; - } - -- if (!DRICreateDrawable( screenInfo.screens[stuff->screen], -- (Drawable)stuff->drawable, -+ if (!DRICreateDrawable( screenInfo.screens[stuff->screen], client, - pDrawable, - (drm_drawable_t *)&rep.hHWDrawable)) { - return BadValue; -@@ -436,8 +435,7 @@ ProcXF86DRIDestroyDrawable( - return BadValue; - } - -- if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], -- (Drawable)stuff->drawable, -+ if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen], client, - pDrawable)) { - return BadValue; - } -@@ -453,7 +451,7 @@ ProcXF86DRIGetDrawableInfo( - xXF86DRIGetDrawableInfoReply rep; - DrawablePtr pDrawable; - int X, Y, W, H; -- drm_clip_rect_t * pClipRects; -+ drm_clip_rect_t * pClipRects, *pClippedRects; - drm_clip_rect_t * pBackClipRects; - int backX, backY; - -@@ -505,8 +503,35 @@ ProcXF86DRIGetDrawableInfo( - if (rep.numBackClipRects) - rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - -- if (rep.numClipRects) -+ pClippedRects = pClipRects; -+ -+ if (rep.numClipRects) { -+ /* Clip cliprects to screen dimensions (redirected windows) */ -+ pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t)); -+ -+ if (pClippedRects) { -+ ScreenPtr pScreen = screenInfo.screens[stuff->screen]; -+ int i, j; -+ -+ for (i = 0, j = 0; i < rep.numClipRects; i++) { -+ pClippedRects[j].x1 = max(pClipRects[i].x1, 0); -+ pClippedRects[j].y1 = max(pClipRects[i].y1, 0); -+ pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width); -+ pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height); -+ -+ if (pClippedRects[j].x1 < pClippedRects[j].x2 && -+ pClippedRects[j].y1 < pClippedRects[j].y2) { -+ j++; -+ } -+ } -+ -+ rep.numClipRects = j; -+ } else { -+ rep.numClipRects = 0; -+ } -+ - rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; -+ } - - rep.length = ((rep.length + 3) & ~3) >> 2; - -@@ -515,7 +540,8 @@ ProcXF86DRIGetDrawableInfo( - if (rep.numClipRects) { - WriteToClient(client, - sizeof(drm_clip_rect_t) * rep.numClipRects, -- (char *)pClipRects); -+ (char *)pClippedRects); -+ xfree(pClippedRects); - } - - if (rep.numBackClipRects) { ---- xorg-server-1.3.0.0.orig/hw/dmx/glxProxy/glxext.h 2006-09-18 16:04:17.000000000 +1000 -+++ xorg-server-1.3.0.0/hw/dmx/glxProxy/glxext.h 2007-08-11 13:46:37.000000000 +1000 -@@ -67,7 +67,7 @@ - - extern void __glXNoSuchRenderOpcode(GLbyte*); - extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*); --extern void __glXErrorCallBack(__GLinterface *gc, GLenum code); -+extern void __glXErrorCallBack(GLenum code); - extern void __glXClearErrorOccured(void); - extern GLboolean __glXErrorOccured(void); - extern void __glXResetLargeCommandStatus(__GLXclientState*); -diff -up xorg-server-1.3.0.0/hw/xfree86/dixmods/glxmodule.c.newmesa xorg-server-1.3.0.0/hw/xfree86/dixmods/glxmodule.c ---- xorg-server-1.3.0.0/hw/xfree86/dixmods/glxmodule.c.newmesa 2007-08-13 09:50:37.000000000 +1000 -+++ xorg-server-1.3.0.0/hw/xfree86/dixmods/glxmodule.c 2007-08-13 09:50:46.000000000 +1000 -@@ -95,7 +95,7 @@ __glXMesaProxyScreenProbe(ScreenPtr pScr - static __GLXprovider *provider; - - if (provider == NULL) { -- GLcore = LoadSubModuleLocal(glxModule, "GLcore", NULL, NULL, NULL, NULL, -+ GLcore = LoadSubModule(glxModule, "GLcore", NULL, NULL, NULL, NULL, - NULL, NULL); - if (GLcore == NULL) - return NULL; diff --git a/xserver-1.3.0-newglx-offscreen-pixmaps.patch b/xserver-1.3.0-newglx-offscreen-pixmaps.patch deleted file mode 100644 index eea2670..0000000 --- a/xserver-1.3.0-newglx-offscreen-pixmaps.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Add pixmap eviction for XAA. - -DRI drivers without zero-copy EXT_texture_from_pixmap need to copy the -texture image out of video memory to bind it. Ick. Add a hack to -evict XAA pixmaps and disable the pixmap cache when the first texture -is bound. - ---- -diff -up xorg-server-1.3.0.0/hw/xfree86/xaa/xaaInit.c.offscreen-pixmaps xorg-server-1.3.0.0/hw/xfree86/xaa/xaaInit.c ---- xorg-server-1.3.0.0/hw/xfree86/xaa/xaaInit.c.offscreen-pixmaps 2007-08-13 10:27:45.000000000 +1000 -+++ xorg-server-1.3.0.0/hw/xfree86/xaa/xaaInit.c 2007-08-13 10:28:35.000000000 +1000 -@@ -97,6 +97,30 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec) - xfree(infoRec); - } - -+void -+XAAEvictPixmaps(void) -+{ -+ XAAScreenPtr pScreenPriv; -+ XAAInfoRecPtr infoRec; -+ ScreenPtr pScreen; -+ int i; -+ -+ xf86MsgVerb(X_INFO, 3, "XAA: Evicting pixmaps\n"); -+ -+ for (i = 0; i < screenInfo.numScreens; i++) { -+ pScreen = screenInfo.screens[i]; -+ infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); -+ -+ pScreenPriv = pScreen->devPrivates[XAAScreenIndex].ptr; -+ infoRec = pScreenPriv->AccelInfoRec; -+ -+ infoRec->offscreenDepths = 0; -+ infoRec->Flags &= ~OFFSCREEN_PIXMAPS; -+ -+ XAAMoveOutOffscreenPixmaps(pScreen); -+ XAAInvalidatePixmapCache(pScreen); -+ } -+} - - Bool - XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) -diff -up xorg-server-1.3.0.0/GL/glx/glxdri.c.offscreen-pixmaps xorg-server-1.3.0.0/GL/glx/glxdri.c ---- xorg-server-1.3.0.0/GL/glx/glxdri.c.offscreen-pixmaps 2007-08-13 10:23:52.000000000 +1000 -+++ xorg-server-1.3.0.0/GL/glx/glxdri.c 2007-08-13 10:26:08.000000000 +1000 -@@ -380,6 +380,22 @@ __glXDRIbindTexImage(__GLXcontext *baseC - __GLXDRIscreen * const screen = - (__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum); - -+ if (!screen->texOffsetStart) { -+ /* When the GLX_EXT_texture_from_pixmap is used, as it's -+ * implemented here, we want to pull pixmap out of video memory -+ * and into host memory. */ -+ extern void XAAEvictPixmaps(void); -+ static int evictedPixmaps = 0; -+ -+ if (!evictedPixmaps) { -+ __glXDRIenterServer(GL_FALSE); -+ if (dlsym(RTLD_DEFAULT, "XAAEvictPixmaps")) -+ XAAEvictPixmaps(); -+ __glXDRIleaveServer(GL_FALSE); -+ evictedPixmaps = TRUE; -+ } -+ } -+ - pixmap = (PixmapPtr) glxPixmap->pDraw; - - if (screen->texOffsetStart && screen->driScreen.setTexOffset) { diff --git a/xserver-1.3.0-no-pseudocolor-composite.patch b/xserver-1.3.0-no-pseudocolor-composite.patch deleted file mode 100644 index 0e67a12..0000000 --- a/xserver-1.3.0-no-pseudocolor-composite.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Adam Jackson -Date: Sun, 28 Oct 2007 09:37:52 +0100 -Subject: [PATCH] Disable Composite on 8bpp displays. - ---- -diff --git a/composite/compext.c b/composite/compext.c -index 4c25cc7..af05b4a 100644 ---- a/composite/compext.c -+++ b/composite/compext.c -@@ -678,6 +678,25 @@ CompositeExtensionInit (void) - ExtensionEntry *extEntry; - int s; - -+ for (s = 0; s < screenInfo.numScreens; s++) { -+ ScreenPtr pScreen = screenInfo.screens[s]; -+ VisualPtr vis; -+ -+ /* Composite on 8bpp pseudocolor root windows appears to fail, so -+ * just disable it on anything pseudocolor for safety. -+ */ -+ for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++) -+ ; -+ if ((vis->class | DynamicClass) == PseudoColor) -+ return; -+ -+ /* Ensure that Render is initialized, which is required for automatic -+ * compositing. -+ */ -+ if (GetPictureScreenIfSet(pScreen) == NULL) -+ return; -+ } -+ - CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow); - if (!CompositeClientWindowType) - return; diff --git a/xserver-1.3.0-ramdac-export.patch b/xserver-1.3.0-ramdac-export.patch deleted file mode 100644 index 486312d..0000000 --- a/xserver-1.3.0-ramdac-export.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: Julien Cristau -Date: Wed, 30 May 2007 02:01:30 +0000 (-0400) -Subject: Make sure that the ramdac symbols are present in the server -X-Git-Url: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=3c6f1428489c1f71acd41066ea73ef4ae7c60f17 - -Make sure that the ramdac symbols are present in the server - -The former ramdac module is now built into the server, so its symbols need to -be explicitly exported to drivers (Debian #423129). ---- - ---- a/hw/xfree86/loader/xf86sym.c -+++ b/hw/xfree86/loader/xf86sym.c -@@ -96,6 +96,11 @@ - #endif - #include "xf86DDC.h" - #include "edid.h" -+#include "xf86Cursor.h" -+#include "xf86RamDac.h" -+#include "BT.h" -+#include "IBM.h" -+#include "TI.h" - - #ifndef HAS_GLIBC_SIGSETJMP - #if defined(setjmp) && defined(__GNU_LIBRARY__) && \ -@@ -1255,4 +1260,50 @@ _X_HIDDEN void *xfree86LookupTab[] = { - SYMFUNC(xf86I2CWriteRead) - SYMFUNC(xf86I2CWriteVec) - SYMFUNC(xf86I2CWriteWord) -+ -+ /* ramdac/xf86RamDac.c */ -+ SYMFUNC(RamDacCreateInfoRec) -+ SYMFUNC(RamDacHelperCreateInfoRec) -+ SYMFUNC(RamDacDestroyInfoRec) -+ SYMFUNC(RamDacHelperDestroyInfoRec) -+ SYMFUNC(RamDacInit) -+ SYMFUNC(RamDacHandleColormaps) -+ SYMFUNC(RamDacFreeRec) -+ SYMFUNC(RamDacGetHWIndex) -+ SYMVAR(RamDacHWPrivateIndex) -+ SYMVAR(RamDacScreenPrivateIndex) -+ -+ /* ramdac/xf86Cursor.c */ -+ SYMFUNC(xf86InitCursor) -+ SYMFUNC(xf86CreateCursorInfoRec) -+ SYMFUNC(xf86DestroyCursorInfoRec) -+ SYMFUNC(xf86ForceHWCursor) -+ -+ /* ramdac/BT.c */ -+ SYMFUNC(BTramdacProbe) -+ SYMFUNC(BTramdacSave) -+ SYMFUNC(BTramdacRestore) -+ SYMFUNC(BTramdacSetBpp) -+ -+ /* ramdac/IBM.c */ -+ SYMFUNC(IBMramdacProbe) -+ SYMFUNC(IBMramdacSave) -+ SYMFUNC(IBMramdacRestore) -+ SYMFUNC(IBMramdac526SetBpp) -+ SYMFUNC(IBMramdac640SetBpp) -+ SYMFUNC(IBMramdac526CalculateMNPCForClock) -+ SYMFUNC(IBMramdac640CalculateMNPCForClock) -+ SYMFUNC(IBMramdac526HWCursorInit) -+ SYMFUNC(IBMramdac640HWCursorInit) -+ SYMFUNC(IBMramdac526SetBppWeak) -+ -+ /* ramdac/TI.c */ -+ SYMFUNC(TIramdacCalculateMNPForClock) -+ SYMFUNC(TIramdacProbe) -+ SYMFUNC(TIramdacSave) -+ SYMFUNC(TIramdacRestore) -+ SYMFUNC(TIramdac3026SetBpp) -+ SYMFUNC(TIramdac3030SetBpp) -+ SYMFUNC(TIramdacHWCursorInit) -+ SYMFUNC(TIramdacLoadPalette) - }; diff --git a/xserver-1.3.0-randr-preferred-mode-fix.patch b/xserver-1.3.0-randr-preferred-mode-fix.patch deleted file mode 100644 index b5baf63..0000000 --- a/xserver-1.3.0-randr-preferred-mode-fix.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c.jx xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c ---- xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c.jx 2007-10-03 13:10:28.000000000 -0400 -+++ xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c 2007-10-05 09:58:11.000000000 -0400 -@@ -1420,6 +1420,9 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, - { - if (!strcmp (preferred_mode, mode->name)) - { -+ DisplayModePtr m; -+ -+ /* Sort it to the front of the list */ - if (mode != output->probed_modes) - { - if (mode->prev) -@@ -1431,10 +1434,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, - mode->prev = NULL; - output->probed_modes = mode; - } -+ -+ /* Mark it preferred */ - mode->type |= M_T_PREFERRED; -+ -+ /* And unprefer everything else */ -+ for (m = output->probed_modes; m; m = m->next) -+ if (m != mode) -+ m->type &= ~M_T_PREFERRED; -+ -+ break; - } -- else -- mode->type &= ~M_T_PREFERRED; - } - } - diff --git a/xserver-1.3.0-randr-updates.patch b/xserver-1.3.0-randr-updates.patch deleted file mode 100644 index 20f01be..0000000 --- a/xserver-1.3.0-randr-updates.patch +++ /dev/null @@ -1,3726 +0,0 @@ -diff --git a/hw/xfree86/modes/Makefile.am b/hw/xfree86/modes/Makefile.am -index 0841a6d..1f82068 100644 ---- a/hw/xfree86/modes/Makefile.am -+++ b/hw/xfree86/modes/Makefile.am -@@ -26,4 +26,4 @@ sdk_HEADERS = \ - xf86RandR12.h \ - xf86Rename.h - --AM_CFLAGS = $(XORG_CFLAGS) -+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index 2d8a7ad..064ff16 100644 ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -45,13 +45,15 @@ - #include "picturestr.h" - #endif - -+#include "xf86xv.h" -+ - /* - * Initialize xf86CrtcConfig structure - */ - - int xf86CrtcConfigPrivateIndex = -1; - --void -+_X_EXPORT void - xf86CrtcConfigInit (ScrnInfoPtr scrn, - const xf86CrtcConfigFuncsRec *funcs) - { -@@ -66,7 +68,7 @@ xf86CrtcConfigInit (ScrnInfoPtr scrn, - scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; - } - --void -+_X_EXPORT void - xf86CrtcSetSizeRange (ScrnInfoPtr scrn, - int minWidth, int minHeight, - int maxWidth, int maxHeight) -@@ -82,7 +84,7 @@ xf86CrtcSetSizeRange (ScrnInfoPtr scrn, - /* - * Crtc functions - */ --xf86CrtcPtr -+_X_EXPORT xf86CrtcPtr - xf86CrtcCreate (ScrnInfoPtr scrn, - const xf86CrtcFuncsRec *funcs) - { -@@ -114,7 +116,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn, - return crtc; - } - --void -+_X_EXPORT void - xf86CrtcDestroy (xf86CrtcPtr crtc) - { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); -@@ -126,7 +128,7 @@ xf86CrtcDestroy (xf86CrtcPtr crtc) - { - memmove (&xf86_config->crtc[c], - &xf86_config->crtc[c+1], -- xf86_config->num_crtc - (c + 1)); -+ ((xf86_config->num_crtc - (c + 1)) * sizeof(void*))); - xf86_config->num_crtc--; - break; - } -@@ -138,7 +140,7 @@ xf86CrtcDestroy (xf86CrtcPtr crtc) - * Return whether any outputs are connected to the specified pipe - */ - --Bool -+_X_EXPORT Bool - xf86CrtcInUse (xf86CrtcPtr crtc) - { - ScrnInfoPtr pScrn = crtc->scrn; -@@ -151,7 +153,7 @@ xf86CrtcInUse (xf86CrtcPtr crtc) - return FALSE; - } - --void -+_X_EXPORT void - xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) - { - #ifdef RENDER -@@ -219,7 +221,7 @@ xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) - /** - * Sets the given video mode on the given crtc - */ --Bool -+_X_EXPORT Bool - xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, - int x, int y) - { -@@ -377,6 +379,15 @@ static OptionInfoRec xf86OutputOptions[] = { - {-1, NULL, OPTV_NONE, {0}, FALSE }, - }; - -+enum { -+ OPTION_MODEDEBUG, -+}; -+ -+static OptionInfoRec xf86DeviceOptions[] = { -+ {OPTION_MODEDEBUG, "ModeDebug", OPTV_STRING, {0}, FALSE }, -+ {-1, NULL, OPTV_NONE, {0}, FALSE }, -+}; -+ - static void - xf86OutputSetMonitor (xf86OutputPtr output) - { -@@ -481,7 +492,7 @@ xf86OutputInitialRotation (xf86OutputPtr output) - return RR_Rotate_0; - } - --xf86OutputPtr -+_X_EXPORT xf86OutputPtr - xf86OutputCreate (ScrnInfoPtr scrn, - const xf86OutputFuncsRec *funcs, - const char *name) -@@ -541,7 +552,7 @@ xf86OutputCreate (ScrnInfoPtr scrn, - return output; - } - --Bool -+_X_EXPORT Bool - xf86OutputRename (xf86OutputPtr output, const char *name) - { - int len = strlen(name) + 1; -@@ -560,7 +571,7 @@ xf86OutputRename (xf86OutputPtr output, const char *name) - return TRUE; - } - --void -+_X_EXPORT void - xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) - { - if (use_screen_monitor != output->use_screen_monitor) -@@ -570,7 +581,7 @@ xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) - } - } - --void -+_X_EXPORT void - xf86OutputDestroy (xf86OutputPtr output) - { - ScrnInfoPtr scrn = output->scrn; -@@ -585,7 +596,7 @@ xf86OutputDestroy (xf86OutputPtr output) - { - memmove (&xf86_config->output[o], - &xf86_config->output[o+1], -- xf86_config->num_output - (o + 1)); -+ ((xf86_config->num_output - (o + 1)) * sizeof(void*))); - xf86_config->num_output--; - break; - } -@@ -646,7 +657,7 @@ xf86CrtcCloseScreen (int index, ScreenPtr screen) - /* - * Called at ScreenInit time to set up - */ --Bool -+_X_EXPORT Bool - xf86CrtcScreenInit (ScreenPtr screen) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; -@@ -667,7 +678,8 @@ xf86CrtcScreenInit (ScreenPtr screen) - } - if (c == config->num_crtc) - xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | -- RR_Rotate_180 | RR_Rotate_270); -+ RR_Rotate_180 | RR_Rotate_270 | -+ RR_Reflect_X | RR_Reflect_Y); - else - xf86RandR12SetRotations (screen, RR_Rotate_0); - -@@ -1202,16 +1214,21 @@ xf86SortModes (DisplayModePtr input) - return output; - } - --#define DEBUG_REPROBE 1 -- --void -+_X_EXPORT void - xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - -- if (maxX == 0 || maxY == 0) -- xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY); -+ /* When canGrow was TRUE in the initial configuration we have to -+ * compare against the maximum values so that we don't drop modes. -+ * When canGrow was FALSE, the maximum values would have been clamped -+ * anyway. -+ */ -+ if (maxX == 0 || maxY == 0) { -+ maxX = config->maxWidth; -+ maxY = config->maxHeight; -+ } - - /* Elide duplicate modes before defaulting code uses them */ - xf86PruneDuplicateMonitorModes (scrn->monitor); -@@ -1239,7 +1256,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - */ - output->status = (*output->funcs->detect)(output); - -- if (!xf86OutputEnabled (output)) -+ if (output->status == XF86OutputStatusDisconnected) - { - xf86OutputSetEDID (output, NULL); - continue; -@@ -1372,7 +1389,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - if (mode->status == MODE_OK) - mode->status = (*output->funcs->mode_valid)(output, mode); - -- xf86PruneInvalidModes(scrn, &output->probed_modes, TRUE); -+ xf86PruneInvalidModes(scrn, &output->probed_modes, -+ config->debug_modes); - - output->probed_modes = xf86SortModes (output->probed_modes); - -@@ -1398,24 +1416,25 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - output->probed_modes = mode; - } - mode->type |= M_T_PREFERRED; -- break; - } -+ else -+ mode->type &= ~M_T_PREFERRED; - } - } - - output->initial_rotation = xf86OutputInitialRotation (output); - --#ifdef DEBUG_REPROBE -- if (output->probed_modes != NULL) { -- xf86DrvMsg(scrn->scrnIndex, X_INFO, -- "Printing probed modes for output %s\n", -- output->name); -- } else { -- xf86DrvMsg(scrn->scrnIndex, X_INFO, -- "No remaining probed modes for output %s\n", -- output->name); -+ if (config->debug_modes) { -+ if (output->probed_modes != NULL) { -+ xf86DrvMsg(scrn->scrnIndex, X_INFO, -+ "Printing probed modes for output %s\n", -+ output->name); -+ } else { -+ xf86DrvMsg(scrn->scrnIndex, X_INFO, -+ "No remaining probed modes for output %s\n", -+ output->name); -+ } - } --#endif - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - { - /* The code to choose the best mode per pipe later on will require -@@ -1424,9 +1443,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - mode->VRefresh = xf86ModeVRefresh(mode); - xf86SetModeCrtc(mode, INTERLACE_HALVE_V); - --#ifdef DEBUG_REPROBE -- xf86PrintModeline(scrn->scrnIndex, mode); --#endif -+ if (config->debug_modes) -+ xf86PrintModeline(scrn->scrnIndex, mode); - } - } - } -@@ -1437,10 +1455,10 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) - */ - - /* XXX where does this function belong? Here? */ --void -+_X_EXPORT void - xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); - --void -+_X_EXPORT void - xf86SetScrnInfoModes (ScrnInfoPtr scrn) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); -@@ -1508,7 +1526,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn) - * accordingly. - */ - --Bool -+_X_EXPORT Bool - xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); -@@ -1521,6 +1539,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) - int width; - int height; - -+ /* Set up the device options */ -+ config->options = xnfalloc (sizeof (xf86DeviceOptions)); -+ memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); -+ xf86ProcessOptions (scrn->scrnIndex, -+ scrn->options, -+ config->options); -+ config->debug_modes = xf86ReturnOptValBool (config->options, -+ OPTION_MODEDEBUG, TRUE); -+ - if (scrn->display->virtualX) - width = scrn->display->virtualX; - else -@@ -1703,12 +1730,30 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) - * modes (used in EnterVT functions, or at server startup) - */ - --Bool -+_X_EXPORT Bool - xf86SetDesiredModes (ScrnInfoPtr scrn) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); -- int c; -+ int c, o; - -+ /* -+ * Turn off everything so mode setting is done -+ * with hardware in a consistent state -+ */ -+ for (o = 0; o < config->num_output; o++) -+ { -+ xf86OutputPtr output = config->output[o]; -+ (*output->funcs->dpms)(output, DPMSModeOff); -+ } -+ -+ for (c = 0; c < config->num_crtc; c++) -+ { -+ xf86CrtcPtr crtc = config->crtc[c]; -+ -+ crtc->funcs->dpms(crtc, DPMSModeOff); -+ memset(&crtc->mode, 0, sizeof(crtc->mode)); -+ } -+ - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; -@@ -1765,7 +1810,7 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) - * - Closer in refresh rate to the requested mode. - */ - --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) - { - DisplayModePtr best = NULL, scan = NULL; -@@ -1828,7 +1873,7 @@ xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) - * mode across all outputs that are currently active. - */ - --Bool -+_X_EXPORT Bool - xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); -@@ -1900,7 +1945,7 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) - * If the new mode is off, it will turn off outputs and then CRTCs. - * Otherwise, it will affect CRTCs before outputs. - */ --void -+_X_EXPORT void - xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) - { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); -@@ -1938,7 +1983,7 @@ xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) - * Even for monitors with no DPMS support, by the definition of our DPMS hooks, - * the outputs will still get disabled (blanked). - */ --Bool -+_X_EXPORT Bool - xf86SaveScreen(ScreenPtr pScreen, int mode) - { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -@@ -1954,7 +1999,7 @@ xf86SaveScreen(ScreenPtr pScreen, int mode) - /** - * Disable all inactive crtcs and outputs - */ --void -+_X_EXPORT void - xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) - { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); -@@ -1989,7 +2034,7 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) - static void - xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len) - { -- Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME), TRUE); -+ Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE); - - /* This may get called before the RandR resources have been created */ - if (output->randr_output == NULL) -@@ -2008,7 +2053,7 @@ xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len) - /** - * Set the EDID information for the specified output - */ --void -+_X_EXPORT void - xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) - { - ScrnInfoPtr scrn = output->scrn; -@@ -2023,10 +2068,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) - - output->MonInfo = edid_mon; - -- /* Debug info for now, at least */ -- xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); -- xf86PrintEDID(edid_mon); -- -+ if (config->debug_modes) { -+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", -+ output->name); -+ xf86PrintEDID(edid_mon); -+ } -+ - /* Set the DDC properties for the 'compat' output */ - if (output == config->output[config->compat_output]) - xf86SetDDCproperties(scrn, edid_mon); -@@ -2072,7 +2119,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) - * Return the list of modes supported by the EDID information - * stored in 'output' - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86OutputGetEDIDModes (xf86OutputPtr output) - { - ScrnInfoPtr scrn = output->scrn; -@@ -2083,7 +2130,7 @@ xf86OutputGetEDIDModes (xf86OutputPtr output) - return xf86DDCGetModes(scrn->scrnIndex, edid_mon); - } - --xf86MonPtr -+_X_EXPORT xf86MonPtr - xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) - { - ScrnInfoPtr scrn = output->scrn; -@@ -2094,8 +2141,127 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) - static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", - "DVI-A", "Composite", "S-Video", - "Component", "LFP", "Proprietary" }; --char * -+_X_EXPORT char * - xf86ConnectorGetName(xf86ConnectorType connector) - { - return _xf86ConnectorNames[connector]; - } -+ -+static void -+x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) -+{ -+ dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; -+ dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; -+ dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; -+ dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; -+ -+ if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) -+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; -+} -+ -+static void -+x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) -+{ -+ if (crtc->enabled) { -+ crtc_box->x1 = crtc->x; -+ crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); -+ crtc_box->y1 = crtc->y; -+ crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); -+ } else -+ crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; -+} -+ -+static int -+xf86_crtc_box_area(BoxPtr box) -+{ -+ return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); -+} -+ -+/* -+ * Return the crtc covering 'box'. If two crtcs cover a portion of -+ * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc -+ * with greater coverage -+ */ -+ -+static xf86CrtcPtr -+xf86_covering_crtc(ScrnInfoPtr pScrn, -+ BoxPtr box, -+ xf86CrtcPtr desired, -+ BoxPtr crtc_box_ret) -+{ -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); -+ xf86CrtcPtr crtc, best_crtc; -+ int coverage, best_coverage; -+ int c; -+ BoxRec crtc_box, cover_box; -+ -+ best_crtc = NULL; -+ best_coverage = 0; -+ crtc_box_ret->x1 = 0; -+ crtc_box_ret->x2 = 0; -+ crtc_box_ret->y1 = 0; -+ crtc_box_ret->y2 = 0; -+ for (c = 0; c < xf86_config->num_crtc; c++) { -+ crtc = xf86_config->crtc[c]; -+ x86_crtc_box(crtc, &crtc_box); -+ x86_crtc_box_intersect(&cover_box, &crtc_box, box); -+ coverage = xf86_crtc_box_area(&cover_box); -+ if (coverage && crtc == desired) { -+ *crtc_box_ret = crtc_box; -+ return crtc; -+ } else if (coverage > best_coverage) { -+ *crtc_box_ret = crtc_box; -+ best_crtc = crtc; -+ best_coverage = coverage; -+ } -+ } -+ return best_crtc; -+} -+ -+/* -+ * For overlay video, compute the relevant CRTC and -+ * clip video to that. -+ * -+ * returning FALSE means there was a memory failure of some kind, -+ * not that the video shouldn't be displayed -+ */ -+ -+_X_EXPORT Bool -+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, -+ xf86CrtcPtr *crtc_ret, -+ xf86CrtcPtr desired_crtc, -+ BoxPtr dst, -+ INT32 *xa, -+ INT32 *xb, -+ INT32 *ya, -+ INT32 *yb, -+ RegionPtr reg, -+ INT32 width, -+ INT32 height) -+{ -+ Bool ret; -+ RegionRec crtc_region_local; -+ RegionPtr crtc_region = reg; -+ -+ if (crtc_ret) { -+ BoxRec crtc_box; -+ xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, -+ desired_crtc, -+ &crtc_box); -+ -+ if (crtc) { -+ REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1); -+ crtc_region = &crtc_region_local; -+ REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg); -+ } -+ *crtc_ret = crtc; -+ } -+ -+ ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, -+ crtc_region, width, height); -+ -+ if (crtc_region != reg) -+ REGION_UNINIT (pScreen, &crtc_region_local); -+ -+ return ret; -+} -diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h -index e64ce1e..9693e12 100644 ---- a/hw/xfree86/modes/xf86Crtc.h -+++ b/hw/xfree86/modes/xf86Crtc.h -@@ -30,6 +30,7 @@ - #include "xf86Modes.h" - #include "xf86Cursor.h" - #include "damage.h" -+#include "picturestr.h" - - /* Compat definitions for older X Servers. */ - #ifndef M_T_PREFERRED -@@ -279,6 +280,17 @@ struct _xf86Crtc { - * Track state of cursor associated with this CRTC - */ - Bool cursor_shown; -+ -+ /** -+ * Current transformation matrix -+ */ -+ PictTransform crtc_to_framebuffer; -+ PictTransform framebuffer_to_crtc; -+ Bool transform_in_use; -+ /** -+ * Bounding box in screen space -+ */ -+ BoxRec bounds; - }; - - typedef struct _xf86OutputFuncs { -@@ -555,6 +567,17 @@ typedef struct _xf86CrtcConfig { - CARD8 *cursor_image; - Bool cursor_on; - CARD32 cursor_fg, cursor_bg; -+ -+ /** -+ * Options parsed from the related device section -+ */ -+ OptionInfoPtr options; -+ -+ Bool debug_modes; -+ -+ /* wrap screen BlockHandler for rotation */ -+ ScreenBlockHandlerProcPtr BlockHandler; -+ - } xf86CrtcConfigRec, *xf86CrtcConfigPtr; - - extern int xf86CrtcConfigPrivateIndex; -@@ -742,5 +765,24 @@ xf86_hide_cursors (ScrnInfoPtr scrn); - */ - void - xf86_cursors_fini (ScreenPtr screen); -+ -+/* -+ * For overlay video, compute the relevant CRTC and -+ * clip video to that. -+ * wraps xf86XVClipVideoHelper() -+ */ -+ -+Bool -+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, -+ xf86CrtcPtr *crtc_ret, -+ xf86CrtcPtr desired_crtc, -+ BoxPtr dst, -+ INT32 *xa, -+ INT32 *xb, -+ INT32 *ya, -+ INT32 *yb, -+ RegionPtr reg, -+ INT32 width, -+ INT32 height); - - #endif /* _XF86CRTC_H_ */ -diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c -index 009cccf..b510164 100644 ---- a/hw/xfree86/modes/xf86Cursors.c -+++ b/hw/xfree86/modes/xf86Cursors.c -@@ -58,29 +58,73 @@ xf86_crtc_rotate_coord (Rotation rotation, - int *x_src, - int *y_src) - { -+ int t; -+ -+ switch (rotation & 0xf) { -+ case RR_Rotate_0: -+ break; -+ case RR_Rotate_90: -+ t = x_dst; -+ x_dst = height - y_dst - 1; -+ y_dst = t; -+ break; -+ case RR_Rotate_180: -+ x_dst = width - x_dst - 1; -+ y_dst = height - y_dst - 1; -+ break; -+ case RR_Rotate_270: -+ t = x_dst; -+ x_dst = y_dst; -+ y_dst = width - t - 1; -+ break; -+ } - if (rotation & RR_Reflect_X) - x_dst = width - x_dst - 1; - if (rotation & RR_Reflect_Y) - y_dst = height - y_dst - 1; -+ *x_src = x_dst; -+ *y_src = y_dst; -+} -+ -+/* -+ * Given a cursor source coordinate, rotate to a screen coordinate -+ */ -+static void -+xf86_crtc_rotate_coord_back (Rotation rotation, -+ int width, -+ int height, -+ int x_dst, -+ int y_dst, -+ int *x_src, -+ int *y_src) -+{ -+ int t; - -+ if (rotation & RR_Reflect_X) -+ x_dst = width - x_dst - 1; -+ if (rotation & RR_Reflect_Y) -+ y_dst = height - y_dst - 1; -+ - switch (rotation & 0xf) { - case RR_Rotate_0: -- *x_src = x_dst; -- *y_src = y_dst; - break; - case RR_Rotate_90: -- *x_src = height - y_dst - 1; -- *y_src = x_dst; -+ t = x_dst; -+ x_dst = y_dst; -+ y_dst = width - t - 1; - break; - case RR_Rotate_180: -- *x_src = width - x_dst - 1; -- *y_src = height - y_dst - 1; -+ x_dst = width - x_dst - 1; -+ y_dst = height - y_dst - 1; - break; - case RR_Rotate_270: -- *x_src = y_dst; -- *y_src = width - x_dst - 1; -+ t = x_dst; -+ x_dst = height - y_dst - 1; -+ y_dst = t; - break; - } -+ *x_src = x_dst; -+ *y_src = y_dst; - } - - /* -@@ -212,7 +256,7 @@ xf86_crtc_hide_cursor (xf86CrtcPtr crtc) - } - } - --void -+_X_EXPORT void - xf86_hide_cursors (ScrnInfoPtr scrn) - { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); -@@ -238,7 +282,7 @@ xf86_crtc_show_cursor (xf86CrtcPtr crtc) - } - } - --void -+_X_EXPORT void - xf86_show_cursors (ScrnInfoPtr scrn) - { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); -@@ -261,49 +305,33 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; - DisplayModePtr mode = &crtc->mode; -- int x_temp; -- int y_temp; - Bool in_range; -+ int dx, dy; - -- /* -- * Move to crtc coordinate space -- */ -- x -= crtc->x; -- y -= crtc->y; -- - /* -- * Rotate -+ * Transform position of cursor on screen - */ -- switch ((crtc->rotation) & 0xf) { -- case RR_Rotate_0: -- break; -- case RR_Rotate_90: -- x_temp = y; -- y_temp = mode->VDisplay - cursor_info->MaxWidth - x; -- x = x_temp; -- y = y_temp; -- break; -- case RR_Rotate_180: -- x_temp = mode->HDisplay - cursor_info->MaxWidth - x; -- y_temp = mode->VDisplay - cursor_info->MaxHeight - y; -- x = x_temp; -- y = y_temp; -- break; -- case RR_Rotate_270: -- x_temp = mode->HDisplay - cursor_info->MaxHeight - y; -- y_temp = x; -- x = x_temp; -- y = y_temp; -- break; -+ if (crtc->transform_in_use) -+ { -+ PictVector v; -+ v.vector[0] = IntToxFixed (x); v.vector[1] = IntToxFixed (y); v.vector[2] = IntToxFixed(1); -+ PictureTransformPoint (&crtc->framebuffer_to_crtc, &v); -+ x = xFixedToInt (v.vector[0]); y = xFixedToInt (v.vector[1]); -+ } -+ else -+ { -+ x -= crtc->x; -+ y -= crtc->y; - } -- - /* -- * Reflect -+ * Transform position of cursor upper left corner - */ -- if (crtc->rotation & RR_Reflect_X) -- x = mode->HDisplay - cursor_info->MaxWidth - x; -- if (crtc->rotation & RR_Reflect_Y) -- y = mode->VDisplay - cursor_info->MaxHeight - y; -+ xf86_crtc_rotate_coord_back (crtc->rotation, -+ cursor_info->MaxWidth, -+ cursor_info->MaxHeight, -+ 0, 0, &dx, &dy); -+ x -= dx; -+ y -= dy; - - /* - * Disable the cursor when it is outside the viewport -@@ -419,7 +447,10 @@ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; - -+ if (xf86_config->cursor) -+ FreeCursor (xf86_config->cursor, None); - xf86_config->cursor = cursor; -+ ++cursor->refcnt; - - if (cursor->bits->width > cursor_info->MaxWidth || - cursor->bits->height> cursor_info->MaxHeight) -@@ -435,7 +466,10 @@ xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; - -+ if (xf86_config->cursor) -+ FreeCursor (xf86_config->cursor, None); - xf86_config->cursor = cursor; -+ ++cursor->refcnt; - - /* Make sure ARGB support is available */ - if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0) -@@ -494,7 +528,7 @@ xf86_load_cursor_argb (ScrnInfoPtr scrn, CursorPtr cursor) - } - } - --Bool -+_X_EXPORT Bool - xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; -@@ -545,7 +579,7 @@ xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) - * Reloads cursor images as needed, then adjusts cursor positions - */ - --void -+_X_EXPORT void - xf86_reload_cursors (ScreenPtr screen) - { - ScrnInfoPtr scrn; -@@ -588,7 +622,7 @@ xf86_reload_cursors (ScreenPtr screen) - /** - * Clean up CRTC-based cursor code - */ --void -+_X_EXPORT void - xf86_cursors_fini (ScreenPtr screen) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; -@@ -604,4 +638,9 @@ xf86_cursors_fini (ScreenPtr screen) - xfree (xf86_config->cursor_image); - xf86_config->cursor_image = NULL; - } -+ if (xf86_config->cursor) -+ { -+ FreeCursor (xf86_config->cursor, None); -+ xf86_config->cursor = NULL; -+ } - } -diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c -index 0964cef..f40d0ab 100644 ---- a/hw/xfree86/modes/xf86DiDGA.c -+++ b/hw/xfree86/modes/xf86DiDGA.c -@@ -255,7 +255,7 @@ static DGAFunctionRec xf86_dga_funcs = { - NULL - }; - --Bool -+_X_EXPORT Bool - xf86DiDGAReInit (ScreenPtr pScreen) - { - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; -@@ -267,7 +267,7 @@ xf86DiDGAReInit (ScreenPtr pScreen) - return DGAReInitModes (pScreen, xf86_config->dga_modes, xf86_config->dga_nmode); - } - --Bool -+_X_EXPORT Bool - xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address) - { - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; -diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c -index edcd636..8b5e69d 100644 ---- a/hw/xfree86/modes/xf86EdidModes.c -+++ b/hw/xfree86/modes/xf86EdidModes.c -@@ -22,8 +22,9 @@ - */ - - /** -- * @file This is a copy of edid_modes.c from the X Server, for compatibility -- * with old X Servers. -+ * @file This file covers code to convert a xf86MonPtr containing EDID-probed -+ * information into a list of modes, including applying monitor-specific -+ * quirks to fix broken EDID data. - */ - #ifdef HAVE_XORG_CONFIG_H - #include -@@ -49,32 +50,12 @@ - - typedef enum { - DDC_QUIRK_NONE = 0, -- /* Force detailed sync polarity to -h +v */ -- DDC_QUIRK_DT_SYNC_HM_VP = 1 << 0, - /* First detailed mode is bogus, prefer largest mode at 60hz */ -- DDC_QUIRK_PREFER_LARGE_60 = 1 << 1, -+ DDC_QUIRK_PREFER_LARGE_60 = 1 << 0, - /* 135MHz clock is too high, drop a bit */ -- DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 2 -+ DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1, - } ddc_quirk_t; - --static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC) --{ -- /* Belinea 1924S1W */ -- if (memcmp (DDC->vendor.name, "MAX", 4) == 0 && -- DDC->vendor.prod_id == 1932) -- return TRUE; -- /* Belinea 10 20 30W */ -- if (memcmp (DDC->vendor.name, "MAX", 4) == 0 && -- DDC->vendor.prod_id == 2007) -- return TRUE; -- /* ViewSonic VX2025wm (bug #9941) */ -- if (memcmp (DDC->vendor.name, "VSC", 4) == 0 && -- DDC->vendor.prod_id == 58653) -- return TRUE; -- -- return FALSE; --} -- - static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC) - { - /* Belinea 10 15 55 */ -@@ -87,11 +68,16 @@ static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC) - DDC->vendor.prod_id == 44358) - return TRUE; - -- /* Samsung SyncMaster 226BW */ -+ /* Bug #10814: Samsung SyncMaster 225BW */ -+ if (memcmp (DDC->vendor.name, "SAM", 4) == 0 && -+ DDC->vendor.prod_id == 596) -+ return TRUE; -+ -+ /* Bug #10545: Samsung SyncMaster 226BW */ - if (memcmp (DDC->vendor.name, "SAM", 4) == 0 && - DDC->vendor.prod_id == 638) - return TRUE; -- -+ - return FALSE; - } - -@@ -112,10 +98,6 @@ typedef struct { - } ddc_quirk_map_t; - - static const ddc_quirk_map_t ddc_quirks[] = { -- { -- quirk_dt_sync_hm_vp, DDC_QUIRK_DT_SYNC_HM_VP, -- "Set detailed timing sync polarity to -h +v" -- }, - { - quirk_prefer_large_60, DDC_QUIRK_PREFER_LARGE_60, - "Detailed timing is not preferred, use largest mode at 60Hz" -@@ -207,6 +189,19 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, - { - DisplayModePtr Mode; - -+ /* -+ * Refuse to create modes that are insufficiently large. 64 is a random -+ * number, maybe the spec says something about what the minimum is. In -+ * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe -+ * our parser is just being too aggresive there. -+ */ -+ if (timing->h_active < 64 || timing->v_active < 64) { -+ xf86DrvMsg(scrnIndex, X_INFO, -+ "%s: Ignoring tiny %dx%d mode\n", __func__, -+ timing->h_active, timing->v_active); -+ return NULL; -+ } -+ - /* We don't do stereo */ - if (timing->stereo) { - xf86DrvMsg(scrnIndex, X_INFO, -@@ -251,25 +246,64 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, - if (timing->interlaced) - Mode->Flags |= V_INTERLACE; - -- if (quirks & DDC_QUIRK_DT_SYNC_HM_VP) -- Mode->Flags |= V_NHSYNC | V_PVSYNC; -+ if (timing->misc & 0x02) -+ Mode->Flags |= V_PVSYNC; - else -- { -- if (timing->misc & 0x02) -- Mode->Flags |= V_PHSYNC; -- else -- Mode->Flags |= V_NHSYNC; -- -- if (timing->misc & 0x01) -- Mode->Flags |= V_PVSYNC; -- else -- Mode->Flags |= V_NVSYNC; -- } -+ Mode->Flags |= V_NVSYNC; -+ -+ if (timing->misc & 0x01) -+ Mode->Flags |= V_PHSYNC; -+ else -+ Mode->Flags |= V_NHSYNC; - - return Mode; - } - --DisplayModePtr -+/* -+ * -+ */ -+static void -+DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) -+{ -+ DisplayModePtr Mode = Modes; -+ -+ if (!Monitor || !Modes) -+ return; -+ -+ /* set up the ranges for scanning through the modes */ -+ Monitor->nHsync = 1; -+ Monitor->hsync[0].lo = 1024.0; -+ Monitor->hsync[0].hi = 0.0; -+ -+ Monitor->nVrefresh = 1; -+ Monitor->vrefresh[0].lo = 1024.0; -+ Monitor->vrefresh[0].hi = 0.0; -+ -+ while (Mode) { -+ if (!Mode->HSync) -+ Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); -+ -+ if (!Mode->VRefresh) -+ Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / -+ ((float) (Mode->HTotal * Mode->VTotal)); -+ -+ if (Mode->HSync < Monitor->hsync[0].lo) -+ Monitor->hsync[0].lo = Mode->HSync; -+ -+ if (Mode->HSync > Monitor->hsync[0].hi) -+ Monitor->hsync[0].hi = Mode->HSync; -+ -+ if (Mode->VRefresh < Monitor->vrefresh[0].lo) -+ Monitor->vrefresh[0].lo = Mode->VRefresh; -+ -+ if (Mode->VRefresh > Monitor->vrefresh[0].hi) -+ Monitor->vrefresh[0].hi = Mode->VRefresh; -+ -+ Mode = Mode->next; -+ } -+} -+ -+_X_EXPORT DisplayModePtr - xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) - { - int preferred, i; -@@ -351,3 +385,107 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) - } - return Modes; - } -+ -+/* -+ * Fill out MonPtr with xf86MonPtr information. -+ */ -+_X_EXPORT void -+xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) -+{ -+ DisplayModePtr Modes = NULL, Mode; -+ int i, clock; -+ Bool have_hsync = FALSE, have_vrefresh = FALSE, have_maxpixclock = FALSE; -+ -+ if (!Monitor || !DDC) -+ return; -+ -+ Monitor->DDC = DDC; -+ -+ Monitor->widthmm = 10 * DDC->features.hsize; -+ Monitor->heightmm = 10 * DDC->features.vsize; -+ -+ /* If this is a digital display, then we can use reduced blanking */ -+ if (DDC->features.input_type) -+ Monitor->reducedblanking = TRUE; -+ /* Allow the user to also enable this through config */ -+ -+ Modes = xf86DDCGetModes(scrnIndex, DDC); -+ -+ /* Skip EDID ranges if they were specified in the config file */ -+ have_hsync = (Monitor->nHsync != 0); -+ have_vrefresh = (Monitor->nVrefresh != 0); -+ have_maxpixclock = (Monitor->maxPixClock != 0); -+ -+ /* Go through the detailed monitor sections */ -+ for (i = 0; i < DET_TIMINGS; i++) { -+ switch (DDC->det_mon[i].type) { -+ case DS_RANGES: -+ if (!have_hsync) { -+ if (!Monitor->nHsync) -+ xf86DrvMsg(scrnIndex, X_INFO, -+ "Using EDID range info for horizontal sync\n"); -+ Monitor->hsync[Monitor->nHsync].lo = -+ DDC->det_mon[i].section.ranges.min_h; -+ Monitor->hsync[Monitor->nHsync].hi = -+ DDC->det_mon[i].section.ranges.max_h; -+ Monitor->nHsync++; -+ } else { -+ xf86DrvMsg(scrnIndex, X_INFO, -+ "Using hsync ranges from config file\n"); -+ } -+ -+ if (!have_vrefresh) { -+ if (!Monitor->nVrefresh) -+ xf86DrvMsg(scrnIndex, X_INFO, -+ "Using EDID range info for vertical refresh\n"); -+ Monitor->vrefresh[Monitor->nVrefresh].lo = -+ DDC->det_mon[i].section.ranges.min_v; -+ Monitor->vrefresh[Monitor->nVrefresh].hi = -+ DDC->det_mon[i].section.ranges.max_v; -+ Monitor->nVrefresh++; -+ } else { -+ xf86DrvMsg(scrnIndex, X_INFO, -+ "Using vrefresh ranges from config file\n"); -+ } -+ -+ clock = DDC->det_mon[i].section.ranges.max_clock * 1000; -+ if (!have_maxpixclock && clock > Monitor->maxPixClock) -+ Monitor->maxPixClock = clock; -+ -+ break; -+ default: -+ break; -+ } -+ } -+ -+ if (Modes) { -+ /* Print Modes */ -+ xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); -+ -+ Mode = Modes; -+ while (Mode) { -+ xf86PrintModeline(scrnIndex, Mode); -+ Mode = Mode->next; -+ } -+ -+ /* Do we still need ranges to be filled in? */ -+ if (!Monitor->nHsync || !Monitor->nVrefresh) -+ DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); -+ -+ /* look for last Mode */ -+ Mode = Modes; -+ -+ while (Mode->next) -+ Mode = Mode->next; -+ -+ /* add to MonPtr */ -+ if (Monitor->Modes) { -+ Monitor->Last->next = Modes; -+ Modes->prev = Monitor->Last; -+ Monitor->Last = Mode; -+ } else { -+ Monitor->Modes = Modes; -+ Monitor->Last = Mode; -+ } -+ } -+} -diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c -index 5b52bd7..f49c292 100644 ---- a/hw/xfree86/modes/xf86Modes.c -+++ b/hw/xfree86/modes/xf86Modes.c -@@ -1,6 +1,3 @@ --/* -*- c-basic-offset: 4 -*- */ --/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Mode.c,v 1.10 2006/03/07 16:00:57 libv Exp $ */ --/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */ - /* - * Copyright (c) 1997-2003 by The XFree86 Project, Inc. - * -@@ -52,7 +49,7 @@ extern XF86ConfigPtr xf86configptr; - * - * Exact copy of xf86Mode.c's. - */ --double -+_X_EXPORT double - xf86ModeHSync(DisplayModePtr mode) - { - double hsync = 0.0; -@@ -70,7 +67,7 @@ xf86ModeHSync(DisplayModePtr mode) - * - * Exact copy of xf86Mode.c's. - */ --double -+_X_EXPORT double - xf86ModeVRefresh(DisplayModePtr mode) - { - double refresh = 0.0; -@@ -89,7 +86,7 @@ xf86ModeVRefresh(DisplayModePtr mode) - return refresh; - } - --int -+_X_EXPORT int - xf86ModeWidth (DisplayModePtr mode, Rotation rotation) - { - switch (rotation & 0xf) { -@@ -104,7 +101,7 @@ xf86ModeWidth (DisplayModePtr mode, Rotation rotation) - } - } - --int -+_X_EXPORT int - xf86ModeHeight (DisplayModePtr mode, Rotation rotation) - { - switch (rotation & 0xf) { -@@ -120,7 +117,7 @@ xf86ModeHeight (DisplayModePtr mode, Rotation rotation) - } - - /** Sets a default mode name of x on a mode. */ --void -+_X_EXPORT void - xf86SetModeDefaultName(DisplayModePtr mode) - { - if (mode->name != NULL) -@@ -137,7 +134,7 @@ xf86SetModeDefaultName(DisplayModePtr mode) - * - * Exact copy of xf86Mode.c's. - */ --void -+_X_EXPORT void - xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) - { - if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN)) -@@ -188,7 +185,7 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) - /** - * Allocates and returns a copy of pMode, including pointers within pMode. - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86DuplicateMode(DisplayModePtr pMode) - { - DisplayModePtr pNew; -@@ -212,7 +209,7 @@ xf86DuplicateMode(DisplayModePtr pMode) - * - * \param modeList doubly-linked mode list - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList) - { - DisplayModePtr first = NULL, last = NULL; -@@ -246,7 +243,7 @@ xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList) - * - * This isn't in xf86Modes.c, but it might deserve to be there. - */ --Bool -+_X_EXPORT Bool - xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2) - { - if (pMode1->Clock == pMode2->Clock && -@@ -282,7 +279,7 @@ add(char **p, char *new) - * - * Convenient VRefresh printing was added, though, compared to xf86Mode.c - */ --void -+_X_EXPORT void - xf86PrintModeline(int scrnIndex,DisplayModePtr mode) - { - char tmp[256]; -@@ -330,7 +327,7 @@ xf86PrintModeline(int scrnIndex,DisplayModePtr mode) - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, - int flags) - { -@@ -351,7 +348,7 @@ xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, - int maxX, int maxY, int maxPitch) - { -@@ -380,7 +377,7 @@ xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, - MonPtr mon) - { -@@ -427,7 +424,7 @@ xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, - int *min, int *max, int n_ranges) - { -@@ -461,7 +458,7 @@ xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList) - { - DisplayModePtr mode; -@@ -495,7 +492,7 @@ xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList) - * - * This is not in xf86Modes.c, but would be part of the proposed new API. - */ --void -+_X_EXPORT void - xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList, - Bool verbose) - { -@@ -529,7 +526,7 @@ xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList, - * - * \param modes doubly-linked mode list. - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new) - { - if (modes == NULL) -@@ -595,7 +592,7 @@ xf86GetConfigModes (XF86ConfModeLinePtr conf_mode) - /** - * Build a mode list from a monitor configuration - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) - { - DisplayModePtr modes = NULL; -@@ -627,7 +624,7 @@ xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) - /** - * Build a mode list containing all of the default modes - */ --DisplayModePtr -+_X_EXPORT DisplayModePtr - xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed) - { - DisplayModePtr head = NULL, prev = NULL, mode; -diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c -index 90de585..38435c9 100644 ---- a/hw/xfree86/modes/xf86RandR12.c -+++ b/hw/xfree86/modes/xf86RandR12.c -@@ -1,7 +1,4 @@ --/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.3 2004/07/30 21:53:09 eich Exp $ */ - /* -- * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.7tsi Exp $ -- * - * Copyright � 2002 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its -@@ -96,9 +93,12 @@ xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations) - } - - /* Re-probe the outputs for new monitors or modes */ -- xf86ProbeOutputModes (scrp, 0, 0); -- xf86SetScrnInfoModes (scrp); -- xf86DiDGAReInit (pScreen); -+ if (scrp->vtSema) -+ { -+ xf86ProbeOutputModes (scrp, 0, 0); -+ xf86SetScrnInfoModes (scrp); -+ xf86DiDGAReInit (pScreen); -+ } - - for (mode = scrp->modes; ; mode = mode->next) - { -@@ -244,7 +244,7 @@ xf86RandR12SetMode (ScreenPtr pScreen, - return ret; - } - --Bool -+_X_EXPORT Bool - xf86RandR12SetConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, -@@ -337,6 +337,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - WindowPtr pRoot = WindowTable[pScreen->myNum]; -+ PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); - Bool ret = FALSE; - - if (randrp->virtualX == -1 || randrp->virtualY == -1) -@@ -344,7 +345,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, - randrp->virtualX = pScrn->virtualX; - randrp->virtualY = pScrn->virtualY; - } -- if (pRoot) -+ if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); - - /* Let the driver update virtualX and virtualY */ -@@ -353,8 +354,8 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, - - ret = TRUE; - -- pScreen->width = width; -- pScreen->height = height; -+ pScreen->width = pScrnPix->drawable.width = width; -+ pScreen->height = pScrnPix->drawable.height = height; - pScreen->mmWidth = mmWidth; - pScreen->mmHeight = mmHeight; - -@@ -362,7 +363,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, - xf86SetViewport (pScreen, 0, 0); - - finish: -- if (pRoot) -+ if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); - #if RANDR_12_INTERFACE - if (WindowTable[pScreen->myNum] && ret) -@@ -371,7 +372,7 @@ finish: - return ret; - } - --Rotation -+_X_EXPORT Rotation - xf86RandR12GetRotation(ScreenPtr pScreen) - { - XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); -@@ -379,7 +380,7 @@ xf86RandR12GetRotation(ScreenPtr pScreen) - return randrp->rotation; - } - --Bool -+_X_EXPORT Bool - xf86RandR12CreateScreenResources (ScreenPtr pScreen) - { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -@@ -469,7 +470,7 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) - } - - --Bool -+_X_EXPORT Bool - xf86RandR12Init (ScreenPtr pScreen) - { - rrScrPrivPtr rp; -@@ -519,7 +520,7 @@ xf86RandR12Init (ScreenPtr pScreen) - return TRUE; - } - --void -+_X_EXPORT void - xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations) - { - XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); -@@ -537,7 +538,7 @@ xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations) - randrp->supported_rotations = rotations; - } - --void -+_X_EXPORT void - xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) - { - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; -@@ -715,7 +716,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, - xf86CrtcPtr *save_crtcs; - Bool save_enabled = crtc->enabled; - -- save_crtcs = ALLOCATE_LOCAL(config->num_crtc * sizeof (xf86CrtcPtr)); -+ save_crtcs = ALLOCATE_LOCAL(config->num_output * sizeof (xf86CrtcPtr)); - if ((randr_mode != NULL) != crtc->enabled) - changed = TRUE; - else if (randr_mode && !xf86RandRModeMatches (randr_mode, &crtc->mode)) -@@ -749,6 +750,10 @@ xf86RandR12CrtcSet (ScreenPtr pScreen, - output->crtc = new_crtc; - } - } -+ for (ro = 0; ro < num_randr_outputs; ro++) -+ if (randr_outputs[ro]->pendingProperties) -+ changed = TRUE; -+ - /* XXX need device-independent mode setting code through an API */ - if (changed) - { -@@ -793,6 +798,9 @@ xf86RandR12CrtcSetGamma (ScreenPtr pScreen, - if (crtc->funcs->gamma_set == NULL) - return FALSE; - -+ if (!crtc->scrn->vtSema) -+ return TRUE; -+ - crtc->funcs->gamma_set(crtc, randr_crtc->gammaRed, randr_crtc->gammaGreen, - randr_crtc->gammaBlue, randr_crtc->gammaSize); - -@@ -813,6 +821,11 @@ xf86RandR12OutputSetProperty (ScreenPtr pScreen, - if (output->funcs->set_property == NULL) - return TRUE; - -+ /* -+ * This function gets called even when vtSema is FALSE, as -+ * drivers will need to remember the correct value to apply -+ * when the VT switch occurs -+ */ - return output->funcs->set_property(output, property, value); - } - -@@ -826,6 +839,11 @@ xf86RandR12OutputValidateMode (ScreenPtr pScreen, - DisplayModeRec mode; - - xf86RandRModeConvert (pScrn, randr_mode, &mode); -+ /* -+ * This function may be called when vtSema is FALSE, so -+ * the underlying function must either avoid touching the hardware -+ * or return FALSE when vtSema is FALSE -+ */ - if (output->funcs->mode_valid (output, &mode) != MODE_OK) - return FALSE; - return TRUE; -@@ -933,7 +951,6 @@ xf86RandR12SetInfo12 (ScreenPtr pScreen) - return FALSE; - } - -- RROutputSetCrtc (output->randr_output, randr_crtc); - RROutputSetPhysicalSize(output->randr_output, - output->mm_width, - output->mm_height); -@@ -987,6 +1004,8 @@ xf86RandR12GetInfo12 (ScreenPtr pScreen, Rotation *rotations) - { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - -+ if (!pScrn->vtSema) -+ return TRUE; - xf86ProbeOutputModes (pScrn, 0, 0); - xf86SetScrnInfoModes (pScrn); - xf86DiDGAReInit (pScreen); -@@ -1053,7 +1072,7 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen) - * to DGA, VidMode or hot key. Tell RandR - */ - --void -+_X_EXPORT void - xf86RandR12TellChanged (ScreenPtr pScreen) - { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -@@ -1103,7 +1122,7 @@ xf86RandR12Init12 (ScreenPtr pScreen) - - #endif - --Bool -+_X_EXPORT Bool - xf86RandR12PreInit (ScrnInfoPtr pScrn) - { - return TRUE; -diff --git a/hw/xfree86/modes/xf86RandR12.h b/hw/xfree86/modes/xf86RandR12.h -index 0d3346a..4fd855c 100644 ---- a/hw/xfree86/modes/xf86RandR12.h -+++ b/hw/xfree86/modes/xf86RandR12.h -@@ -24,6 +24,9 @@ - #define _XF86_RANDR_H_ - #include - #include -+#if XF86_MODES_RENAME -+#include "xf86Rename.h" -+#endif - - Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen); - Bool xf86RandR12Init(ScreenPtr pScreen); -diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h -index 9dcfef5..b8c1d70 100644 ---- a/hw/xfree86/modes/xf86Rename.h -+++ b/hw/xfree86/modes/xf86Rename.h -@@ -25,6 +25,12 @@ - - #include "local_xf86Rename.h" - -+#define xf86_cursors_fini XF86NAME(xf86_cursors_fini) -+#define xf86_cursors_init XF86NAME(xf86_cursors_init) -+#define xf86_hide_cursors XF86NAME(xf86_hide_cursors) -+#define xf86_reload_cursors XF86NAME(xf86_reload_cursors) -+#define xf86_show_cursors XF86NAME(xf86_show_cursors) -+#define xf86ConnectorGetName XF86NAME(xf86ConnectorGetName) - #define xf86CrtcConfigInit XF86NAME(xf86CrtcConfigInit) - #define xf86CrtcConfigPrivateIndex XF86NAME(xf86CrtcConfigPrivateIndex) - #define xf86CrtcCreate XF86NAME(xf86CrtcCreate) -@@ -35,6 +41,7 @@ - #define xf86CrtcSetMode XF86NAME(xf86CrtcSetMode) - #define xf86CrtcSetSizeRange XF86NAME(xf86CrtcSetSizeRange) - #define xf86CVTMode XF86NAME(xf86CVTMode) -+#define xf86DDCMonitorSet XF86NAME(xf86DDCMonitorSet) - #define xf86DisableUnusedFunctions XF86NAME(xf86DisableUnusedFunctions) - #define xf86DPMSSet XF86NAME(xf86DPMSSet) - #define xf86DuplicateMode XF86NAME(xf86DuplicateMode) -@@ -52,9 +59,11 @@ - #define xf86OutputGetEDIDModes XF86NAME(xf86OutputGetEDIDModes) - #define xf86OutputRename XF86NAME(xf86OutputRename) - #define xf86OutputSetEDID XF86NAME(xf86OutputSetEDID) -+#define xf86OutputUseScreenMonitor XF86NAME(xf86OutputUseScreenMonitor) - #define xf86PrintModeline XF86NAME(xf86PrintModeline) - #define xf86ProbeOutputModes XF86NAME(xf86ProbeOutputModes) - #define xf86PruneInvalidModes XF86NAME(xf86PruneInvalidModes) -+#define xf86RotateCloseScreen XF86NAME(xf86RotateCloseScreen) - #define xf86SetModeCrtc XF86NAME(xf86SetModeCrtc) - #define xf86SetModeDefaultName XF86NAME(xf86SetModeDefaultName) - #define xf86SetScrnInfoModes XF86NAME(xf86SetScrnInfoModes) -diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c -index 359501e..380478f 100644 ---- a/hw/xfree86/modes/xf86Rotate.c -+++ b/hw/xfree86/modes/xf86Rotate.c -@@ -68,57 +68,204 @@ compWindowFormat (WindowPtr pWin) - compGetWindowVisual (pWin)); - } - -+#define F(x) IntToxFixed(x) -+ - static void --xf86TranslateBox (BoxPtr b, int dx, int dy) -+PictureTransformIdentity (PictTransformPtr matrix) -+{ -+ int i; -+ memset (matrix, '\0', sizeof (PictTransform)); -+ for (i = 0; i < 3; i++) -+ matrix->matrix[i][i] = F(1); -+} -+ -+static Bool -+PictureTransformMultiply (PictTransformPtr dst, PictTransformPtr l, PictTransformPtr r) - { -- b->x1 += dx; -- b->y1 += dy; -- b->x2 += dx; -- b->y2 += dy; -+ PictTransform d; -+ int dx, dy; -+ int o; -+ -+ for (dy = 0; dy < 3; dy++) -+ for (dx = 0; dx < 3; dx++) -+ { -+ xFixed_48_16 v; -+ xFixed_32_32 partial; -+ v = 0; -+ for (o = 0; o < 3; o++) -+ { -+ partial = (xFixed_32_32) l->matrix[dy][o] * (xFixed_32_32) r->matrix[o][dx]; -+ v += partial >> 16; -+ } -+ if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) -+ return FALSE; -+ d.matrix[dy][dx] = (xFixed) v; -+ } -+ *dst = d; -+ return TRUE; - } - - static void --xf86TransformBox (BoxPtr dst, BoxPtr src, Rotation rotation, -- int xoff, int yoff, -- int dest_width, int dest_height) -+PictureTransformInitScale (PictTransformPtr t, xFixed sx, xFixed sy) -+{ -+ memset (t, '\0', sizeof (PictTransform)); -+ t->matrix[0][0] = sx; -+ t->matrix[1][1] = sy; -+ t->matrix[2][2] = F (1); -+} -+ -+static xFixed -+fixed_inverse (xFixed x) -+{ -+ return (xFixed) ((((xFixed_48_16) F(1)) * F(1)) / x); -+} -+ -+static Bool -+PictureTransformScale (PictTransformPtr forward, -+ PictTransformPtr reverse, -+ xFixed sx, xFixed sy) - { -- BoxRec stmp = *src; -+ PictTransform t; - -- xf86TranslateBox (&stmp, -xoff, -yoff); -- switch (rotation & 0xf) { -- default: -- case RR_Rotate_0: -- *dst = stmp; -- break; -- case RR_Rotate_90: -- dst->x1 = stmp.y1; -- dst->y1 = dest_height - stmp.x2; -- dst->x2 = stmp.y2; -- dst->y2 = dest_height - stmp.x1; -- break; -- case RR_Rotate_180: -- dst->x1 = dest_width - stmp.x2; -- dst->y1 = dest_height - stmp.y2; -- dst->x2 = dest_width - stmp.x1; -- dst->y2 = dest_height - stmp.y1; -- break; -- case RR_Rotate_270: -- dst->x1 = dest_width - stmp.y2; -- dst->y1 = stmp.x1; -- dst->y2 = stmp.x2; -- dst->x2 = dest_width - stmp.y1; -- break; -- } -- if (rotation & RR_Reflect_X) { -- int x1 = dst->x1; -- dst->x1 = dest_width - dst->x2; -- dst->x2 = dest_width - x1; -+ PictureTransformInitScale (&t, sx, sy); -+ if (!PictureTransformMultiply (forward, &t, forward)) -+ return FALSE; -+ PictureTransformInitScale (&t, fixed_inverse (sx), fixed_inverse (sy)); -+ if (!PictureTransformMultiply (reverse, reverse, &t)) -+ return FALSE; -+ return TRUE; -+} -+ -+static void -+PictureTransformInitRotate (PictTransformPtr t, xFixed c, xFixed s) -+{ -+ memset (t, '\0', sizeof (PictTransform)); -+ t->matrix[0][0] = c; -+ t->matrix[0][1] = -s; -+ t->matrix[1][0] = s; -+ t->matrix[1][1] = c; -+ t->matrix[2][2] = F (1); -+} -+ -+static Bool -+PictureTransformRotate (PictTransformPtr forward, -+ PictTransformPtr reverse, -+ xFixed c, xFixed s) -+{ -+ PictTransform t; -+ PictureTransformInitRotate (&t, c, s); -+ if (!PictureTransformMultiply (forward, &t, forward)) -+ return FALSE; -+ -+ PictureTransformInitRotate (&t, c, -s); -+ if (!PictureTransformMultiply (reverse, reverse, &t)) -+ return FALSE; -+ return TRUE; -+} -+ -+static void -+PictureTransformInitTranslate (PictTransformPtr t, xFixed tx, xFixed ty) -+{ -+ memset (t, '\0', sizeof (PictTransform)); -+ t->matrix[0][0] = F (1); -+ t->matrix[0][2] = tx; -+ t->matrix[1][1] = F (1); -+ t->matrix[1][2] = ty; -+ t->matrix[2][2] = F (1); -+} -+ -+static Bool -+PictureTransformTranslate (PictTransformPtr forward, -+ PictTransformPtr reverse, -+ xFixed tx, xFixed ty) -+{ -+ PictTransform t; -+ PictureTransformInitTranslate (&t, tx, ty); -+ if (!PictureTransformMultiply (forward, &t, forward)) -+ return FALSE; -+ -+ PictureTransformInitTranslate (&t, -tx, -ty); -+ if (!PictureTransformMultiply (reverse, reverse, &t)) -+ return FALSE; -+ return TRUE; -+} -+ -+static void -+PictureTransformBounds (BoxPtr b, PictTransformPtr matrix) -+{ -+ PictVector v[4]; -+ int i; -+ int x1, y1, x2, y2; -+ -+ v[0].vector[0] = F (b->x1); v[0].vector[1] = F (b->y1); v[0].vector[2] = F(1); -+ v[1].vector[0] = F (b->x2); v[1].vector[1] = F (b->y1); v[1].vector[2] = F(1); -+ v[2].vector[0] = F (b->x2); v[2].vector[1] = F (b->y2); v[2].vector[2] = F(1); -+ v[3].vector[0] = F (b->x1); v[3].vector[1] = F (b->y2); v[3].vector[2] = F(1); -+ for (i = 0; i < 4; i++) -+ { -+ PictureTransformPoint (matrix, &v[i]); -+ x1 = xFixedToInt (v[i].vector[0]); -+ y1 = xFixedToInt (v[i].vector[1]); -+ x2 = xFixedToInt (xFixedCeil (v[i].vector[0])); -+ y2 = xFixedToInt (xFixedCeil (v[i].vector[1])); -+ if (i == 0) -+ { -+ b->x1 = x1; b->y1 = y1; -+ b->x2 = x2; b->y2 = y2; -+ } -+ else -+ { -+ if (x1 < b->x1) b->x1 = x1; -+ if (y1 < b->y1) b->y1 = y1; -+ if (x2 > b->x2) b->x2 = x2; -+ if (y2 > b->y2) b->y2 = y2; -+ } - } -- if (rotation & RR_Reflect_Y) { -- int y1 = dst->y1; -- dst->y1 = dest_height - dst->y2; -- dst->y2 = dest_height - y1; -+} -+ -+static Bool -+PictureTransformIsIdentity(PictTransform *t) -+{ -+ return ((t->matrix[0][0] == t->matrix[1][1]) && -+ (t->matrix[0][0] == t->matrix[2][2]) && -+ (t->matrix[0][0] != 0) && -+ (t->matrix[0][1] == 0) && -+ (t->matrix[0][2] == 0) && -+ (t->matrix[1][0] == 0) && -+ (t->matrix[1][2] == 0) && -+ (t->matrix[2][0] == 0) && -+ (t->matrix[2][1] == 0)); -+} -+ -+#define toF(x) ((float) (x) / 65536.0f) -+ -+static void -+PictureTransformErrorF (PictTransform *t) -+{ -+ ErrorF ("{ { %f %f %f } { %f %f %f } { %f %f %f } }", -+ toF(t->matrix[0][0]), toF(t->matrix[0][1]), toF(t->matrix[0][2]), -+ toF(t->matrix[1][0]), toF(t->matrix[1][1]), toF(t->matrix[1][2]), -+ toF(t->matrix[2][0]), toF(t->matrix[2][1]), toF(t->matrix[2][2])); -+} -+ -+static Bool -+PictureTransformIsInverse (char *where, PictTransform *a, PictTransform *b) -+{ -+ PictTransform t; -+ -+ PictureTransformMultiply (&t, a, b); -+ if (!PictureTransformIsIdentity (&t)) -+ { -+ ErrorF ("%s: ", where); -+ PictureTransformErrorF (a); -+ ErrorF (" * "); -+ PictureTransformErrorF (b); -+ ErrorF (" = "); -+ PictureTransformErrorF (a); -+ ErrorF ("\n"); -+ return FALSE; - } -+ return TRUE; - } - - static void -@@ -131,7 +278,6 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) - PictFormatPtr format = compWindowFormat (WindowTable[screen->myNum]); - int error; - PicturePtr src, dst; -- PictTransform transform; - int n = REGION_NUM_RECTS(region); - BoxPtr b = REGION_RECTS(region); - XID include_inferiors = IncludeInferiors; -@@ -156,45 +302,7 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) - if (!dst) - return; - -- memset (&transform, '\0', sizeof (transform)); -- transform.matrix[2][2] = IntToxFixed(1); -- transform.matrix[0][2] = IntToxFixed(crtc->x); -- transform.matrix[1][2] = IntToxFixed(crtc->y); -- switch (crtc->rotation & 0xf) { -- default: -- case RR_Rotate_0: -- transform.matrix[0][0] = IntToxFixed(1); -- transform.matrix[1][1] = IntToxFixed(1); -- break; -- case RR_Rotate_90: -- transform.matrix[0][1] = IntToxFixed(-1); -- transform.matrix[1][0] = IntToxFixed(1); -- transform.matrix[0][2] += IntToxFixed(crtc->mode.VDisplay); -- break; -- case RR_Rotate_180: -- transform.matrix[0][0] = IntToxFixed(-1); -- transform.matrix[1][1] = IntToxFixed(-1); -- transform.matrix[0][2] += IntToxFixed(crtc->mode.HDisplay); -- transform.matrix[1][2] += IntToxFixed(crtc->mode.VDisplay); -- break; -- case RR_Rotate_270: -- transform.matrix[0][1] = IntToxFixed(1); -- transform.matrix[1][0] = IntToxFixed(-1); -- transform.matrix[1][2] += IntToxFixed(crtc->mode.HDisplay); -- break; -- } -- -- /* handle reflection */ -- if (crtc->rotation & RR_Reflect_X) -- { -- /* XXX figure this out */ -- } -- if (crtc->rotation & RR_Reflect_Y) -- { -- /* XXX figure this out too */ -- } -- -- error = SetPictureTransform (src, &transform); -+ error = SetPictureTransform (src, &crtc->crtc_to_framebuffer); - if (error) - return; - -@@ -202,9 +310,8 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) - { - BoxRec dst_box; - -- xf86TransformBox (&dst_box, b, crtc->rotation, -- crtc->x, crtc->y, -- crtc->mode.HDisplay, crtc->mode.VDisplay); -+ dst_box = *b; -+ PictureTransformBounds (&dst_box, &crtc->framebuffer_to_crtc); - CompositePicture (PictOpSrc, - src, NULL, dst, - dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1, -@@ -264,7 +371,7 @@ xf86RotatePrepare (ScreenPtr pScreen) - } - } - --static void -+static Bool - xf86RotateRedisplay(ScreenPtr pScreen) - { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; -@@ -273,7 +380,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) - RegionPtr region; - - if (!damage) -- return; -+ return FALSE; - xf86RotatePrepare (pScreen); - region = DamageRegion(damage); - if (REGION_NOTEMPTY(pScreen, region)) -@@ -296,15 +403,10 @@ xf86RotateRedisplay(ScreenPtr pScreen) - - if (crtc->rotation != RR_Rotate_0 && crtc->enabled) - { -- BoxRec box; - RegionRec crtc_damage; - - /* compute portion of damage that overlaps crtc */ -- box.x1 = crtc->x; -- box.x2 = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation); -- box.y1 = crtc->y; -- box.y2 = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation); -- REGION_INIT(pScreen, &crtc_damage, &box, 1); -+ REGION_INIT(pScreen, &crtc_damage, &crtc->bounds, 1); - REGION_INTERSECT (pScreen, &crtc_damage, &crtc_damage, region); - - /* update damaged region */ -@@ -317,19 +419,25 @@ xf86RotateRedisplay(ScreenPtr pScreen) - pScreen->SourceValidate = SourceValidate; - DamageEmpty(damage); - } -+ return TRUE; - } - - static void --xf86RotateBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) -+xf86RotateBlockHandler(int screenNum, pointer blockData, -+ pointer pTimeout, pointer pReadmask) - { -- ScreenPtr pScreen = (ScreenPtr) data; -- -- xf86RotateRedisplay(pScreen); --} -+ ScreenPtr pScreen = screenInfo.screens[screenNum]; -+ ScrnInfoPtr pScrn = xf86Screens[screenNum]; -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - --static void --xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask) --{ -+ pScreen->BlockHandler = xf86_config->BlockHandler; -+ (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); -+ if (xf86RotateRedisplay(pScreen)) -+ { -+ /* Re-wrap if rotation is still happening */ -+ xf86_config->BlockHandler = pScreen->BlockHandler; -+ pScreen->BlockHandler = xf86RotateBlockHandler; -+ } - } - - static void -@@ -367,14 +475,10 @@ xf86RotateDestroy (xf86CrtcPtr crtc) - } - DamageDestroy (xf86_config->rotation_damage); - xf86_config->rotation_damage = NULL; -- /* Free block/wakeup handler */ -- RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler, -- xf86RotateWakeupHandler, -- (pointer) pScreen); - } - } - --void -+_X_EXPORT void - xf86RotateCloseScreen (ScreenPtr screen) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; -@@ -385,19 +489,99 @@ xf86RotateCloseScreen (ScreenPtr screen) - xf86RotateDestroy (xf86_config->crtc[c]); - } - --Bool -+_X_EXPORT Bool - xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) - { - ScrnInfoPtr pScrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - ScreenPtr pScreen = pScrn->pScreen; -+ PictTransform crtc_to_fb, fb_to_crtc; -+ -+ PictureTransformIdentity (&crtc_to_fb); -+ PictureTransformIdentity (&fb_to_crtc); -+ PictureTransformIsInverse ("identity", &crtc_to_fb, &fb_to_crtc); -+ if (rotation != RR_Rotate_0) -+ { -+ xFixed rot_cos, rot_sin, rot_dx, rot_dy; -+ xFixed scale_x, scale_y, scale_dx, scale_dy; -+ int mode_w = crtc->mode.HDisplay; -+ int mode_h = crtc->mode.VDisplay; -+ -+ /* rotation */ -+ switch (rotation & 0xf) { -+ default: -+ case RR_Rotate_0: -+ rot_cos = F ( 1); rot_sin = F ( 0); -+ rot_dx = F ( 0); rot_dy = F ( 0); -+ break; -+ case RR_Rotate_90: -+ rot_cos = F ( 0); rot_sin = F ( 1); -+ rot_dx = F ( mode_h); rot_dy = F (0); -+ break; -+ case RR_Rotate_180: -+ rot_cos = F (-1); rot_sin = F ( 0); -+ rot_dx = F (mode_w); rot_dy = F ( mode_h); -+ break; -+ case RR_Rotate_270: -+ rot_cos = F ( 0); rot_sin = F (-1); -+ rot_dx = F ( 0); rot_dy = F ( mode_w); -+ break; -+ } -+ -+ PictureTransformRotate (&crtc_to_fb, &fb_to_crtc, rot_cos, rot_sin); -+ PictureTransformIsInverse ("rotate", &crtc_to_fb, &fb_to_crtc); -+ -+ PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, rot_dx, rot_dy); -+ PictureTransformIsInverse ("rotate translate", &crtc_to_fb, &fb_to_crtc); -+ -+ /* reflection */ -+ scale_x = F (1); -+ scale_dx = 0; -+ scale_y = F (1); -+ scale_dy = 0; -+ if (rotation & RR_Reflect_X) -+ { -+ scale_x = F(-1); -+ if (rotation & (RR_Rotate_0|RR_Rotate_180)) -+ scale_dx = F(mode_w); -+ else -+ scale_dx = F(mode_h); -+ } -+ if (rotation & RR_Reflect_Y) -+ { -+ scale_y = F(-1); -+ if (rotation & (RR_Rotate_0|RR_Rotate_180)) -+ scale_dy = F(mode_h); -+ else -+ scale_dy = F(mode_w); -+ } -+ -+ PictureTransformScale (&crtc_to_fb, &fb_to_crtc, scale_x, scale_y); -+ PictureTransformIsInverse ("scale", &crtc_to_fb, &fb_to_crtc); -+ -+ PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, scale_dx, scale_dy); -+ PictureTransformIsInverse ("scale translate", &crtc_to_fb, &fb_to_crtc); -+ -+ } - -- if (rotation == RR_Rotate_0) -+ /* -+ * If the untranslated transformation is the identity, -+ * disable the shadow buffer -+ */ -+ if (PictureTransformIsIdentity (&crtc_to_fb)) - { -+ crtc->transform_in_use = FALSE; -+ PictureTransformInitTranslate (&crtc->crtc_to_framebuffer, -+ F (-crtc->x), F (-crtc->y)); -+ PictureTransformInitTranslate (&crtc->framebuffer_to_crtc, -+ F ( crtc->x), F ( crtc->y)); - xf86RotateDestroy (crtc); - } - else - { -+ PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, crtc->x, crtc->y); -+ PictureTransformIsInverse ("offset", &crtc_to_fb, &fb_to_crtc); -+ - /* - * these are the size of the shadow pixmap, which - * matches the mode, not the pre-rotated copy in the -@@ -440,28 +624,20 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) - if (!xf86_config->rotation_damage) - goto bail2; - -- /* Assign block/wakeup handler */ -- if (!RegisterBlockAndWakeupHandlers (xf86RotateBlockHandler, -- xf86RotateWakeupHandler, -- (pointer) pScreen)) -- { -- goto bail3; -- } -+ /* Wrap block handler */ -+ xf86_config->BlockHandler = pScreen->BlockHandler; -+ pScreen->BlockHandler = xf86RotateBlockHandler; - } - if (0) - { --bail3: -- DamageDestroy (xf86_config->rotation_damage); -- xf86_config->rotation_damage = NULL; -- --bail2: -+ bail2: - if (shadow || shadowData) - { - crtc->funcs->shadow_destroy (crtc, shadow, shadowData); - crtc->rotatedPixmap = NULL; - crtc->rotatedData = NULL; - } --bail1: -+ bail1: - if (old_width && old_height) - crtc->rotatedPixmap = crtc->funcs->shadow_create (crtc, - NULL, -@@ -469,6 +645,14 @@ bail1: - old_height); - return FALSE; - } -+ crtc->transform_in_use = TRUE; -+ crtc->crtc_to_framebuffer = crtc_to_fb; -+ crtc->framebuffer_to_crtc = fb_to_crtc; -+ crtc->bounds.x1 = 0; -+ crtc->bounds.x2 = crtc->mode.HDisplay; -+ crtc->bounds.y1 = 0; -+ crtc->bounds.y2 = crtc->mode.VDisplay; -+ PictureTransformBounds (&crtc->bounds, &crtc_to_fb); - } - - /* All done */ -diff --git a/hw/xfree86/ddc/Makefile.am b/hw/xfree86/ddc/Makefile.am -index 3b36f55..cd146c5 100644 ---- a/hw/xfree86/ddc/Makefile.am -+++ b/hw/xfree86/ddc/Makefile.am -@@ -1,12 +1,12 @@ --sdk_HEADERS = edid.h vdif.h xf86DDC.h -+sdk_HEADERS = edid.h xf86DDC.h - - noinst_LIBRARIES = libddc.a - - libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \ -- interpret_vdif.c print_vdif.c ddcProperty.c -+ ddcProperty.c - - INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c - --AM_CFLAGS = $(XORG_CFLAGS) -+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) - - EXTRA_DIST = ddcPriv.h DDC.HOWTO -diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c -index c68dd08..67351d3 100644 ---- a/hw/xfree86/ddc/ddcProperty.c -+++ b/hw/xfree86/ddc/ddcProperty.c -@@ -33,395 +33,8 @@ - #include "xf86DDC.h" - #include "xf86_ansic.h" - --/* -- * xf86Mode.c should have a some more DisplayModePtr list handling. -- */ --static DisplayModePtr --xf86ModesAdd(DisplayModePtr Modes, DisplayModePtr Additions) --{ -- if (!Modes) { -- if (Additions) -- return Additions; -- else -- return NULL; -- } -- -- if (Additions) { -- DisplayModePtr Mode = Modes; -- -- while (Mode->next) -- Mode = Mode->next; -- -- Mode->next = Additions; -- Additions->prev = Mode; -- } -- -- return Modes; --} -- --static DisplayModePtr --xf86ModeCopy(DisplayModePtr Mode) --{ -- DisplayModePtr New; -- -- if (!Mode) -- return NULL; -- -- New = xnfalloc(sizeof(DisplayModeRec)); -- -- memcpy(New, Mode, sizeof(DisplayModeRec)); -- -- New->name = xnfalloc(strlen(Mode->name) + 1); -- memcpy(New->name, Mode->name, strlen(Mode->name) + 1); -- -- /* We ignore privates as DDC code doesn't use it currently */ -- return New; --} -- --/* -- * Temporary. -- */ --static void --add(char **p, char *new) --{ -- *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2); -- strcat(*p, " "); -- strcat(*p, new); --} -- --static void --PrintModeline(int scrnIndex,DisplayModePtr mode) --{ -- char tmp[256]; -- char *flags = xnfcalloc(1, 1); -- -- if (mode->HSkew) { -- snprintf(tmp, 256, "hskew %i", mode->HSkew); -- add(&flags, tmp); -- } -- if (mode->VScan) { -- snprintf(tmp, 256, "vscan %i", mode->VScan); -- add(&flags, tmp); -- } -- if (mode->Flags & V_INTERLACE) add(&flags, "interlace"); -- if (mode->Flags & V_CSYNC) add(&flags, "composite"); -- if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan"); -- if (mode->Flags & V_BCAST) add(&flags, "bcast"); -- if (mode->Flags & V_PHSYNC) add(&flags, "+hsync"); -- if (mode->Flags & V_NHSYNC) add(&flags, "-hsync"); -- if (mode->Flags & V_PVSYNC) add(&flags, "+vsync"); -- if (mode->Flags & V_NVSYNC) add(&flags, "-vsync"); -- if (mode->Flags & V_PCSYNC) add(&flags, "+csync"); -- if (mode->Flags & V_NCSYNC) add(&flags, "-csync"); --#if 0 -- if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2"); --#endif -- xf86DrvMsgVerb(scrnIndex, X_INFO, 3, -- "Modeline \"%s\" %6.2f %i %i %i %i %i %i %i %i%s\n", -- mode->name, mode->Clock/1000., mode->HDisplay, -- mode->HSyncStart, mode->HSyncEnd, mode->HTotal, -- mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, -- mode->VTotal, flags); -- xfree(flags); --} -- --/* -- * TODO: -- * - for those with access to the VESA DMT standard; review please. -- */ --#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DRIVER --#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 -- --DisplayModeRec DDCEstablishedModes[17] = { -- { MODEPREFIX("800x600"), 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@60Hz */ -- { MODEPREFIX("800x600"), 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@56Hz */ -- { MODEPREFIX("640x480"), 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@75Hz */ -- { MODEPREFIX("640x480"), 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@72Hz */ -- { MODEPREFIX("640x480"), 30240, 640, 704, 768, 864, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@67Hz */ -- { MODEPREFIX("640x480"), 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@60Hz */ -- { MODEPREFIX("720x400"), 35500, 720, 738, 846, 900, 0, 400, 421, 423, 449, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 720x400@88Hz */ -- { MODEPREFIX("720x400"), 28320, 720, 738, 846, 900, 0, 400, 412, 414, 449, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, /* 720x400@70Hz */ -- { MODEPREFIX("1280x1024"), 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1280x1024@75Hz */ -- { MODEPREFIX("1024x768"), 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1024x768@75Hz */ -- { MODEPREFIX("1024x768"), 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@70Hz */ -- { MODEPREFIX("1024x768"), 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@60Hz */ -- { MODEPREFIX("1024x768"), 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX }, /* 1024x768@43Hz */ -- { MODEPREFIX("832x624"), 57284, 832, 864, 928, 1152, 0, 624, 625, 628, 667, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 832x624@75Hz */ -- { MODEPREFIX("800x600"), 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@75Hz */ -- { MODEPREFIX("800x600"), 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@72Hz */ -- { MODEPREFIX("1152x864"), 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1152x864@75Hz */ --}; -- --static DisplayModePtr --DDCModesFromEstablished(int scrnIndex, struct established_timings *timing) --{ -- DisplayModePtr Modes = NULL, Mode = NULL; -- CARD32 bits = (timing->t1) | (timing->t2 << 8) | -- ((timing->t_manu & 0x80) << 9); -- int i; -- -- for (i = 0; i < 17; i++) -- if (bits & (0x01 << i)) { -- Mode = xf86ModeCopy(&(DDCEstablishedModes[i])); -- Modes = xf86ModesAdd(Modes, Mode); -- } -- -- return Modes; --} -- --/* -- * -- */ --static DisplayModePtr --DDCModesFromStandardTiming(int scrnIndex, struct std_timings *timing) --{ -- DisplayModePtr Modes = NULL, Mode = NULL; -- int i; -- -- for (i = 0; i < STD_TIMINGS; i++) -- if (timing[i].hsize && timing[i].vsize && timing[i].refresh) { -- Mode = xf86CVTMode(timing[i].hsize, timing[i].vsize, -- timing[i].refresh, FALSE, FALSE); -- Mode->type = M_T_DRIVER; -- Modes = xf86ModesAdd(Modes, Mode); -- } -- -- return Modes; --} -- --/* -- * -- */ --static DisplayModePtr --DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, -- int preferred) --{ -- DisplayModePtr Mode; -- -- /* We don't do stereo */ -- if (timing->stereo) { -- xf86DrvMsg(scrnIndex, X_INFO, "%s: Ignoring: We don't handle stereo.\n", -- __func__); -- return NULL; -- } -- -- /* We only do seperate sync currently */ -- if (timing->sync != 0x03) { -- xf86DrvMsg(scrnIndex, X_INFO, "%s: %dx%d Warning: We only handle seperate" -- " sync.\n", __func__, timing->h_active, timing->v_active); -- } -- -- Mode = xnfalloc(sizeof(DisplayModeRec)); -- memset(Mode, 0, sizeof(DisplayModeRec)); -- -- Mode->name = xnfalloc(10); /* "1234x1234" */ -- xf86snprintf(Mode->name, 20, "%dx%d", timing->h_active, -- timing->v_active); -- -- Mode->type = M_T_DRIVER; -- if (preferred) -- Mode->type |= M_T_PREFERRED; -- -- Mode->Clock = timing->clock / 1000.0; -- -- Mode->HDisplay = timing->h_active; -- Mode->HSyncStart = timing->h_active + timing->h_sync_off; -- Mode->HSyncEnd = Mode->HSyncStart + timing->h_sync_width; -- Mode->HTotal = timing->h_active + timing->h_blanking; -- -- Mode->VDisplay = timing->v_active; -- Mode->VSyncStart = timing->v_active + timing->v_sync_off; -- Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width; -- Mode->VTotal = timing->v_active + timing->v_blanking; -- -- /* We ignore h/v_size and h/v_border for now. */ -- -- if (timing->interlaced) -- Mode->Flags |= V_INTERLACE; -- -- if (timing->misc & 0x02) -- Mode->Flags |= V_PHSYNC; -- else -- Mode->Flags |= V_NHSYNC; -- -- if (timing->misc & 0x01) -- Mode->Flags |= V_PVSYNC; -- else -- Mode->Flags |= V_NVSYNC; -- -- return Mode; --} -- --/* -- * -- */ --static void --DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) --{ -- DisplayModePtr Mode = Modes; -- -- if (!Monitor || !Modes) -- return; -- -- /* set up the ranges for scanning through the modes */ -- Monitor->nHsync = 1; -- Monitor->hsync[0].lo = 1024.0; -- Monitor->hsync[0].hi = 0.0; -- -- Monitor->nVrefresh = 1; -- Monitor->vrefresh[0].lo = 1024.0; -- Monitor->vrefresh[0].hi = 0.0; -- -- while (Mode) { -- if (!Mode->HSync) -- Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); -- -- if (!Mode->VRefresh) -- Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / -- ((float) (Mode->HTotal * Mode->VTotal)); -- -- if (Mode->HSync < Monitor->hsync[0].lo) -- Monitor->hsync[0].lo = Mode->HSync; -- -- if (Mode->HSync > Monitor->hsync[0].hi) -- Monitor->hsync[0].hi = Mode->HSync; -- -- if (Mode->VRefresh < Monitor->vrefresh[0].lo) -- Monitor->vrefresh[0].lo = Mode->VRefresh; -- -- if (Mode->VRefresh > Monitor->vrefresh[0].hi) -- Monitor->vrefresh[0].hi = Mode->VRefresh; -- -- Mode = Mode->next; -- } --} -- --/* -- * Fill out MonPtr with xf86MonPtr information. -- */ --void --xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) --{ -- DisplayModePtr Modes = NULL, Mode; -- int i, clock; -- Bool have_hsync = FALSE, have_vrefresh = FALSE; -- int preferred; -- -- if (!Monitor || !DDC) -- return; -- -- Monitor->DDC = DDC; -- -- preferred = PREFERRED_TIMING_MODE(DDC->features.msc); -- -- Monitor->widthmm = 10 * DDC->features.hsize; -- Monitor->heightmm = 10 * DDC->features.vsize; -- -- /* If this is a digital display, then we can use reduced blanking */ -- if (DDC->features.input_type) -- Monitor->reducedblanking = TRUE; -- /* Allow the user to also enable this through config */ -- -- /* Add established timings */ -- Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1); -- Modes = xf86ModesAdd(Modes, Mode); -- -- /* Add standard timings */ -- Mode = DDCModesFromStandardTiming(scrnIndex, DDC->timings2); -- Modes = xf86ModesAdd(Modes, Mode); -- -- /* Skip EDID ranges if they were specified in the config file */ -- have_hsync = (Monitor->nHsync != 0); -- have_vrefresh = (Monitor->nVrefresh != 0); -- -- /* Go through the detailed monitor sections */ -- for (i = 0; i < DET_TIMINGS; i++) -- switch (DDC->det_mon[i].type) { -- case DS_RANGES: -- if (!have_hsync) { -- if (!Monitor->nHsync) -- xf86DrvMsg(scrnIndex, X_INFO, -- "Using EDID range info for horizontal sync\n"); -- Monitor->hsync[Monitor->nHsync].lo = -- DDC->det_mon[i].section.ranges.min_h; -- Monitor->hsync[Monitor->nHsync].hi = -- DDC->det_mon[i].section.ranges.max_h; -- Monitor->nHsync++; -- } else { -- xf86DrvMsg(scrnIndex, X_INFO, -- "Using hsync ranges from config file\n"); -- } -- -- if (!have_vrefresh) { -- if (!Monitor->nVrefresh) -- xf86DrvMsg(scrnIndex, X_INFO, -- "Using EDID range info for vertical refresh\n"); -- Monitor->vrefresh[Monitor->nVrefresh].lo = -- DDC->det_mon[i].section.ranges.min_v; -- Monitor->vrefresh[Monitor->nVrefresh].hi = -- DDC->det_mon[i].section.ranges.max_v; -- Monitor->nVrefresh++; -- } else { -- xf86DrvMsg(scrnIndex, X_INFO, -- "Using vrefresh ranges from config file\n"); -- } -- -- clock = DDC->det_mon[i].section.ranges.max_clock * 1000; -- if (clock > Monitor->maxPixClock) -- Monitor->maxPixClock = clock; -- -- break; -- case DT: -- Mode = DDCModeFromDetailedTiming(scrnIndex, -- &DDC->det_mon[i].section.d_timings, -- preferred); -- preferred = 0; -- Modes = xf86ModesAdd(Modes, Mode); -- break; -- case DS_STD_TIMINGS: -- Mode = DDCModesFromStandardTiming(scrnIndex, -- DDC->det_mon[i].section.std_t); -- Modes = xf86ModesAdd(Modes, Mode); -- break; -- default: -- break; -- } -- -- if (Modes) { -- /* Print Modes */ -- xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); -- -- Mode = Modes; -- while (Mode) { -- PrintModeline(scrnIndex, Mode); -- Mode = Mode->next; -- } -- -- /* Do we still need ranges to be filled in? */ -- if (!Monitor->nHsync || !Monitor->nVrefresh) -- DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); -- -- /* look for last Mode */ -- Mode = Modes; -- -- while (Mode->next) -- Mode = Mode->next; -- -- /* add to MonPtr */ -- if (Monitor->Modes) { -- Monitor->Last->next = Modes; -- Modes->prev = Monitor->Last; -- Monitor->Last = Mode; -- } else { -- Monitor->Modes = Modes; -- Monitor->Last = Mode; -- } -- } --} -- - #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" - #define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA" --#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA" - - static void - addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) -@@ -474,7 +87,7 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) - if ((EDID1rawdata = xalloc(128*sizeof(CARD8)))==NULL) - return; - -- EDID1Atom = MakeAtom(EDID1_ATOM_NAME, sizeof(EDID1_ATOM_NAME), TRUE); -+ EDID1Atom = MakeAtom(EDID1_ATOM_NAME, sizeof(EDID1_ATOM_NAME) - 1, TRUE); - memcpy(EDID1rawdata, DDC->rawData, 128); - xf86RegisterRootWindowProperty(scrnIndex, EDID1Atom, XA_INTEGER, 8, - 128, (unsigned char *)EDID1rawdata); -@@ -485,20 +98,10 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) - return; - - memcpy(EDID2rawdata, DDC->rawData, 256); -- EDID2Atom = MakeAtom(EDID2_ATOM_NAME, sizeof(EDID2_ATOM_NAME), TRUE); -+ EDID2Atom = MakeAtom(EDID2_ATOM_NAME, sizeof(EDID2_ATOM_NAME) - 1, TRUE); - xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8, - 256, (unsigned char *)EDID2rawdata); - } -- --#if 0 -- if (DDC->vdif) { --#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n" -- -- VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE); -- xf86RegisterRootWindowProperty(scrnIndex, VDIFAtom, XA_STRING, 8, -- strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING); -- } --#endif - } - - Bool -diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h -index 30499a6..4487273 100644 ---- a/hw/xfree86/ddc/edid.h -+++ b/hw/xfree86/ddc/edid.h -@@ -12,8 +12,6 @@ - #ifndef _EDID_H_ - #define _EDID_H_ - --#include "vdif.h" -- - /* read complete EDID record */ - #define EDID1_LEN 128 - #define BITS_PER_BYTE 9 -@@ -192,7 +190,14 @@ - - - /* EDID Ver. >= 1.2 */ --#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0) -+/** -+ * Returns true if the pointer is the start of a monitor descriptor block -+ * instead of a detailed timing descriptor. -+ * -+ * Checking the reserved pad fields for zeroes fails on some monitors with -+ * broken empty ASCII strings. Only the first two bytes are reliable. -+ */ -+#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0) - #define IS_MONITOR_DESC _IS_MONITOR_DESC(c) - #define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000 - #define PIXEL_CLOCK _PIXEL_CLOCK(c) -@@ -453,7 +458,7 @@ typedef struct { - struct established_timings timings1; - struct std_timings timings2[8]; - struct detailed_monitor_section det_mon[4]; -- xf86vdifPtr vdif; -+ void *vdif; /* unused */ - int no_sections; - Uchar *rawData; - } xf86Monitor, *xf86MonPtr; -diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c -index c58bb2f..7b4b2b9 100644 ---- a/hw/xfree86/ddc/interpret_edid.c -+++ b/hw/xfree86/ddc/interpret_edid.c -@@ -304,16 +304,18 @@ get_detailed_timing_section(Uchar *c, struct detailed_timings *r) - r->misc = MISC; - } - -+#define MAX_EDID_MINOR 3 - - static Bool - validate_version(int scrnIndex, struct edid_version *r) - { - if (r->version != 1) - return FALSE; -- if (r->revision > 3) { -- xf86DrvMsg(scrnIndex, X_ERROR,"EDID Version 1.%i not yet supported\n", -- r->revision); -- return FALSE; -- } -+ -+ if (r->revision > MAX_EDID_MINOR) -+ xf86DrvMsg(scrnIndex, X_WARNING, -+ "Assuming version 1.%d is compatible with 1.%d\n", -+ r->revision, MAX_EDID_MINOR); -+ - return TRUE; - } -diff --git a/hw/xfree86/ddc/interpret_vdif.c b/hw/xfree86/ddc/interpret_vdif.c -deleted file mode 100644 -index 3a17e2f..0000000 ---- a/hw/xfree86/ddc/interpret_vdif.c -+++ /dev/null -@@ -1,132 +0,0 @@ -- --#ifdef HAVE_XORG_CONFIG_H --#include --#endif -- --#include --#include "xf86DDC.h" --#include "vdif.h" -- --static xf86VdifLimitsPtr* get_limits(CARD8 *c); --static xf86VdifGammaPtr* get_gamma(CARD8 *c); --static xf86VdifTimingPtr* get_timings(CARD8 *c); --#if X_BYTE_ORDER == X_BIG_ENDIAN --static CARD32 swap_byte_order(CARD32 c); --#endif -- --xf86vdifPtr --xf86InterpretVdif(CARD8 *c) --{ -- xf86VdifPtr p = (xf86VdifPtr)c; -- xf86vdifPtr vdif; -- int i; --#if X_BYTE_ORDER == X_BIG_ENDIAN -- int length; --#endif -- unsigned long l = 0; -- -- if (c == NULL) return NULL; --#if X_BYTE_ORDER == X_BIG_ENDIAN -- length = swap_byte_order(p->FileLength); -- for (i = 0; i < (length >>2); i++) -- ((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ; --#endif -- if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I' -- || p->VDIFId[3] != 'F') return NULL; -- for ( i = 12; i < p->FileLength; i++) -- l += c[i]; -- if ( l != p->Checksum) return NULL; -- vdif = xalloc(sizeof(xf86vdif)); -- vdif->vdif = p; -- vdif->limits = get_limits(c); -- vdif->timings = get_timings(c); -- vdif->gamma = get_gamma(c); -- vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0); -- xfree(c); -- return vdif; --} -- --static xf86VdifLimitsPtr* --get_limits(CARD8 *c) --{ -- int num, i, j; -- xf86VdifLimitsPtr *pp; -- xf86VdifLimitsPtr p; -- -- num = ((xf86VdifPtr)c)->NumberOperationalLimits; -- pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1)); -- p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c)); -- j = 0; -- for ( i = 0; iHeader.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG) -- pp[j++] = p; -- VDIF_NEXT_OPERATIONAL_LIMITS(p); -- } -- pp[j] = NULL; -- return pp; --} -- --static xf86VdifGammaPtr* --get_gamma(CARD8 *c) --{ -- int num, i, j; -- xf86VdifGammaPtr *pp; -- xf86VdifGammaPtr p; -- -- num = ((xf86VdifPtr)c)->NumberOptions; -- pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1)); -- p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c)); -- j = 0; -- for ( i = 0; iHeader.ScnTag == VDIF_GAMMA_TABLE_TAG) -- pp[j++] = p; -- VDIF_NEXT_OPTIONS(p); -- } -- pp[j] = NULL; -- return pp; --} -- --static xf86VdifTimingPtr* --get_timings(CARD8 *c) --{ -- int num, num_limits; -- int i,j,k; -- xf86VdifLimitsPtr lp; -- xf86VdifTimingPtr *pp; -- xf86VdifTimingPtr p; -- -- num = ((xf86VdifPtr)c)->NumberOperationalLimits; -- lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c)); -- num_limits = 0; -- for (i = 0; i < num; i++) { -- if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG) -- num_limits += lp->NumberPreadjustedTimings; -- VDIF_NEXT_OPERATIONAL_LIMITS(lp); -- } -- pp = xalloc(sizeof(xf86VdifTimingPtr) -- * (num_limits+1)); -- j = 0; -- lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c)); -- for (i = 0; i < num; i++) { -- p = VDIF_PREADJUSTED_TIMING(lp); -- for (k = 0; k < lp->NumberPreadjustedTimings; k++) { -- if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG) -- pp[j++] = p; -- VDIF_NEXT_PREADJUSTED_TIMING(p); -- } -- VDIF_NEXT_OPERATIONAL_LIMITS(lp); -- } -- pp[j] = NULL; -- return pp; --} -- --#if X_BYTE_ORDER == X_BIG_ENDIAN --static CARD32 --swap_byte_order(CARD32 c) --{ -- return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8) -- | ((c & 0xFF00) << 8) | ((c & 0xFF) << 24); --} -- --#endif -diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c -deleted file mode 100644 -index 13cd3ab..0000000 ---- a/hw/xfree86/ddc/print_vdif.c -+++ /dev/null -@@ -1,225 +0,0 @@ -- --#ifdef HAVE_XORG_CONFIG_H --#include --#endif -- --#include "vdif.h" --#include "misc.h" --#include "xf86DDC.h" -- --static void print_vdif(xf86VdifPtr l, char *s); --static void print_timings(xf86VdifTimingPtr *pt); --static void print_limits(xf86VdifLimitsPtr *pl); --static void print_gamma(xf86VdifGammaPtr *pg); --static void print_type(CARD8 c); --static void print_polarity(CARD8 c); -- --void --xf86print_vdif(xf86vdifPtr v) --{ -- print_vdif(v->vdif,v->strings); -- print_limits(v->limits); -- print_timings(v->timings); -- print_gamma(v->gamma); --} -- --static void --print_vdif(xf86VdifPtr l, char *s) --{ -- ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision); -- ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0], -- l->Date[1],l->Date[2],l->DateManufactured[0], -- l->DateManufactured[1],l->DateManufactured[2]); -- ErrorF("File Revision: %i",l->FileRevision); -- ErrorF("Manufacturer: %s\n",s + l->Manufacturer); -- ErrorF("ModelNumber: %s\n",s + l->ModelNumber); -- ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex); -- ErrorF("Version: %s\n",s + l->Version); -- ErrorF("SerialNumber %s\n",s + l->SerialNumber); -- ErrorF("MonitorType: "); -- switch (l->MonitorType) { -- case VDIF_MONITOR_MONOCHROME: -- ErrorF("Mono\n"); -- break; -- case VDIF_MONITOR_COLOR: -- ErrorF("Color\n"); -- break; -- } -- ErrorF("CRT Size: %i inches\n",l->CRTSize); -- switch (l->MonitorType) { -- case VDIF_MONITOR_MONOCHROME: -- ErrorF("Border: %i percent\n", -- l->BorderRed); -- ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay); -- if (l->GreenPhosphorDecay !=0) -- ErrorF(" 2: %i,",l->GreenPhosphorDecay); -- if (l->BluePhosphorDecay !=0) -- ErrorF(" 3: %i",l->BluePhosphorDecay); -- ErrorF(" ms\n"); -- if (l->RedChromaticity_x) -- ErrorF("Chromaticity: 1: x:%f, y:%f; ", -- l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0); -- if (l->GreenChromaticity_x) -- ErrorF("Chromaticity: 2: x:%f, y:%f; ", -- l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0); -- if (l->BlueChromaticity_x) -- ErrorF("Chromaticity: 3: x:%f, y:%f ", -- l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0); -- ErrorF("\n"); -- ErrorF("Gamma: %f\n",l->RedGamma/1000.0); -- break; -- case VDIF_MONITOR_COLOR: -- ErrorF("Border: Red: %i Green: %i Blue: %i percent\n", -- l->BorderRed,l->BorderGreen,l->BorderBlue); -- ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n", -- l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay); -- ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; " -- "Blue: x:%f, y:%f\n", -- l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0, -- l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0, -- l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0); -- ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0, -- l->GreenGamma/1000.0,l->BlueGamma/1000.0); -- break; -- } -- ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0, -- l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0); --} -- --static void --print_limits(xf86VdifLimitsPtr *pl) --{ -- int i = 0; -- xf86VdifLimitsPtr l; -- -- while((l = pl[i]) != NULL) { -- ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel, -- l->MaxVerPixel); -- ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength, -- l->MaxVerActiveHeight); -- ErrorF("Video Type: "); -- print_type(l->VideoType); -- ErrorF("Sync Type: "); -- print_type(l->SyncType); -- ErrorF("Sync Configuration "); -- switch (l->SyncConfiguration) { -- case VDIF_SYNC_SEPARATE: -- ErrorF("separate\n"); -- break; -- case VDIF_SYNC_C: -- ErrorF("composite C\n"); -- break; -- case VDIF_SYNC_CP: -- ErrorF("composite CP\n"); -- break; -- case VDIF_SYNC_G: -- ErrorF("composite G\n"); -- break; -- case VDIF_SYNC_GP: -- ErrorF("composite GP\n"); -- break; -- case VDIF_SYNC_OTHER: -- ErrorF("other\n"); -- break; -- } -- ErrorF("Termination Resistance: %i\n",l->TerminationResistance); -- ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n", -- l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel); -- ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0); -- ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n", -- l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0, -- l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0); -- ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0, -- l->MinVerRetrace/1000.0); -- } --} -- --static void --print_timings(xf86VdifTimingPtr *pt) --{ -- int i = 0; -- xf86VdifTimingPtr t; -- -- while((t = pt[i]) != NULL) { -- ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName); -- ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel); -- ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight); -- ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio); -- ErrorF("Character width: %i",t->CharacterWidth); -- ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0, -- t->HorFrequency/1000.0,t->VerFrequency/1000.0); -- ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0, -- t->VerTotalTime/1000.0); -- ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, " -- "HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0, -- t->HorBlankStart/1000.0,t->HorBlankTime/1000.0, -- t->HorSyncStart/1000.0,t->HorSyncTime/1000.0); -- ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, " -- "VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0, -- t->VerBlankStart/1000.0,t->VerBlankTime/1000.0, -- t->VerSyncStart/1000.0,t->VerSyncTime/1000.0); -- ErrorF("Scan Type: "); -- switch (t->ScanType) { -- case VDIF_SCAN_INTERLACED: -- ErrorF("interlaced "); -- break; -- case VDIF_SCAN_NONINTERLACED: -- ErrorF("non interlaced "); -- break; -- case VDIF_SCAN_OTHER: -- ErrorF("other "); -- break; -- } -- ErrorF("Polarity: H: "); -- print_polarity(t->HorSyncPolarity); -- ErrorF("V: "); -- print_polarity(t->VerSyncPolarity); -- ErrorF("\n"); -- } --} -- --static void --print_gamma(xf86VdifGammaPtr *pg) --{ -- int i = 0; -- xf86VdifGammaPtr g; -- -- while((g = pg[i]) != NULL) { -- ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries); -- } --} -- --static void --print_type(CARD8 c) --{ -- switch (c) { -- case VDIF_VIDEO_TTL : -- ErrorF("TTL\n"); -- break; -- case VDIF_VIDEO_ANALOG : -- ErrorF("Analog\n"); -- break; -- case VDIF_VIDEO_ECL: -- ErrorF("ECL\n"); -- break; -- case VDIF_VIDEO_DECL: -- ErrorF("DECL\n"); -- break; -- case VDIF_VIDEO_OTHER: -- ErrorF("other\n"); -- break; -- } --} -- --static void --print_polarity(CARD8 c) --{ -- switch (c) { -- case VDIF_POLARITY_NEGATIVE: -- ErrorF(" Neg."); -- break; -- case VDIF_POLARITY_POSITIVE: -- ErrorF(" Pos."); -- break; -- } --} -diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h -deleted file mode 100644 -index 1777b68..0000000 ---- a/hw/xfree86/ddc/vdif.h -+++ /dev/null -@@ -1,174 +0,0 @@ -- --#ifndef _VDIF_H --#define _VDIF_H -- --#define VDIF_MONITOR_MONOCHROME 0 --#define VDIF_MONITOR_COLOR 1 --#define VDIF_VIDEO_TTL 0 --#define VDIF_VIDEO_ANALOG 1 --#define VDIF_VIDEO_ECL 2 --#define VDIF_VIDEO_DECL 3 --#define VDIF_VIDEO_OTHER 4 --#define VDIF_SYNC_SEPARATE 0 --#define VDIF_SYNC_C 1 --#define VDIF_SYNC_CP 2 --#define VDIF_SYNC_G 3 --#define VDIF_SYNC_GP 4 --#define VDIF_SYNC_OTHER 5 --#define VDIF_SCAN_NONINTERLACED 0 --#define VDIF_SCAN_INTERLACED 1 --#define VDIF_SCAN_OTHER 2 --#define VDIF_POLARITY_NEGATIVE 0 --#define VDIF_POLARITY_POSITIVE 1 -- --#include -- --#undef CARD32 --#define CARD32 unsigned int /* ... on all supported platforms */ -- --typedef struct _VDIF { /* Monitor Description: */ -- CARD8 VDIFId[4]; /* alway "VDIF" */ -- CARD32 FileLength; /* lenght of the whole file */ -- CARD32 Checksum; /* sum of all bytes in the file after*/ -- /* this field */ -- CARD16 VDIFVersion; /* structure version number */ -- CARD16 VDIFRevision; /* structure revision number */ -- CARD16 Date[3]; /* file date Year/Month/Day */ -- CARD16 DateManufactured[3]; /* date Year/Month/Day */ -- CARD32 FileRevision; /* file revision string */ -- CARD32 Manufacturer; /* ASCII ID of the manufacturer */ -- CARD32 ModelNumber; /* ASCII ID of the model */ -- CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */ -- CARD32 Version; /* ASCII ID of the model version */ -- CARD32 SerialNumber; /* ASCII ID of the serial number */ -- CARD8 MonitorType; /* Monochrome or Color */ -- CARD8 CRTSize; /* inches */ -- CARD8 BorderRed; /* percent */ -- CARD8 BorderGreen; /* percent */ -- CARD8 BorderBlue; /* percent */ -- CARD8 Reserved1; /* padding */ -- CARD16 Reserved2; /* padding */ -- CARD32 RedPhosphorDecay; /* microseconds */ -- CARD32 GreenPhosphorDecay; /* microseconds */ -- CARD32 BluePhosphorDecay; /* microseconds */ -- CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */ -- CARD16 WhitePoint_y; -- CARD16 WhitePoint_Y; -- CARD16 RedChromaticity_x; /* Red chromaticity in x,y */ -- CARD16 RedChromaticity_y; -- CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */ -- CARD16 GreenChromaticity_y; -- CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */ -- CARD16 BlueChromaticity_y; -- CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */ -- CARD16 GreenGamma; -- CARD16 BlueGamma; -- CARD32 NumberOperationalLimits; -- CARD32 OffsetOperationalLimits; -- CARD32 NumberOptions; /* optinal sections (gamma table) */ -- CARD32 OffsetOptions; -- CARD32 OffsetStringTable; --} xf86VdifRec, *xf86VdifPtr; -- --typedef enum { /* Tags for section identification */ -- VDIF_OPERATIONAL_LIMITS_TAG = 1, -- VDIF_PREADJUSTED_TIMING_TAG, -- VDIF_GAMMA_TABLE_TAG --} VDIFScnTag; -- --typedef struct _VDIFScnHdr { /* Generic Section Header: */ -- CARD32 ScnLength; /* lenght of section */ -- CARD32 ScnTag; /* tag for section identification */ --} VDIFScnHdrRec, *VDIFScnHdrPtr; -- --typedef struct _VDIFLimits { /* Operational Limits: */ -- VDIFScnHdrRec Header; /* common section info */ -- CARD16 MaxHorPixel; /* pixels */ -- CARD16 MaxVerPixel; /* lines */ -- CARD16 MaxHorActiveLength; /* millimeters */ -- CARD16 MaxVerActiveHeight; /* millimeters */ -- CARD8 VideoType; /* TTL / Analog / ECL / DECL */ -- CARD8 SyncType; /* TTL / Analog / ECL / DECL */ -- CARD8 SyncConfiguration; /* separate / composite / other */ -- CARD8 Reserved1; /* padding */ -- CARD16 Reserved2; /* padding */ -- CARD16 TerminationResistance; /* */ -- CARD16 WhiteLevel; /* millivolts */ -- CARD16 BlackLevel; /* millivolts */ -- CARD16 BlankLevel; /* millivolts */ -- CARD16 SyncLevel; /* millivolts */ -- CARD32 MaxPixelClock; /* kiloHertz */ -- CARD32 MinHorFrequency; /* Hertz */ -- CARD32 MaxHorFrequency; /* Hertz */ -- CARD32 MinVerFrequency; /* milliHertz */ -- CARD32 MaxVerFrequency; /* milliHertz */ -- CARD16 MinHorRetrace; /* nanoseconds */ -- CARD16 MinVerRetrace; /* microseconds */ -- CARD32 NumberPreadjustedTimings; -- CARD32 OffsetNextLimits; --} xf86VdifLimitsRec, *xf86VdifLimitsPtr; -- --typedef struct _VDIFTiming { /* Preadjusted Timing: */ -- VDIFScnHdrRec Header; /* common section info */ -- CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */ -- CARD16 HorPixel; /* pixels */ -- CARD16 VerPixel; /* lines */ -- CARD16 HorAddrLength; /* millimeters */ -- CARD16 VerAddrHeight; /* millimeters */ -- CARD8 PixelWidthRatio; /* gives H:V */ -- CARD8 PixelHeightRatio; -- CARD8 Reserved1; /* padding */ -- CARD8 ScanType; /* noninterlaced / interlaced / other*/ -- CARD8 HorSyncPolarity; /* negative / positive */ -- CARD8 VerSyncPolarity; /* negative / positive */ -- CARD16 CharacterWidth; /* pixels */ -- CARD32 PixelClock; /* kiloHertz */ -- CARD32 HorFrequency; /* Hertz */ -- CARD32 VerFrequency; /* milliHertz */ -- CARD32 HorTotalTime; /* nanoseconds */ -- CARD32 VerTotalTime; /* microseconds */ -- CARD16 HorAddrTime; /* nanoseconds */ -- CARD16 HorBlankStart; /* nanoseconds */ -- CARD16 HorBlankTime; /* nanoseconds */ -- CARD16 HorSyncStart; /* nanoseconds */ -- CARD16 HorSyncTime; /* nanoseconds */ -- CARD16 VerAddrTime; /* microseconds */ -- CARD16 VerBlankStart; /* microseconds */ -- CARD16 VerBlankTime; /* microseconds */ -- CARD16 VerSyncStart; /* microseconds */ -- CARD16 VerSyncTime; /* microseconds */ --} xf86VdifTimingRec, *xf86VdifTimingPtr; -- --typedef struct _VDIFGamma { /* Gamma Table: */ -- VDIFScnHdrRec Header; /* common section info */ -- CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */ -- CARD16 Unused1; --} xf86VdifGammaRec, *xf86VdifGammaPtr; -- --/* access macros */ --#define VDIF_OPERATIONAL_LIMITS(vdif) \ --((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits)) --#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \ -- ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits)) --#define VDIF_PREADJUSTED_TIMING(limits) \ --((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength)) --#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \ -- ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength)) --#define VDIF_OPTIONS(vdif) \ -- ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions)) --#define VDIF_NEXT_OPTIONS(options) options = \ -- ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength)) --#define VDIF_STRING(vdif, string) \ -- ((char*)((char*)vdif + vdif->OffsetStringTable + (string))) -- --typedef struct _vdif { -- xf86VdifPtr vdif; -- xf86VdifLimitsPtr *limits; -- xf86VdifTimingPtr *timings; -- xf86VdifGammaPtr *gamma; -- char * strings; --} xf86vdif, *xf86vdifPtr; -- --#undef CARD32 -- --#endif -diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c -index 8080c8d..e47b8b8 100644 ---- a/hw/xfree86/ddc/xf86DDC.c -+++ b/hw/xfree86/ddc/xf86DDC.c -@@ -15,52 +15,6 @@ - - static const OptionInfoRec *DDCAvailableOptions(void *unused); - --#if DDC_MODULE -- --static MODULESETUPPROTO(ddcSetup); -- --static XF86ModuleVersionInfo ddcVersRec = --{ -- "ddc", -- MODULEVENDORSTRING, -- MODINFOSTRING1, -- MODINFOSTRING2, -- XORG_VERSION_CURRENT, -- 1, 0, 0, -- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */ -- ABI_VIDEODRV_VERSION, -- MOD_CLASS_NONE, -- {0,0,0,0} --}; -- --_X_EXPORT XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL }; -- --ModuleInfoRec DDC = { -- 1, -- "DDC", -- NULL, -- 0, -- DDCAvailableOptions, --}; -- --static pointer --ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin) --{ -- static Bool setupDone = FALSE; -- -- if (!setupDone) { -- setupDone = TRUE; -- xf86AddModuleInfo(&DDC, module); -- } -- /* -- * The return value must be non-NULL on success even though there -- * is no TearDownProc. -- */ -- return (pointer)1; --} -- --#endif -- - #define RETRIES 4 - - static unsigned char *EDIDRead_DDC1( -@@ -84,12 +38,6 @@ static unsigned char* EDID1Read_DDC2( - I2CBusPtr pBus - ); - --static unsigned char * VDIFRead( -- int scrnIndex, -- I2CBusPtr pBus, -- int start --); -- - static unsigned char * DDCRead_DDC2( - int scrnIndex, - I2CBusPtr pBus, -@@ -184,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) - { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - unsigned char *EDID_block = NULL; -- unsigned char *VDIF_Block = NULL; - xf86MonPtr tmp = NULL; - /* Default DDC and DDC2 to enabled. */ - Bool noddc = FALSE, noddc2 = FALSE; -@@ -217,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) - else - ErrorF("Sections to follow: %i\n",tmp->no_sections); - #endif -- if (tmp) { -- VDIF_Block = -- VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1)); -- tmp->vdif = xf86InterpretVdif(VDIF_Block); -- } - - return tmp; - } -@@ -299,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus) - return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN); - } - --static unsigned char* --VDIFRead(int scrnIndex, I2CBusPtr pBus, int start) --{ -- unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL; -- int i, num = 0; -- -- /* read VDIF length in 64 byte blocks */ -- Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64); -- if (Buffer == NULL) -- return NULL; --#ifdef DEBUG -- ErrorF("number of 64 bit blocks: %i\n",Buffer[0]); --#endif -- if ((num = Buffer[0]) > 0) -- v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num); -- -- for (i = 0; i < num; i++) { -- Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64); -- if (Buffer == NULL) { -- xfree (v_buffer); -- return NULL; -- } -- memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */ -- xfree(Buffer); -- v_bufferp += 63; -- } -- return v_buffer; --} -- - static unsigned char * - DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) - { -diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h -index 5def97a..3b072dd 100644 ---- a/hw/xfree86/ddc/xf86DDC.h -+++ b/hw/xfree86/ddc/xf86DDC.h -@@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID( - int screenIndex, Uchar *block - ); - --extern xf86vdifPtr xf86InterpretVdif( -- CARD8 *c --); -- - extern void - xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC); - -@@ -55,9 +51,7 @@ extern Bool xf86SetDDCproperties( - xf86MonPtr DDC - ); - --extern void xf86print_vdif( -- xf86vdifPtr v --); -+DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); - - #endif - -diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c -index 09d6681..185eb80 100644 ---- a/hw/xfree86/loader/xf86sym.c -+++ b/hw/xfree86/loader/xf86sym.c -@@ -1237,13 +1203,12 @@ _X_HIDDEN void *xfree86LookupTab[] = { - SYMFUNC(xf86_show_cursors) - SYMFUNC(xf86_hide_cursors) - SYMFUNC(xf86_cursors_fini) -+ SYMFUNC(xf86_crtc_clip_video_helper) - - SYMFUNC(xf86DoEDID_DDC1) - SYMFUNC(xf86DoEDID_DDC2) - SYMFUNC(xf86InterpretEDID) - SYMFUNC(xf86PrintEDID) -- SYMFUNC(xf86InterpretVdif) -- SYMFUNC(xf86print_vdif) - SYMFUNC(xf86DDCMonitorSet) - SYMFUNC(xf86SetDDCproperties) - -diff --git a/randr/Makefile.am b/randr/Makefile.am -index 9bf0e65..20b0f72 100644 ---- a/randr/Makefile.am -+++ b/randr/Makefile.am -@@ -2,6 +2,8 @@ noinst_LTLIBRARIES = librandr.la - - AM_CFLAGS = $(DIX_CFLAGS) - -+XINERAMA_SRCS = rrxinerama.c -+ - if XORG - sdk_HEADERS = randrstr.h - endif -@@ -18,5 +20,9 @@ librandr_la_SOURCES = \ - rrpointer.c \ - rrproperty.c \ - rrscreen.c \ -- rrsdispatch.c \ -- rrxinerama.c -+ rrsdispatch.c -+ -+if XINERAMA -+librandr_la_SOURCES += ${XINERAMA_SRCS} -+endif -+ -diff --git a/randr/randr.c b/randr/randr.c -index 4dd0ee5..958f9c1 100644 ---- a/randr/randr.c -+++ b/randr/randr.c -@@ -358,8 +358,9 @@ RRExtensionInit (void) - SRRScreenChangeNotifyEvent; - EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) - SRRNotifyEvent; -- -+#ifdef PANORAMIX - RRXineramaExtensionInit(); -+#endif - } - - static int -diff --git a/randr/randrstr.h b/randr/randrstr.h -index 6deaf47..bd19fe9 100644 ---- a/randr/randrstr.h -+++ b/randr/randrstr.h -@@ -564,6 +564,7 @@ RRCrtcGammaSetSize (RRCrtcPtr crtc, - * Return the area of the frame buffer scanned out by the crtc, - * taking into account the current mode and rotation - */ -+ - void - RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height); - -@@ -693,9 +694,6 @@ RROutputSetCrtcs (RROutputPtr output, - RRCrtcPtr *crtcs, - int numCrtcs); - --void --RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc); -- - Bool - RROutputSetConnection (RROutputPtr output, - CARD8 connection); -@@ -801,7 +799,6 @@ Query state: - 1.2: - RRScreenSetSizeRange - RROutputSetCrtcs -- RROutputSetCrtc - RRModeGet - RROutputSetModes - RROutputSetConnection -@@ -821,7 +818,6 @@ Query state: - RRCrtcCreate - RROutputCreate - RROutputSetCrtcs -- RROutputSetCrtc - RROutputSetConnection - RROutputSetSubpixelOrder - RROldModeAdd • This adds modes one-at-a-time -diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c -index 63da829..db5007e 100644 ---- a/randr/rrcrtc.c -+++ b/randr/rrcrtc.c -@@ -134,6 +134,7 @@ RRCrtcNotify (RRCrtcPtr crtc, - break; - if (j == crtc->numOutputs) - { -+ outputs[i]->crtc = crtc; - RROutputChanged (outputs[i], FALSE); - RRCrtcChanged (crtc, FALSE); - } -@@ -149,6 +150,7 @@ RRCrtcNotify (RRCrtcPtr crtc, - break; - if (i == numOutputs) - { -+ crtc->outputs[j]->crtc = NULL; - RROutputChanged (crtc->outputs[j], FALSE); - RRCrtcChanged (crtc, FALSE); - } -@@ -507,7 +509,7 @@ RRCrtcInit (void) - int - ProcRRGetCrtcInfo (ClientPtr client) - { -- REQUEST(xRRGetCrtcInfoReq);; -+ REQUEST(xRRGetCrtcInfoReq); - xRRGetCrtcInfoReply rep; - RRCrtcPtr crtc; - CARD8 *extra; -@@ -794,7 +796,7 @@ ProcRRSetCrtcConfig (ClientPtr client) - int source_width = mode->mode.width; - int source_height = mode->mode.height; - -- if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270) -+ if ((rotation & 0xf) == RR_Rotate_90 || (rotation & 0xf) == RR_Rotate_270) - { - source_width = mode->mode.height; - source_height = mode->mode.width; -diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c -index 6b61b9c..5525427 100644 ---- a/randr/rrdispatch.c -+++ b/randr/rrdispatch.c -@@ -22,6 +22,9 @@ - - #include "randrstr.h" - -+#define SERVER_RANDR_MAJOR 1 -+#define SERVER_RANDR_MINOR 2 -+ - Bool - RRClientKnowsRates (ClientPtr pClient) - { -@@ -49,8 +52,8 @@ ProcRRQueryVersion (ClientPtr client) - * Report the current version; the current - * spec says they're all compatible after 1.0 - */ -- rep.majorVersion = RANDR_MAJOR; -- rep.minorVersion = RANDR_MINOR; -+ rep.majorVersion = SERVER_RANDR_MAJOR; -+ rep.minorVersion = SERVER_RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); -diff --git a/randr/rrinfo.c b/randr/rrinfo.c -index 5ef1a6b..7e77d39 100644 ---- a/randr/rrinfo.c -+++ b/randr/rrinfo.c -@@ -98,17 +98,18 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) - if (!output) - return; - RROutputSetCrtcs (output, &crtc, 1); -- RROutputSetCrtc (output, crtc); - RROutputSetConnection (output, RR_Connected); - #ifdef RENDER - RROutputSetSubpixelOrder (output, PictureGetSubpixelOrder (pScreen)); - #endif - } - -- output = RRFirstOutput (pScreen); -+ output = pScrPriv->outputs[0]; - if (!output) - return; -- crtc = output->crtc; -+ crtc = pScrPriv->crtcs[0]; -+ if (!crtc) -+ return; - - /* check rotations */ - if (rotations != crtc->rotations) -@@ -168,7 +169,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) - - /* notice current mode */ - if (newMode) -- RRCrtcNotify (output->crtc, newMode, 0, 0, pScrPriv->rotation, -+ RRCrtcNotify (crtc, newMode, 0, 0, pScrPriv->rotation, - 1, &output); - } - #endif -diff --git a/randr/rroutput.c b/randr/rroutput.c -index c773279..a67e493 100644 ---- a/randr/rroutput.c -+++ b/randr/rroutput.c -@@ -249,6 +249,7 @@ RROutputDeleteUserMode (RROutputPtr output, - - memmove (output->userModes + m, output->userModes + m + 1, - (output->numUserModes - m - 1) * sizeof (RRModePtr)); -+ output->numUserModes--; - RRModeDestroy (mode); - return Success; - } -@@ -286,15 +287,6 @@ RROutputSetCrtcs (RROutputPtr output, - return TRUE; - } - --void --RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc) --{ -- if (output->crtc == crtc) -- return; -- output->crtc = crtc; -- RROutputChanged (output, FALSE); --} -- - Bool - RROutputSetConnection (RROutputPtr output, - CARD8 connection) -@@ -438,7 +430,7 @@ RROutputInit (void) - int - ProcRRGetOutputInfo (ClientPtr client) - { -- REQUEST(xRRGetOutputInfoReq);; -+ REQUEST(xRRGetOutputInfoReq); - xRRGetOutputInfoReply rep; - RROutputPtr output; - CARD8 *extra; -diff --git a/randr/rrpointer.c b/randr/rrpointer.c -index 802dcb2..c88a0f8 100644 ---- a/randr/rrpointer.c -+++ b/randr/rrpointer.c -@@ -103,7 +103,7 @@ void - RRPointerMoved (ScreenPtr pScreen, int x, int y) - { - rrScrPriv (pScreen); -- RRCrtcPtr pointerCrtc = pScrPriv->pointerCrtc;; -+ RRCrtcPtr pointerCrtc = pScrPriv->pointerCrtc; - int c; - - /* Check last known CRTC */ -diff --git a/randr/rrscreen.c b/randr/rrscreen.c -index f2981b0..8798b42 100644 ---- a/randr/rrscreen.c -+++ b/randr/rrscreen.c -@@ -116,11 +116,19 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) - - se.sequenceNumber = client->sequence; - se.sizeID = RR10CurrentSizeID (pScreen); -- -- se.widthInPixels = pScreen->width; -- se.heightInPixels = pScreen->height; -- se.widthInMillimeters = pScreen->mmWidth; -- se.heightInMillimeters = pScreen->mmHeight; -+ -+ if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { -+ se.widthInPixels = pScreen->height; -+ se.heightInPixels = pScreen->width; -+ se.widthInMillimeters = pScreen->mmHeight; -+ se.heightInMillimeters = pScreen->mmWidth; -+ } else { -+ se.widthInPixels = pScreen->width; -+ se.heightInPixels = pScreen->height; -+ se.widthInMillimeters = pScreen->mmWidth; -+ se.heightInMillimeters = pScreen->mmHeight; -+ } -+ - WriteEventsToClient (client, 1, (xEvent *) &se); - } - -@@ -738,6 +738,7 @@ ProcRRSetScreenConfig (ClientPtr client) - int rate; - Bool has_rate; - RROutputPtr output; -+ RRCrtcPtr crtc; - RRModePtr mode; - RR10DataPtr pData = NULL; - RRScreenSizePtr pSize; -@@ -782,7 +784,9 @@ ProcRRSetScreenConfig (ClientPtr client) - rep.status = RRSetConfigFailed; - goto sendReply; - } -- -+ -+ crtc = output->crtc; -+ - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and -@@ -830,7 +834,7 @@ ProcRRSetScreenConfig (ClientPtr client) - return BadValue; - } - -- if ((~output->crtc->rotations) & rotation) -+ if ((~crtc->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen -@@ -913,7 +917,7 @@ ProcRRSetScreenConfig (ClientPtr client) - } - } - -- if (!RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, 1, &output)) -+ if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output)) - rep.status = RRSetConfigFailed; - else - rep.status = RRSetConfigSuccess; -diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c -index 63a34b5..2a57e4e 100644 ---- a/randr/rrxinerama.c -+++ b/randr/rrxinerama.c -@@ -425,6 +428,14 @@ RRXineramaExtensionInit(void) - return; - #endif - -+ /* -+ * Xinerama isn't capable enough to have multiple protocol screens each -+ * with their own output geometry. So if there's more than one protocol -+ * screen, just don't even try. -+ */ -+ if (screenInfo.numScreens > 1) -+ return; -+ - (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0, - ProcRRXineramaDispatch, - SProcRRXineramaDispatch, diff --git a/xserver-1.3.0-randrama-no-zero-screens.patch b/xserver-1.3.0-randrama-no-zero-screens.patch deleted file mode 100644 index 4862198..0000000 --- a/xserver-1.3.0-randrama-no-zero-screens.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- xorg-server-1.3.0.0/randr/rrxinerama.c.jx 2007-05-17 17:07:31.000000000 -0400 -+++ xorg-server-1.3.0.0/randr/rrxinerama.c 2007-05-31 21:41:13.000000000 -0400 -@@ -147,12 +147,6 @@ - } - - static Bool --RRXineramaScreenActive (ScreenPtr pScreen) --{ -- return rrGetScrPriv(pScreen) != NULL; --} -- --static Bool - RRXineramaCrtcActive (RRCrtcPtr crtc) - { - return crtc->mode != NULL && crtc->numOutputs > 0; -@@ -164,7 +158,7 @@ - int i, n; - - n = 0; -- if (RRXineramaScreenActive (pScreen)) -+ if (rrGetScrPriv (pScreen)) - { - rrScrPriv(pScreen); - for (i = 0; i < pScrPriv->numCrtcs; i++) -@@ -174,6 +168,12 @@ - return n; - } - -+static Bool -+RRXineramaScreenActive (ScreenPtr pScreen) -+{ -+ return RRXineramaScreenCount (pScreen) > 0; -+} -+ - int - ProcRRXineramaGetScreenCount(ClientPtr client) - { diff --git a/xserver-1.3.0-reput-video.patch b/xserver-1.3.0-reput-video.patch deleted file mode 100644 index 9f921e6..0000000 --- a/xserver-1.3.0-reput-video.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Michel Dänzer -Date: Thu, 24 May 2007 10:10:05 +0000 (+0200) -Subject: Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow. -X-Git-Url: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=649e7f82d8d4333443493056b81eb20d6cf022bc - -Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow. - -This avoids a crash in xf86XVReputVideo and also cleans up the code slightly. ---- - ---- a/hw/xfree86/common/xf86xv.c -+++ b/hw/xfree86/common/xf86xv.c -@@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, - winPriv->next = PrivRoot; - pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv; - } -+ -+ portPriv->pDraw = (DrawablePtr)pWin; -+ - return Success; - } - -@@ -1375,7 +1378,6 @@ xf86XVPutVideo( - result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); - if(result != Success) return result; - -- portPriv->pDraw = pDraw; - portPriv->type = XvInputMask; - - /* save a copy of these parameters */ -@@ -1479,7 +1481,6 @@ xf86XVPutStill( - - xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); - portPriv->isOn = XV_ON; -- portPriv->pDraw = pDraw; - portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; - portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; - portPriv->type = 0; /* no mask means it's transient and should -@@ -1529,7 +1530,6 @@ xf86XVGetVideo( - result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); - if(result != Success) return result; - -- portPriv->pDraw = pDraw; - portPriv->type = XvOutputMask; - - /* save a copy of these parameters */ -@@ -1784,7 +1784,6 @@ xf86XVPutImage( - (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { - - portPriv->isOn = XV_ON; -- portPriv->pDraw = pDraw; - portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; - portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; - portPriv->type = 0; /* no mask means it's transient and should diff --git a/xserver-1.3.0-update-quirks.patch b/xserver-1.3.0-update-quirks.patch deleted file mode 100644 index 091e280..0000000 --- a/xserver-1.3.0-update-quirks.patch +++ /dev/null @@ -1,291 +0,0 @@ -From: Eric Anholt -Date: Thu, 11 Oct 2007 23:48:56 +0000 (-0700) -Subject: Bug #10304,12784,11603: Add quirks for several physical size issues. -X-Git-Url: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=fc092334ac0a323b80a9602cb8bf60ca9dee3bfa - -Bug #10304,12784,11603: Add quirks for several physical size issues. - -A lot of EDID writers apparently end up stuffing centimeters (like the -maximum image size field) into the detailed timings, instead of millimeters. -Some of them only get it wrong in one direction. Also, add a quirk to let -us mark the largest 75hz mode as preferred, which will often be used for -EDID 1.0 CRTs. ---- - ---- a/hw/xfree86/modes/xf86Crtc.c -+++ b/hw/xfree86/modes/xf86Crtc.c -@@ -2134,8 +2134,12 @@ _X_EXPORT xf86MonPtr - xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) - { - ScrnInfoPtr scrn = output->scrn; -+ xf86MonPtr mon; - -- return xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus); -+ mon = xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus); -+ xf86DDCApplyQuirks (scrn->scrnIndex, pDDCBus); -+ -+ return mon; - } - - static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", ---- a/hw/xfree86/modes/xf86EdidModes.c -+++ b/hw/xfree86/modes/xf86EdidModes.c -@@ -54,6 +54,16 @@ typedef enum { - DDC_QUIRK_PREFER_LARGE_60 = 1 << 0, - /* 135MHz clock is too high, drop a bit */ - DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1, -+ /* Prefer the largest mode at 75 Hz */ -+ DDC_QUIRK_PREFER_LARGE_75 = 1 << 2, -+ /* Convert detailed timing's horizontal from units of cm to mm */ -+ DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3, -+ /* Convert detailed timing's vertical from units of cm to mm */ -+ DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4, -+ /* Detailed timing descriptors have bogus size values, so just take the -+ * maximum size and use that. -+ */ -+ DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5, - } ddc_quirk_t; - - static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC) -@@ -81,6 +91,52 @@ static Bool quirk_prefer_large_60 (int s - return FALSE; - } - -+static Bool quirk_prefer_large_75 (int scrnIndex, xf86MonPtr DDC) -+{ -+ /* Bug #11603: Funai Electronics PM36B */ -+ if (memcmp (DDC->vendor.name, "FCM", 4) == 0 && -+ DDC->vendor.prod_id == 13600) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static Bool quirk_detailed_h_in_cm (int scrnIndex, xf86MonPtr DDC) -+{ -+ /* Bug #10304: "LGPhilipsLCD LP154W01-A5" */ -+ /* Bug #12784: "LGPhilipsLCD LP154W01-TLA2" */ -+ if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && -+ DDC->vendor.prod_id == 0) -+ return TRUE; -+ -+ /* Bug #11603: Funai Electronics PM36B */ -+ if (memcmp (DDC->vendor.name, "FCM", 4) == 0 && -+ DDC->vendor.prod_id == 13600) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC) -+{ -+ /* Bug #11603: Funai Electronics PM36B */ -+ if (memcmp (DDC->vendor.name, "FCM", 4) == 0 && -+ DDC->vendor.prod_id == 13600) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC) -+{ -+ /* Bug #10304: LGPhilipsLCD LP154W01-A5 */ -+ if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && -+ DDC->vendor.prod_id == 0) -+ return TRUE; -+ -+ return FALSE; -+} -+ - static Bool quirk_135_clock_too_high (int scrnIndex, xf86MonPtr DDC) - { - /* Envision Peripherals, Inc. EN-7100e. See bug #9550. */ -@@ -106,6 +162,22 @@ static const ddc_quirk_map_t ddc_quirks[ - quirk_135_clock_too_high, DDC_QUIRK_135_CLOCK_TOO_HIGH, - "Recommended 135MHz pixel clock is too high" - }, -+ { -+ quirk_prefer_large_75, DDC_QUIRK_PREFER_LARGE_75, -+ "Detailed timing is not preferred, use largest mode at 75Hz" -+ }, -+ { -+ quirk_detailed_h_in_cm, DDC_QUIRK_DETAILED_H_IN_CM, -+ "Detailed timings give horizontal size in cm." -+ }, -+ { -+ quirk_detailed_v_in_cm, DDC_QUIRK_DETAILED_V_IN_CM, -+ "Detailed timings give vertical size in cm." -+ }, -+ { -+ quirk_detailed_use_maximum_size, DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE, -+ "Detailed timings give sizes in cm." -+ }, - { - NULL, DDC_QUIRK_NONE, - "No known quirks" -@@ -303,6 +375,98 @@ DDCGuessRangesFromModes(int scrnIndex, M - } - } - -+static ddc_quirk_t -+xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose) -+{ -+ ddc_quirk_t quirks; -+ int i; -+ -+ quirks = DDC_QUIRK_NONE; -+ for (i = 0; ddc_quirks[i].detect; i++) { -+ if (ddc_quirks[i].detect (scrnIndex, DDC)) { -+ if (verbose) { -+ xf86DrvMsg (scrnIndex, X_INFO, " EDID quirk: %s\n", -+ ddc_quirks[i].description); -+ } -+ quirks |= ddc_quirks[i].quirk; -+ } -+ } -+ -+ return quirks; -+} -+ -+/** -+ * Applies monitor-specific quirks to the decoded EDID information. -+ * -+ * Note that some quirks applying to the mode list are still implemented in -+ * xf86DDCGetModes. -+ */ -+void -+xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC) -+{ -+ ddc_quirk_t quirks = xf86DDCDetectQuirks (scrnIndex, DDC, FALSE); -+ int i; -+ -+ for (i = 0; i < DET_TIMINGS; i++) { -+ struct detailed_monitor_section *det_mon = &DDC->det_mon[i]; -+ -+ if (det_mon->type != DT) -+ continue; -+ -+ if (quirks & DDC_QUIRK_DETAILED_H_IN_CM) -+ det_mon->section.d_timings.h_size *= 10; -+ -+ if (quirks & DDC_QUIRK_DETAILED_V_IN_CM) -+ det_mon->section.d_timings.v_size *= 10; -+ -+ if (quirks & DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE) { -+ det_mon->section.d_timings.h_size = 10 * DDC->features.hsize; -+ det_mon->section.d_timings.v_size = 10 * DDC->features.vsize; -+ } -+ } -+} -+ -+/** -+ * Walks the modes list, finding the mode with the largest area which is -+ * closest to the target refresh rate, and marks it as the only preferred mode. -+*/ -+static void -+xf86DDCSetPreferredRefresh(int scrnIndex, DisplayModePtr modes, -+ float target_refresh) -+{ -+ DisplayModePtr mode, best = modes; -+ -+ for (mode = modes; mode; mode = mode->next) -+ { -+ mode->type &= ~M_T_PREFERRED; -+ -+ if (mode == best) continue; -+ -+ if (mode->HDisplay * mode->VDisplay > -+ best->HDisplay * best->VDisplay) -+ { -+ best = mode; -+ continue; -+ } -+ if (mode->HDisplay * mode->VDisplay == -+ best->HDisplay * best->VDisplay) -+ { -+ double mode_refresh = xf86ModeVRefresh (mode); -+ double best_refresh = xf86ModeVRefresh (best); -+ double mode_dist = fabs(mode_refresh - target_refresh); -+ double best_dist = fabs(best_refresh - target_refresh); -+ -+ if (mode_dist < best_dist) -+ { -+ best = mode; -+ continue; -+ } -+ } -+ } -+ if (best) -+ best->type |= M_T_PREFERRED; -+} -+ - _X_EXPORT DisplayModePtr - xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) - { -@@ -312,15 +476,9 @@ xf86DDCGetModes(int scrnIndex, xf86MonPt - - xf86DrvMsg (scrnIndex, X_INFO, "EDID vendor \"%s\", prod id %d\n", - DDC->vendor.name, DDC->vendor.prod_id); -- quirks = DDC_QUIRK_NONE; -- for (i = 0; ddc_quirks[i].detect; i++) -- if (ddc_quirks[i].detect (scrnIndex, DDC)) -- { -- xf86DrvMsg (scrnIndex, X_INFO, " EDID quirk: %s\n", -- ddc_quirks[i].description); -- quirks |= ddc_quirks[i].quirk; -- } -- -+ -+ quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE); -+ - preferred = PREFERRED_TIMING_MODE(DDC->features.msc); - if (quirks & DDC_QUIRK_PREFER_LARGE_60) - preferred = 0; -@@ -357,32 +515,11 @@ xf86DDCGetModes(int scrnIndex, xf86MonPt - Modes = xf86ModesAdd(Modes, Mode); - - if (quirks & DDC_QUIRK_PREFER_LARGE_60) -- { -- DisplayModePtr best = Modes; -- for (Mode = Modes; Mode; Mode = Mode->next) -- { -- if (Mode == best) continue; -- if (Mode->HDisplay * Mode->VDisplay > best->HDisplay * best->VDisplay) -- { -- best = Mode; -- continue; -- } -- if (Mode->HDisplay * Mode->VDisplay == best->HDisplay * best->VDisplay) -- { -- double mode_refresh = xf86ModeVRefresh (Mode); -- double best_refresh = xf86ModeVRefresh (best); -- double mode_dist = fabs(mode_refresh - 60.0); -- double best_dist = fabs(best_refresh - 60.0); -- if (mode_dist < best_dist) -- { -- best = Mode; -- continue; -- } -- } -- } -- if (best) -- best->type |= M_T_PREFERRED; -- } -+ xf86DDCSetPreferredRefresh(scrnIndex, Modes, 60); -+ -+ if (quirks & DDC_QUIRK_PREFER_LARGE_75) -+ xf86DDCSetPreferredRefresh(scrnIndex, Modes, 75); -+ - return Modes; - } - ---- a/hw/xfree86/modes/xf86Modes.h -+++ b/hw/xfree86/modes/xf86Modes.h -@@ -95,4 +95,7 @@ xf86GetMonitorModes (ScrnInfoPtr pScrn, - DisplayModePtr - xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed); - -+void -+xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC); -+ - #endif /* _XF86MODES_H_ */ diff --git a/xserver-1.3.0-x86emu-imul-int64.patch b/xserver-1.3.0-x86emu-imul-int64.patch deleted file mode 100644 index 7cdb3c4..0000000 --- a/xserver-1.3.0-x86emu-imul-int64.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit 2fe74ef339c3a4902ae8214f5a0454662895422c -Author: Matthias Hopf -Date: Thu Mar 15 16:56:01 2007 +0100 - - Fix calculations in x86 emulator for the long long case (Andreas Schwab). - -diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c -index 461e09e..b9e7257 100644 ---- a/hw/xfree86/x86emu/prim_ops.c -+++ b/hw/xfree86/x86emu/prim_ops.c -@@ -2082,7 +2082,7 @@ Implements the IMUL instruction and side effects. - void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s) - { - #ifdef __HAS_LONG_LONG__ -- s64 res = (s32)d * (s32)s; -+ s64 res = (s64)(s32)d * (s32)s; - - *res_lo = (u32)res; - *res_hi = (u32)(res >> 32); -@@ -2174,7 +2174,7 @@ Implements the MUL instruction and side effects. - void mul_long(u32 s) - { - #ifdef __HAS_LONG_LONG__ -- u64 res = (u32)M.x86.R_EAX * (u32)s; -+ u64 res = (u64)M.x86.R_EAX * s; - - M.x86.R_EAX = (u32)res; - M.x86.R_EDX = (u32)(res >> 32); diff --git a/xserver-1.3.0-xkb-and-loathing.patch b/xserver-1.3.0-xkb-and-loathing.patch deleted file mode 100644 index 27775f1..0000000 --- a/xserver-1.3.0-xkb-and-loathing.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- xorg-server-1.3.0.0/os/utils.c.jx 2007-04-25 13:28:05.000000000 -0400 -+++ xorg-server-1.3.0.0/os/utils.c 2007-04-30 14:33:04.000000000 -0400 -@@ -1725,6 +1725,8 @@ - int pid; - } *pidlist; - -+static sighandler_t old_alarm = NULL; /* XXX horrible awful hack */ -+ - pointer - Popen(char *command, char *type) - { -@@ -1746,11 +1748,15 @@ - return NULL; - } - -+ /* Ignore the smart scheduler while this is going on */ -+ old_alarm = signal(SIGALRM, SIG_IGN); -+ - switch (pid = fork()) { - case -1: /* error */ - close(pdes[0]); - close(pdes[1]); - xfree(cur); -+ signal(SIGALRM, old_alarm); - return NULL; - case 0: /* child */ - if (setgid(getgid()) == -1) -@@ -1926,6 +1932,8 @@ - /* allow EINTR again */ - OsReleaseSignals (); - -+ signal(SIGALRM, old_alarm); -+ - return pid == -1 ? -1 : pstat; - } - diff --git a/xserver-1.3.0-xorg-conf-man-randr-update.patch b/xserver-1.3.0-xorg-conf-man-randr-update.patch deleted file mode 100644 index ffe70da..0000000 --- a/xserver-1.3.0-xorg-conf-man-randr-update.patch +++ /dev/null @@ -1,2374 +0,0 @@ -diff -up xorg-server-1.3.0.0/hw/xfree86/doc/man/xorg.conf.man.pre.da xorg-server-1.3.0.0/hw/xfree86/doc/man/xorg.conf.man.pre ---- xorg-server-1.3.0.0/hw/xfree86/doc/man/xorg.conf.man.pre.da 2007-10-05 11:43:43.000000000 +1000 -+++ xorg-server-1.3.0.0/hw/xfree86/doc/man/xorg.conf.man.pre 2007-10-05 11:43:52.000000000 +1000 -@@ -3,7 +3,7 @@ - .ds q \N'34' - .TH __xconfigfile__ __filemansuffix__ __vendorversion__ - .SH NAME --__xconfigfile__ - Configuration File for __xservername__ -+__xconfigfile__ \- configuration File for __xservername__ X server - .SH INTRODUCTION - .B __xservername__ - supports several mechanisms for supplying/obtaining configuration and -@@ -21,9 +21,10 @@ manual page. - .SH DESCRIPTION - .B __xservername__ - uses a configuration file called --.B __xconfigfile__ --for its initial setup. This configuration file is searched for in the --following places when the server is started as a normal user: -+.I __xconfigfile__ -+for its initial setup. -+This configuration file is searched for in the following places when the -+server is started as a normal user: - .PP - .RS 4 - .nf -@@ -31,30 +32,31 @@ following places when the server is star - .IR __projectroot__/etc/X11/ - .IB /etc/X11/ $XORGCONFIG - .IB __projectroot__/etc/X11/ $XORGCONFIG --.I /etc/X11/__xconfigfile__-4 -+.I /etc/X11/__xconfigfile__\-4 - .I /etc/X11/__xconfigfile__ - .I /etc/__xconfigfile__ - .IR __projectroot__/etc/X11/__xconfigfile__. --.I __projectroot__/etc/X11/__xconfigfile__-4 -+.I __projectroot__/etc/X11/__xconfigfile__\-4 - .I __projectroot__/etc/X11/__xconfigfile__ - .IR __projectroot__/lib/X11/__xconfigfile__. --.I __projectroot__/lib/X11/__xconfigfile__-4 -+.I __projectroot__/lib/X11/__xconfigfile__\-4 - .I __projectroot__/lib/X11/__xconfigfile__ - .fi - .RE - .PP - where - .I --is a relative path (with no ".." components) specified with the -+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 ".." components) specified by that -+is the relative path (with no \(lq..\(rq components) specified by that - environment variable, and - .I --is the machine's hostname as reported by gethostname(3). -+is the machine's hostname as reported by -+.BR gethostname (__oslibmansuffix__). - .PP --When the __xservername__ server is started by the "root" user, the config file -+When the __xservername__ server is started by the \(lqroot\(rq user, the config file - search locations are as follows: - .PP - .RS 4 -@@ -66,14 +68,14 @@ search locations are as follows: - .IB /etc/X11/ $XORGCONFIG - .IB __projectroot__/etc/X11/ $XORGCONFIG - .BI $HOME /__xconfigfile__ --.I /etc/X11/__xconfigfile__-4 -+.I /etc/X11/__xconfigfile__\-4 - .I /etc/X11/__xconfigfile__ - .I /etc/__xconfigfile__ - .IR __projectroot__/etc/X11/__xconfigfile__. --.I __projectroot__/etc/X11/__xconfigfile__-4 -+.I __projectroot__/etc/X11/__xconfigfile__\-4 - .I __projectroot__/etc/X11/__xconfigfile__ - .IR __projectroot__/lib/X11/__xconfigfile__. --.I __projectroot__/lib/X11/__xconfigfile__-4 -+.I __projectroot__/lib/X11/__xconfigfile__\-4 - .I __projectroot__/lib/X11/__xconfigfile__ - .fi - .RE -@@ -90,13 +92,13 @@ environment variable (absolute or relati - is the path specified by that environment variable (usually the home - directory), and - .I --is the machine's hostname as reported by gethostname(3). -+is the machine's hostname as reported by -+.BR gethostname (__oslibmansuffix__). - .PP - The --.B __xconfigfile__ --file is composed of a number of sections which may be present in any --order. Each section has --the form: -+.I __xconfigfile__ -+file is composed of a number of sections which may be present in any order. -+Each section has the form: - .PP - .RS 4 - .nf -@@ -121,13 +123,14 @@ The section names are: - .BR "Modes " "Video modes descriptions" - .BR "Screen " "Screen configuration" - .BR "ServerLayout " "Overall layout" --.BR "DRI " "DRI-specific configuration" --.BR "Vendor " "Vendor-specific configuration" -+.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 -+purposes. -+In new config files, the - .B InputDevice - section should be used instead. - .PP -@@ -144,35 +147,38 @@ 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 -+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 -+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 -+section. -+Each - .B Screen --section binds together a graphics board and a monitor. The graphics --boards are described in the -+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 "_" characters are --ignored. Most strings (including -+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 --"_" characters. -+\(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: -+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 -@@ -182,17 +188,18 @@ on the keyword. The argument types are: - .fi - .RE - .PP --Note: hex integer values must be prefixed with "0x", and octal values --with "0". -+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. -+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: -+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 -@@ -209,8 +216,8 @@ Note that - .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 -+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 : -@@ -263,56 +270,97 @@ When the unit name is omitted, the corre - 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 -+.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 Xserver(__appmansuffix__) --and __xservername__(__appmansuffix__)). The command line settings override the values specified --in the config file. The -+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. -+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 may be either absolute --directory paths, or a font server identifier. Font server identifiers --have the form: -+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 11 --.IR / : -+.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 : [attribute]: pri= - .RE - .PP -+where -+.I -+is an alphanumeric identifier, -+.I [attribute] -+is an attribute wich will be passed to the underlying FPE and -+.I -+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 / : -+.RE -+.PP - where - .I - is the transport type to use to connect to the font server (e.g., - .B unix --for UNIX-domain sockets or -+for UNIX\-domain sockets or - .B tcp - for a TCP/IP connection), - .I - is the hostname of the machine running the font server, and --.I -+.I - 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: -+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 __projectroot__/share/X11/fonts/misc/ --.I __projectroot__/share/X11/fonts/TTF/ --.I __projectroot__/share/X11/fonts/Type1/ --.I __projectroot__/share/X11/fonts/75dpi/ --.I __projectroot__/share/X11/fonts/100dpi/ -+.I __projectroot__/lib/X11/fonts/misc/ -+.I __projectroot__/lib/X11/fonts/TTF/ -+.I __projectroot__/lib/X11/fonts/Type1/ -+.I __projectroot__/lib/X11/fonts/75dpi/ -+.I __projectroot__/lib/X11/fonts/100dpi/ - .fi - .RE - .PP -@@ -320,14 +368,14 @@ The recommended font path contains the f - .PP - .RS 4 - .nf --.I __projectroot__/share/X11/fonts/local/ --.I __projectroot__/share/X11/fonts/misc/ --.I __projectroot__/share/X11/fonts/75dpi/:unscaled --.I __projectroot__/share/X11/fonts/100dpi/:unscaled --.I __projectroot__/share/X11/fonts/Type1/ --.I __projectroot__/share/X11/fonts/Speedo/ --.I __projectroot__/share/X11/fonts/75dpi/ --.I __projectroot__/share/X11/fonts/100dpi/ -+.I __projectroot__/lib/X11/fonts/local/ -+.I __projectroot__/lib/X11/fonts/misc/ -+.I __projectroot__/lib/X11/fonts/75dpi/:unscaled -+.I __projectroot__/lib/X11/fonts/100dpi/:unscaled -+.I __projectroot__/lib/X11/fonts/Type1/ -+.I __projectroot__/lib/X11/fonts/Speedo/ -+.I __projectroot__/lib/X11/fonts/75dpi/ -+.I __projectroot__/lib/X11/fonts/100dpi/ - .fi - .RE - .PP -@@ -338,7 +386,7 @@ font path when the server starts up. - .BI "RGBPath \*q" path \*q - sets the path name for the RGB color database. - When this entry is not specified in the config file, the server falls back --to the compiled-in default RGB path, which is: -+to the compiled\-in default RGB path, which is: - .PP - .RS 11 - .I __projectroot__/share/X11/rgb -@@ -350,9 +398,10 @@ is added to this path if the server was - binary format RGB color databases. - .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 -+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. -@@ -360,8 +409,8 @@ module search path used by the server. - .ig - .TP 7 - .BI "LogFile \*q" path \*q --sets the name of the __xservername__ server log file. The default log file name --is -+sets the name of the __xservername__ server log file. -+The default log file name is - .PP - .RS 11 - .RI __logdir__/__xservername__. .log -@@ -372,15 +421,18 @@ where - .I - is the display number for the __xservername__ server. - .. --.SH SERVERFLAGS SECTION -+.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 -+__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 -+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 -@@ -392,11 +444,12 @@ 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: -+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 -+.BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q - This specifies the default - .B ServerLayout - section to use in the absence of the -@@ -404,148 +457,185 @@ section to use in the absence of the - 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. -+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 \*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. -+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 Ctrl+Alt+Backspace --sequence. That sequence is normally used to terminate the __xservername__ server. --When this option is enabled, that key sequence has no special meaning --and is passed to clients. Default: off. -+sequence. -+That sequence is normally used to terminate the __xservername__ server. -+When this option is enabled, that key sequence has no special meaning and -+is passed to clients. -+Default: off. - .TP 7 - .BI "Option \*qDontZoom\*q \*q" boolean \*q - This disallows the use of the --.B Ctrl+Alt+Keypad-Plus -+.B Ctrl+Alt+Keypad\-Plus - and --.B Ctrl+Alt+Keypad-Minus --sequences. These sequences allows you to switch between video modes. -+.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. -+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. -+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. -+extension) to connect from another host. -+Default: off. - .TP 7 - .BI "Option \*qDisableModInDev\*q \*q" boolean \*q --This disables the parts of the __xservername__-Misc extension that can be used to --modify the input device settings dynamically. Default: that functionality --is enabled. -+This disables the parts of the __xservername__\-Misc extension that can be used to -+modify the input device settings dynamically. -+Default: that functionality is enabled. - .TP 7 - .BI "Option \*qAllowNonLocalModInDev\*q \*q" boolean \*q - This allows a client to connect from another host and change keyboard --and mouse settings in the running server. Default: off. -+and mouse settings in the running server. -+Default: off. - .TP 7 - .BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q - This allows the server to start up even if the mouse device can't be --opened/initialised. Default: false. -+opened/initialised. -+Default: false. - .TP 7 - .BI "Option \*qVTInit\*q \*q" command \*q - Runs - .I command - after the VT used by the server has been opened. --The command string is passed to "/bin/sh -c", and is run with the --real user's id with stdin and stdout set to the VT. The purpose --of this option is to allow system dependent VT initialisation --commands to be run. This option should rarely be needed. Default: not set. -+The command string is passed to \*q/bin/sh \-c\*q, and is run with the real -+user's id with stdin and stdout set to the VT. -+The purpose of this option is to allow system dependent VT initialisation -+commands to be run. -+This option should rarely be needed. -+Default: not set. - .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 -+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. -+access them. -+Default: off. - .TP 7 - .BI "Option \*qXkbDisable\*q \*q" boolean \*q --disable/enable the XKEYBOARD extension. The \-kb command line --option overrides this config file option. Default: XKB is enabled. -+disable/enable the XKEYBOARD extension. -+The \-kb command line option overrides this config file option. -+Default: XKB is enabled. - .\" The following four options are "undocumented". - .ig - .TP 7 - .BI "Option \*qPciProbe1\*q" --Use PCI probe method 1. Default: set. -+Use PCI probe method 1. -+Default: set. - .TP 7 - .BI "Option \*qPciProbe2\*q" --Use PCI probe method 2. Default: not set. -+Use PCI probe method 2. -+Default: not set. - .TP 7 - .BI "Option \*qPciForceConfig1\*q" --Force the use PCI config type 1. Default: not set. -+Force the use PCI config type 1. -+Default: not set. - .TP 7 - .BI "Option \*qPciForceConfig2\*q" --Force the use PCI config type 2. Default: not set. -+Force the use PCI config type 2. -+Default: not set. - .. - .TP 7 - .BI "Option \*qBlankTime\*q \*q" time \*q --sets the inactivity timeout for the blanking phase of the screensaver. -+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 `-s' flag, --and the value can be changed at run-time with xset(__appmansuffix__). Default: 10 --minutes. -+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 "standby" phase of DPMS mode. -+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 xset(__appmansuffix__). --Default: 20 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 -+is in minutes, and the value can be changed at run\-time with -+.BR xset(__appmansuffix__). -+Default: 20 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 "suspend" phase of DPMS mode. -+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 xset(__appmansuffix__). --Default: 30 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 -+is in minutes, and the value can be changed at run\-time with -+.BR xset(__appmansuffix__). -+Default: 30 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 "off" phase of DPMS mode. -+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 xset(__appmansuffix__). --Default: 40 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 -+is in minutes, and the value can be changed at run\-time with -+.BR xset(__appmansuffix__). -+Default: 40 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 -+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. -+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. -+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. - .\" Doubt this should be documented. - .ig - .TP 7 -@@ -555,48 +645,54 @@ Default: 0. - .. - .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. -+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. -+enable or disable XINERAMA extension. -+Default is disabled. - .TP 7 - .BI "Option \*qAllowDeactivateGrabs\*q \*q" boolean \*q - This option enables the use of the --.B Ctrl+Alt+Keypad-Divide --key sequence to deactivate any active keyboard and mouse grabs. Default: --off. -+.B Ctrl+Alt+Keypad\-Divide -+key sequence to deactivate any active keyboard and mouse grabs. -+Default: off. - .TP 7 - .BI "Option \*qAllowClosedownGrabs\*q \*q" boolean \*q - This option enables the use of the --.B Ctrl+Alt+Keypad-Multiply --key sequence to kill clients with an active keyboard or mouse grab as --well as killing any application that may have locked the server, normally --using the XGrabServer(__libmansuffix__) Xlib function. Default: off. -+.B Ctrl+Alt+Keypad\-Multiply -+key sequence to kill clients with an active keyboard or mouse grab as well -+as killing any application that may have locked the server, normally using -+the -+.BR XGrabServer(__libmansuffix__) -+Xlib function. -+Default: off. - .br - Note that the options --.BI AllowDeactivateGrabs -+.B AllowDeactivateGrabs - and --.BI AllowClosedownGrabs -+.B AllowClosedownGrabs - will allow users to remove the grab used by screen saver/locker programs. --An API was written to such cases. If you enable this option, make sure --your screen saver/locker is updated. -+An API was written to such cases. -+If you enable this option, make sure your screen saver/locker is updated. -+Default: off. - .TP 7 - .BI "Option \*qHandleSpecialKeys\*q \*q" when \*q - This option controls when the server uses the builtin handler to process - special key combinations (such as - .BR Ctrl+Alt+Backspace ). --Normally the XKEYBOARD extension keymaps will provide mappings for each --of the special key combinations, so the builtin handler is not needed --unless the XKEYBOARD extension is disabled. The value of -+Normally the XKEYBOARD extension keymaps will provide mappings for each of -+the special key combinations, so the builtin handler is not needed unless -+the XKEYBOARD extension is disabled. -+The value of - .I when - can be - .BR Always , - .BR Never , - or - .BR WhenNeeded . --Default: Use the builtin handler only if needed. The server will scan --the keymap for a mapping to the -+Default: Use the builtin handler only if needed. -+The server will scan the keymap for a mapping to the - .B Terminate - action and, if found, use XKEYBOARD for processing actions, otherwise - the builtin handler will be used. -@@ -604,24 +700,30 @@ the builtin handler will be used. - .BI "Option \*qAIGLX\*q \*q" boolean \*q - enable or disable AIGLX. AIGLX is enabled by default. - .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. --.SH MODULE SECTION -+.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 types of modules normally loaded in this section are __xservername__ server --extension modules, and font rasteriser modules. Most other module types --are loaded automatically when they are needed via other mechanisms. -+extension modules, and font rasteriser 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 -+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 -@@ -629,16 +731,31 @@ keyword, as described here: - 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 "lib" prefix, or the ".a", ".o", or ".so" suffixes. -+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 Type 1 font rasteriser can be loaded with the following entry: -+Example: the FreeType font rasteriser can be loaded with the following entry: - .PP - .RS 4 --.B "Load \*qtype1\*q" -+.B "Load \*qfreetype\*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, -@@ -649,13 +766,13 @@ being - 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 -+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 " Option \*qomit XFree86\-DGA\*q" - .B EndSubSection - .fi - .RE -@@ -677,17 +794,20 @@ __projectroot__/lib/modules/extensions - .fi - .RE - .PP --The "bitmap" font modules is loaded automatically. It is recommended --that at very least the "extmod" extension module be loaded. If it isn't --some commonly used server extensions (like the SHAPE extension) will not be --available. --.SH INPUTDEVICE SECTION -+The \(lqbitmap\(rq font module is loaded automatically. -+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 "INPUTDEVICE SECTION" - The config file may have multiple - .B InputDevice --sections. There will normally be at least two: one for the core (primary) --keyboard, and one of the core pointer. If either of these two is missing, --a default configuration for the missing ones will be used. Currently the --default configuration may not work as expected on all platforms. -+sections. -+There will normally be at least two: one for the core (primary) keyboard, -+and one of the core pointer. -+If either of these two is missing, a default configuration for the missing -+ones will be used. -+Currently the default configuration may not work as expected on all platforms. - .PP - .B InputDevice - sections have the following format: -@@ -709,18 +829,21 @@ and - .B Driver - entries are required in all - .B InputDevice --sections. All other entries are optional. -+sections. -+All other entries are optional. - .PP - The - .B Identifier --entry specifies the unique name for this input device. The -+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 -+section. -+An - .B InputDevice - section is considered active if it is referenced by an active - .B ServerLayout -@@ -730,7 +853,10 @@ 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 "keyboard" and "mouse". -+The most commonly used input drivers are -+.BR keyboard (__drivermansuffix__) -+and -+.BR mouse (__drivermansuffix__). - .PP - In the absence of an explicitly specified core input device, the first - .B InputDevice -@@ -738,21 +864,24 @@ marked as - .B CorePointer - (or - .BR CoreKeyboard ) --is used. If there is no match there, the first -+is used. -+If there is no match there, the first - .B InputDevice --that uses the "mouse" (or "keyboard" or "kbd") driver is used. The final --fallback is to use built-in default configurations. -+that uses the \(lqmouse\(rq (or \(lqkeyboard\(rq or \(lqkbd\(rq) driver is used. -+The final fallback is to use built\-in default configurations. - .PP - .B InputDevice --sections recognise some driver-independent -+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. -+which are described here. -+See the individual input driver manual pages for a description of the -+device\-specific options. - .TP 7 - .BI "Option \*qCorePointer\*q" - When this is set, the input device is installed as the core (primary) --pointer device. There must be exactly one core pointer. If this option --is not set here, or in the -+pointer device. -+There must be exactly one core pointer. -+If this option is not set here, or in the - .B ServerLayout - section, or from the - .B \-pointer -@@ -764,8 +893,9 @@ section is used. - .TP 7 - .BI "Option \*qCoreKeyboard\*q" - When this is set, the input device is to be installed as the core --(primary) keyboard device. There must be exactly one core keyboard. If --this option is not set here, in the -+(primary) keyboard device. -+There must be exactly one core keyboard. -+If this option is not set here, in the - .B ServerLayout - section, or from the - .B \-keyboard -@@ -779,19 +909,21 @@ section is used. - .TP 7 - .BI "Option \*qSendCoreEvents\*q \*q" boolean \*q - Both of these options are equivalent, and when enabled cause the --input device to always report core events. This can be used, for --example, to allow an additional pointer device to generate core --pointer events (like moving the cursor, etc). -+input device to always report core events. -+This can be used, for example, to allow an additional pointer device to -+generate core pointer events (like moving the cursor, etc). - .TP 4 - .BI "Option \*qHistorySize\*q \*q" number \*q --Sets the motion history size. Default: 0. -+Sets the motion history size. -+Default: 0. - .TP 7 - .BI "Option \*qSendDragEvents\*q \*q" boolean \*q - ??? --.SH DEVICE SECTION -+.SH "DEVICE SECTION" - The config file may have multiple - .B Device --sections. There must be at least one, for the video card being used. -+sections. -+There must be at least one, for the video card being used. - .PP - .B Device - sections have the following format: -@@ -817,27 +949,30 @@ sections. All other entries are optiona - .PP - The - .B Identifier --entry specifies the unique name for this graphics device. The -+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 -+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 -+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. -+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 -@@ -846,118 +981,137 @@ 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, -+.BI "BusID \*q" bus\-id \*q -+This specifies the bus location of the graphics card. -+For PCI/AGP cards, - the --.I bus-id -+.I bus\-id - string has the form - .BI PCI: bus : device : function --(e.g., "PCI:1:0:0" might be appropriate for an AGP card). -+(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 __xservername__ server with the -+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 __xservername__ server -+with the - .B \-scanpci - command line option. - .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 -+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 -+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 -+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 -+.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. -+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" -+.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 give, 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. -+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 -+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. -+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 -+.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. -+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. -+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. -+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. -+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. -+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. -+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. -+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. -+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. -@@ -966,19 +1120,22 @@ This optional entry allows an IRQ number - .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. -+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 "VIDEOADAPTOR SECTION" -+Nobody wants to say how this works. -+Maybe nobody knows ... - --.SH MONITOR SECTION -+.SH "MONITOR SECTION" - The config file may have multiple - .B Monitor --sections. There should normally be at least one, for the monitor being used, -+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 -@@ -1002,22 +1159,43 @@ entry. - .PP - The - .B Identifier --entry specifies the unique name for this monitor. The -+entry specifies the unique name for this monitor. -+The - .B Monitor --section provides information about the specifications of the monitor, --monitor-specific -+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. Specifying --video modes is optional because the server now has a built-in list of --VESA standard modes. When modes are specified explicitly in the -+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. -+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 -@@ -1029,69 +1207,79 @@ This optional entry specifies the monito - .BI "ModelName \*q" model \*q - This optional entry specifies the monitor's model. - .TP 7 --.BI "HorizSync " "horizsync-range" -+.BI "HorizSync " "horizsync\-range" - gives the range(s) of horizontal sync frequencies supported by the - monitor. --.I horizsync-range -+.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 -+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. -+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" -+.BI "VertRefresh " "vertrefresh\-range" - gives the range(s) of vertical refresh frequencies supported by the - monitor. --.I vertrefresh-range -+.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 -+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. -+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. -+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" -+.BI "Gamma " "gamma\-value" - .TP 7 --.BI "Gamma " "red-gamma green-gamma blue-gamma" -+.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. -+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 -+.BI "UseModes \*q" modesection\-id \*q - Include the set of modes listed in the - .B Modes - section called --.IR modesection-id. --This make all of the modes defined in that section available for use by -+.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 -+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: -+keyword. -+The mode description consists of the following entries: - .RS 7 - .TP 4 - .BI "DotClock " clock -@@ -1127,52 +1315,60 @@ and - 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). "Roving" 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. -+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 -+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" -+.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. -+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 -+.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 -+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. -+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 -@@ -1191,7 +1387,8 @@ Additionally, on some hardware, - .B +CSync - and - .B \-CSync --may be used to select the composite sync polarity. The -+may be used to select the composite sync polarity. -+The - .B HSkew - and - .B VScan -@@ -1214,21 +1411,79 @@ monitors do not require it. The default - This optional entry specifies the vertical refresh rate that the server - should aim for when selecting video modes. Without this option, the - default is to prefer modes with higher refresh rates. -+.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 " \*qmonitor\*q -+This optional entry specifies that the monitor should be positioned to the -+left of the monitor of the given name. -+(RandR 1.2-supporting drivers only) -+.TP 7 -+.BI "Option " "\*qRightOf\*q " \*qmonitor\*q -+This optional entry specifies that the monitor should be positioned to the -+right of the monitor of the given name. -+(RandR 1.2-supporting drivers only) -+.TP 7 -+.BI "Option " "\*qAbove\*q " \*qmonitor\*q -+This optional entry specifies that the monitor should be positioned above the -+monitor of the given name. -+(RandR 1.2-supporting drivers only) -+.TP 7 -+.BI "Option " "\*qBelow\*q " \*qmonitor\*q -+This optional entry specifies that the monitor should be positioned below the -+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 " "\*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 -+.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 -+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 -+keyword. -+In most cases the - .B Modes --sections are not necessary because the built-in set of VESA standard modes -+sections are not necessary because the built\-in set of VESA standard modes - will be sufficient. - .PP - .B Modes -@@ -1256,21 +1511,24 @@ and - entries that are described above in the - .B Monitor - section. --.SH SCREEN SECTION -+.SH "SCREEN SECTION" - The config file may have multiple - .B Screen --sections. There must be at least one, for the "screen" being used. --A "screen" represents the binding of a graphics device -+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 -+section). -+A - .B Screen --section is considered "active" if it is referenced by an active -+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 -+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 -@@ -1298,94 +1556,97 @@ The - .B Identifier - and - .B Device --entries are mandatory. All others are optional. -+entries are mandatory. -+All others are optional. - .PP - The - .B Identifier --entry specifies the unique name for this screen. The -+entry specifies the unique name for this screen. -+The - .B Screen - section provides information specific to the whole screen, including --screen-specific -+screen\-specific - .BR Options . --In multi-head configurations, there will be multiple active -+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 -+.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 -+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 -+.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. -+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 -+.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 -+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. -+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 -+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. -+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. -+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 \*qBiosLocation\*q \*q" address \*q --Set the location of the BIOS for the Int10 module. One may select a BIOS --of another card for posting or the legacy V_BIOS range located at 0xc0000 --or an alternative address (BUS_ISA). This is only useful under very --special circumstances and should be used with extreme care. -+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 -+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. -+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 -@@ -1395,14 +1656,14 @@ known to exhibit problems when MTRR's ar - .TP 7 - .BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q" - Disables accelerated rectangular expansion blits from source patterns --stored in system memory (using a memory-mapped aperture). -+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 -+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 -+Disables accelerated fills of a trapezoidal region with a full\-color - pattern. - .TP 7 - .BI "Option \*qXaaNoDashedBresenhamLine\*q" -@@ -1412,8 +1673,8 @@ Disables accelerated dashed Bresenham li - 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). -+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 -@@ -1434,7 +1695,7 @@ Disables accelerated rectangular expansi - 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 -+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" -@@ -1449,10 +1710,10 @@ video memory to another part of video me - Disables accelerated solid Bresenham line draws. - .TP 7 - .BI "Option \*qXaaNoSolidFillRect\*q" --Disables accelerated solid-color fills of rectangles. -+Disables accelerated solid\-color fills of rectangles. - .TP 7 - .BI "Option \*qXaaNoSolidFillTrap\*q" --Disables accelerated solid-color fills of Bresenham trapezoids. -+Disables accelerated solid\-color fills of Bresenham trapezoids. - .TP 7 - .BI "Option \*qXaaNoSolidHorVertLine\*q" - Disables accelerated solid horizontal and vertical line draws. -@@ -1464,27 +1725,30 @@ 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 -+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 -+.SH "DISPLAY SUBSECTION" - Each - .B Screen - section may have multiple - .B Display --subsections. --The "active" -+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 -+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. -+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: -@@ -1498,78 +1762,88 @@ subsections have the following format: - .B " EndSubSection" - .fi - .RE --.PP - .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 -+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 -+parameter. -+The range of - .I depth --values that are allowed depends on the driver. Most driver support --8, 15, 16 and 24. Some also support 1 and/or 4, and some may support --other values (like 30). Note: -+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 -+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. -+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. -+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" -+.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 -+formats. -+This may also be specified from the command line with the - .B \-weight --option (see __xservername__(__appmansuffix__)). -+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 -+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. -+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 -+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). -+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 -+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 . -+.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 -@@ -1577,10 +1851,12 @@ section will be used. If the - 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 Xserver(__appmansuffix__) man page). The --visual types available for depth 8 are (default is -+.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 -@@ -1626,43 +1902,48 @@ The visual type available for the depth - .RE - .TP 7 - .BI "Black " "red green blue" --This optional entry allows the "black" colour to be specified. This --is only supported at depth 1. The default is black. -+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 "white" colour to be specified. This --is only supported at depth 1. The default is white. -+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 -+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 -+.SH "SERVERLAYOUT SECTION" - The config file may have multiple - .B ServerLayout --sections. --A "server layout" represents the binding of one or more screens -+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 -+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 "active" if it is referenced by the -+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 -+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 -+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. -@@ -1674,9 +1955,9 @@ sections have the following format: - .nf - .B "Section \*qServerLayout\*q" - .BI " Identifier \*q" name \*q --.BI " Screen \*q" screen-id \*q -+.BI " Screen \*q" screen\-id \*q - .I " ..." --.BI " InputDevice \*q" idev-id \*q -+.BI " InputDevice \*q" idev\-id \*q - .I " ..." - .I " options" - .I " ..." -@@ -1694,10 +1975,11 @@ entry. - .PP - The - .B Identifier --entry specifies the unique name for this server layout. The -+entry specifies the unique name for this server layout. -+The - .B ServerLayout - section provides information specific to the whole session, including --session-specific -+session\-specific - .BR Options . - The - .B ServerFlags -@@ -1708,21 +1990,25 @@ 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" -+.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 -+a session. -+The -+.I screen\-id - field is mandatory, and specifies the - .B Screen --section being referenced. The --.I screen-num -+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: -+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" -@@ -1732,48 +2018,53 @@ These both specify that the upper left c - .RI ( x , y ). - The - .B Absolute --keyword is optional. Some older versions of __xservername__ (4.2 and earlier) don't --recognise the -+keyword is optional. -+Some older versions of __xservername__ (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 -+.BI "RightOf \*q" screen\-id \*q - .TP 4 --.BI "LeftOf \*q" screen-id \*q -+.BI "LeftOf \*q" screen\-id \*q - .TP 4 --.BI "Above \*q" screen-id \*q -+.BI "Above \*q" screen\-id \*q - .TP 4 --.BI "Below \*q" screen-id \*q -+.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. -+.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 " ..." -+.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 -+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 -+.I idev\-id - field is mandatory, and specifies the name of the - .B InputDevice --section being referenced. Multiple -+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 -+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: -+sections. -+Normally only session\-specific input device options would be used here. -+The most commonly used options are: - .PP - .RS 11 - .nf -@@ -1791,8 +2082,9 @@ and core keyboard devices respectively. - .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 -+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 -@@ -1805,9 +2097,11 @@ option (described in - .BR "DEVICE SECTION" , - above) for the format of the - .I bus\-id --parameter. This option overrides -+parameter. -+This option overrides - .BR SingleCard , --if specified. At present, only PCI devices can be isolated in this manner. -+if specified. -+At present, only PCI devices can be isolated in this manner. - .TP 7 - .BI "Option \*qSingleCard\*q \*q" boolean \*q - As -@@ -1831,68 +2125,97 @@ section for a dual headed configuration - .B "EndSection" - .fi - .RE --.SH DRI SECTION -+.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 -+Direct Rendering Infrastructure. -+Details about the format of this section -+can be found in the README.DRI document, which is also available on-line at - .IR . --.SH VENDOR SECTION -+.SH "VENDOR SECTION" - The optional - .B Vendor --section may be used to provide vendor-specific configuration information. -+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. -+flags. -+The data therein is not used in this release. - .PP --.SH FILES --For an example of an __xconfigfile__ file, see the file installed as --__projectroot__/lib/X11/__xconfigfile__.eg. --.fi - .SH "SEE ALSO" --X(__miscmansuffix__), --Xserver(__appmansuffix__), --__xservername__(__appmansuffix__), --apm(__drivermansuffix__), --.\" .IR ati(__drivermansuffix__), --chips(__drivermansuffix__), --cirrus(__drivermansuffix__), --cyrix(__drivermansuffix__), --fbdev(__drivermansuffix__), --glide(__drivermansuffix__), --glint(__drivermansuffix__), --i128(__drivermansuffix__), --i740(__drivermansuffix__), --i810(__drivermansuffix__), --imstt(__drivermansuffix__), --mga(__drivermansuffix__), --neomagic(__drivermansuffix__), --nv(__drivermansuffix__), --r128(__drivermansuffix__), --rendition(__drivermansuffix__), --savage(__drivermansuffix__), --s3virge(__drivermansuffix__), --.\" .IR shadowfb(__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__), --vga(__drivermansuffix__), --vmware(__drivermansuffix__), -+General: -+.BR X (__miscmansuffix__), -+.BR Xserver (__appmansuffix__), -+.BR __xservername__ (__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 i810 (__drivermansuffix__), -+.BR imstt (__drivermansuffix__), -+.BR mga (__drivermansuffix__), -+.BR neomagic (__drivermansuffix__), -+.BR nv (__drivermansuffix__), -+.BR r128 (__drivermansuffix__), -+.BR rendition (__drivermansuffix__), -+.BR savage (__drivermansuffix__), -+.BR s3virge (__drivermansuffix__), -+.BR siliconmotion (__drivermansuffix__), -+.BR sis (__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 vga (__drivermansuffix__), -+.BR via (__drivermansuffix__), -+.BR vmware (__drivermansuffix__). -+.PP -+Input drivers: -+.\" .BR acecad (__drivermansuffix__), -+.\" .BR calcomp (__drivermansuffix__), -+.BR citron (__drivermansuffix__), -+.BR dmc (__drivermansuffix__), -+.BR dynapro (__drivermansuffix__), -+.BR elographics (__drivermansuffix__), -+.BR fpit (__drivermansuffix__), -+.BR js_x (__drivermansuffix__), -+.BR kbd (__drivermansuffix__), -+.BR keyboard (__drivermansuffix__), -+.\" .BR magictouch (__drivermansuffix__), -+.BR microtouch (__drivermansuffix__), -+.BR mouse (__drivermansuffix__), -+.BR mutouch (__drivermansuffix__), -+.BR palmax (__drivermansuffix__), -+.BR penmount (__drivermansuffix__), -+.BR tek4957 (__drivermansuffix__), -+.\" .BR ur98 (__drivermansuffix__), -+.BR void (__drivermansuffix__), -+.BR wacom (__drivermansuffix__). -+.PP -+Other modules and interfaces: -+.BR fbdevhw (__drivermansuffix__), -+.\" .BR shadowfb (__drivermansuffix__), -+.BR v4l (__drivermansuffix__). - .br - .SH AUTHORS - This manual page was largely rewritten by David Dawes diff --git a/xserver-1.3.0-xrandr-timestamp-buglet.patch b/xserver-1.3.0-xrandr-timestamp-buglet.patch deleted file mode 100644 index 53477fc..0000000 --- a/xserver-1.3.0-xrandr-timestamp-buglet.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/randr/rrscreen.c.orig 2006-07-05 21:31:44.000000000 +0300 -+++ b/randr/rrscreen.c 2007-02-03 00:00:10.000000000 +0200 -@@ -723,7 +723,6 @@ - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); -- configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; -@@ -738,11 +737,15 @@ - return BadAlloc; - - /* -- * if the client's config timestamp is not the same as the last config -+ * If the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and -- * can't even be validated -+ * can't even be validated. -+ * -+ * Note that the client only knows about the milliseconds part of the -+ * timestamp, so using CompareTimeStamps here would cause randr to suddenly -+ * stop working after several hours have passed (freedesktop bug #6502). - */ -- if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) -+ if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; diff --git a/xserver-1.4.99-builtin-fonts.patch b/xserver-1.4.99-builtin-fonts.patch new file mode 100644 index 0000000..50719ad --- /dev/null +++ b/xserver-1.4.99-builtin-fonts.patch @@ -0,0 +1,28 @@ +From fe82a1fe634a2e0ceb030de90309d26044c7b75e Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 15:06:17 -0400 +Subject: [PATCH] Enable builtin font FPE. + +--- + dix/dixfonts.c | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +diff --git a/dix/dixfonts.c b/dix/dixfonts.c +index c21b3ec..c951b05 100644 +--- a/dix/dixfonts.c ++++ b/dix/dixfonts.c +@@ -1890,11 +1890,8 @@ InitFonts (void) + } else + #endif + { +-#ifdef BUILTIN_FONTS + BuiltinRegisterFpeFunctions(); +-#else + FontFileRegisterFpeFunctions(); +-#endif + #ifndef NOFONTSERVERACCESS + fs_register_fpe_functions(); + #endif +-- +1.5.3.4 + diff --git a/xserver-1.4.99-dont-backfill-bg-none.patch b/xserver-1.4.99-dont-backfill-bg-none.patch new file mode 100644 index 0000000..66bc116 --- /dev/null +++ b/xserver-1.4.99-dont-backfill-bg-none.patch @@ -0,0 +1,32 @@ +From 6a39049e34eeefeeb821970d83e1994870af8f3e Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 14:56:25 -0400 +Subject: [PATCH] Don't backfill bg=None windows in Composite. + +--- + composite/compalloc.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/composite/compalloc.c b/composite/compalloc.c +index 006e808..67d830d 100644 +--- a/composite/compalloc.c ++++ b/composite/compalloc.c +@@ -478,6 +478,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ ++#if 0 + if (pGC) + { + XID val = IncludeInferiors; +@@ -492,6 +493,7 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) + w, h, 0, 0); + FreeScratchGC (pGC); + } ++#endif + } + else + { +-- +1.5.3.4 + diff --git a/xserver-1.4.99-pic-libxf86config.patch b/xserver-1.4.99-pic-libxf86config.patch new file mode 100644 index 0000000..efdd2db --- /dev/null +++ b/xserver-1.4.99-pic-libxf86config.patch @@ -0,0 +1,25 @@ +From 6344659a33a7c192dffe6e796c771d02f78da5e5 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 15:02:24 -0400 +Subject: [PATCH] Build libxf86config with -fPIC. + +--- + hw/xfree86/parser/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am +index 849ee8b..0691158 100644 +--- a/hw/xfree86/parser/Makefile.am ++++ b/hw/xfree86/parser/Makefile.am +@@ -25,7 +25,7 @@ libxf86config_a_SOURCES = \ + DRI.c \ + Extensions.c + +-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) ++AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -fPIC -fvisibility=hidden + + EXTRA_DIST = \ + Configint.h \ +-- +1.5.3.4 + diff --git a/xserver-1.4.99-selinux-awareness.patch b/xserver-1.4.99-selinux-awareness.patch new file mode 100644 index 0000000..11afea3 --- /dev/null +++ b/xserver-1.4.99-selinux-awareness.patch @@ -0,0 +1,48 @@ +From 823a13f90b5619823325ea162ae30d652e448492 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 10:39:57 -0400 +Subject: [PATCH] Link GL subsystem against libselinux. + +--- + configure.ac | 4 +++- + hw/xfree86/dixmods/Makefile.am | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 57132b0..a16b46a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -339,6 +339,8 @@ case $host_cpu in + ;; + esac + ++SYS_LIBS="${SYS_LIBS} -lselinux" ++ + dnl BSD *_video.c selection + AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) + AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) +@@ -1229,7 +1231,7 @@ AC_MSG_RESULT([$XNEST]) + AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) + + if test "x$XNEST" = xyes; then +- XNEST_LIBS="$CONFIG_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB" ++ XNEST_LIBS="$CONFIG_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $XSERVER_LIBS" + XNEST_SYS_LIBS="$XNESTMODULES_LIBS" + AC_SUBST([XNEST_LIBS]) + AC_SUBST([XNEST_SYS_LIBS]) +diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am +index efc5f4a..1b9ecfd 100644 +--- a/hw/xfree86/dixmods/Makefile.am ++++ b/hw/xfree86/dixmods/Makefile.am +@@ -50,7 +50,7 @@ INCLUDES = @XORG_INCS@ \ + -I$(top_srcdir)/GL/glx + + libGLcore_la_LDFLAGS = -avoid-version +-libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la ++libGLcore_la_LIBADD = $(top_builddir)/GL/mesa/libGLcore.la -lselinux + libGLcore_la_SOURCES = GLcoremodule.c + + libafb_la_LDFLAGS = -avoid-version +-- +1.5.3.4 + diff --git a/xserver-1.4.99-xaa-evict-pixmaps.patch b/xserver-1.4.99-xaa-evict-pixmaps.patch new file mode 100644 index 0000000..e9ab1f9 --- /dev/null +++ b/xserver-1.4.99-xaa-evict-pixmaps.patch @@ -0,0 +1,79 @@ +From fb3008787193b79909fe922577794f7d4a656922 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Thu, 1 Nov 2007 15:18:31 -0400 +Subject: [PATCH] Add pixmap eviction call for XAA. + +DRI drivers without zero-copy EXT_texture_from_pixmap need to copy the +texture image out of video memory to bind it. Ick. Add a hack to +evict XAA pixmaps and disable the pixmap cache when the first texture +is bound. +--- + GL/glx/glxdri.c | 16 ++++++++++++++++ + hw/xfree86/xaa/xaaInit.c | 24 ++++++++++++++++++++++++ + 2 files changed, 40 insertions(+), 0 deletions(-) + +diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c +index c0da07b..6c4faed 100644 +--- a/GL/glx/glxdri.c ++++ b/GL/glx/glxdri.c +@@ -360,6 +360,22 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, + + pixmap = (PixmapPtr) glxPixmap->pDraw; + ++ if (!screen->texOffsetStart) { ++ /* When the GLX_EXT_texture_from_pixmap is used, as it's ++ * implemented here, we want to pull pixmap out of video memory ++ * and into host memory. */ ++ extern void XAAEvictPixmaps(void); ++ static int evictedPixmaps = 0; ++ ++ if (!evictedPixmaps) { ++ __glXDRIenterServer(GL_FALSE); ++ if (dlsym(RTLD_DEFAULT, "XAAEvictPixmaps")) ++ XAAEvictPixmaps(); ++ __glXDRIleaveServer(GL_FALSE); ++ evictedPixmaps = TRUE; ++ } ++ } ++ + if (screen->texOffsetStart && screen->texOffset) { + __GLXDRIdrawable **texOffsetOverride = screen->texOffsetOverride; + int i, firstEmpty = 16; +diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c +index 4222425..602b525 100644 +--- a/hw/xfree86/xaa/xaaInit.c ++++ b/hw/xfree86/xaa/xaaInit.c +@@ -88,6 +88,30 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec) + xfree(infoRec); + } + ++void ++XAAEvictPixmaps(void) ++{ ++ XAAScreenPtr pScreenPriv; ++ XAAInfoRecPtr infoRec; ++ ScreenPtr pScreen; ++ int i; ++ ++ xf86MsgVerb(X_INFO, 3, "XAA: Evicting pixmaps\n"); ++ ++ for (i = 0; i < screenInfo.numScreens; i++) { ++ pScreen = screenInfo.screens[i]; ++ infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); ++ ++ pScreenPriv = pScreen->devPrivates[XAAScreenIndex].ptr; ++ infoRec = pScreenPriv->AccelInfoRec; ++ ++ infoRec->offscreenDepths = 0; ++ infoRec->Flags &= ~OFFSCREEN_PIXMAPS; ++ ++ XAAMoveOutOffscreenPixmaps(pScreen); ++ XAAInvalidatePixmapCache(pScreen); ++ } ++} + + Bool + XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) +-- +1.5.3.4 +