xserver: Branch 'pci-rework' - 29 commits

Ian Romanick idr at kemper.freedesktop.org
Thu Feb 15 02:13:37 EET 2007


 GL/mesa/.gitignore                   |    4 -
 GL/mesa/Makefile.am                  |    4 -
 GL/mesa/X/Makefile.am                |    1 
 GL/mesa/array_cache/Makefile.am      |   21 -------
 GL/mesa/glapi/Makefile.am            |    1 
 GL/mesa/main/Makefile.am             |    1 
 GL/mesa/math/Makefile.am             |    1 
 GL/mesa/shader/Makefile.am           |    1 
 GL/mesa/shader/grammar/Makefile.am   |    1 
 GL/mesa/shader/slang/Makefile.am     |    1 
 GL/mesa/swrast/Makefile.am           |    1 
 GL/mesa/swrast_setup/Makefile.am     |    1 
 GL/mesa/tnl/Makefile.am              |   16 +----
 GL/mesa/vbo/Makefile.am              |   35 ++++++++++++
 GL/symlink-mesa.sh                   |   20 +++----
 Xext/security.c                      |    4 -
 configure.ac                         |    6 +-
 damageext/damageext.c                |   17 ++++--
 fb/fbmmx.c                           |   98 +++++++++++++++++++++++++++++++++++
 fb/fbmmx.h                           |   12 ++++
 fb/fbpict.c                          |   18 +++++-
 hw/dmx/Makefile.am                   |   24 ++++----
 hw/dmx/glxProxy/glxdrawable.h        |   52 ------------------
 hw/dmx/glxProxy/glxserver.h          |    3 -
 hw/kdrive/ephyr/ephyr.c              |   23 +++-----
 hw/vfb/Makefile.am                   |   25 ++++----
 hw/xfree86/common/xf86Mode.c         |   38 -------------
 hw/xfree86/loader/loadmod.c          |    2 
 hw/xfree86/os-support/bus/linuxPci.c |    3 -
 hw/xfree86/x86emu/ops2.c             |   36 ++++++++++++
 hw/xnest/Makefile.am                 |   22 +++----
 randr/rrcrtc.c                       |    2 
 xkb/xkbUtils.c                       |    2 
 33 files changed, 281 insertions(+), 215 deletions(-)

New commits:
diff-tree e540d572c5acba877b3ce01e7b31e399dac2d44a (from 16eb7254f861465f988ae3861ac3449c2c966062)
Author: Ian Romanick <idr at us.ibm.com>
Date:   Wed Feb 14 15:38:10 2007 -0800

    Merge fix missed on previous commit.

diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index c8f43c9..b88fae6 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -402,7 +402,7 @@ linuxMapPci(int ScreenNum, int Flags, st
 	 * will fail gracefully.
 	 */
         prot = ((Flags & VIDMEM_READONLY) == 0);
-        if (((fd = linuxPciOpenFile(Tag, prot)) < 0) ||
+        if (((fd = linuxPciOpenFile(dev, prot)) < 0) ||
 	    (ioctl(fd, mmap_ioctl, 0) < 0))
 	    break;
 
diff-tree 16eb7254f861465f988ae3861ac3449c2c966062 (from parents)
Merge: 3814862a869ee83d307eb01225d5949039f435d8 c4b7e9d1c16797c3e4b1200b40aceab5696a7fb8
Author: Ian Romanick <idr at us.ibm.com>
Date:   Fri Feb 9 12:38:49 2007 -0800

    Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework

diff-tree c4b7e9d1c16797c3e4b1200b40aceab5696a7fb8 (from 262b9b104a04e55969593ef96a16004e53ecd00a)
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Tue Feb 6 14:57:22 2007 -0800

    Add an RDTSC implementation to the x86 emulator.
    
    This instruction is being used in some debug VBIOSes.  This implementation
    doesn't even try to be accurate.  Instead, it just increments the counter by a
    fixed amount every time an rdtsc instruction in encountered, to avoid divides by
    zero.

diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c
index 7b0156a..8c6c535 100644
--- a/hw/xfree86/x86emu/ops2.c
+++ b/hw/xfree86/x86emu/ops2.c
@@ -65,6 +65,40 @@ static void x86emuOp2_illegal_op(
 
 /****************************************************************************
 REMARKS:
+Handles opcode 0x0f,0x31
+****************************************************************************/
+static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
+{
+#ifdef __HAS_LONG_LONG__
+    static u64 counter = 0;
+#else
+    static u32 counter = 0;
+#endif
+
+    counter += 0x10000;
+
+    /* read timestamp counter */
+    /*
+     * Note that instead of actually trying to accurately measure this, we just
+     * increase the counter by a fixed amount every time we hit one of these
+     * instructions.  Feel free to come up with a better method.
+     */
+    START_OF_INSTR();
+    DECODE_PRINTF("RDTSC\n");
+    TRACE_AND_STEP();
+#ifdef __HAS_LONG_LONG__
+    M.x86.R_EAX = counter & 0xffffffff;
+    M.x86.R_EDX = counter >> 32;
+#else
+    M.x86.R_EAX = counter;
+    M.x86.R_EDX = 0;
+#endif
+    DECODE_CLEAR_SEGOVR();
+    END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
 Handles opcode 0x0f,0x80-0x8F
 ****************************************************************************/
 static void x86emuOp2_long_jump(u8 op2)
@@ -2580,7 +2614,7 @@ void (*x86emu_optab2[256])(u8) =
 /*  0x2f */ x86emuOp2_illegal_op,
 
 /*  0x30 */ x86emuOp2_illegal_op,
-/*  0x31 */ x86emuOp2_illegal_op,
+/*  0x31 */ x86emuOp2_rdtsc,
 /*  0x32 */ x86emuOp2_illegal_op,
 /*  0x33 */ x86emuOp2_illegal_op,
 /*  0x34 */ x86emuOp2_illegal_op,
diff-tree 262b9b104a04e55969593ef96a16004e53ecd00a (from 876b806ec09d5ff0c6cd19df91006c4eefedfaa6)
Author: Soren Sandmann Pedersen <ssp at dhcp83-218.boston.redhat.com>
Date:   Tue Feb 6 17:30:22 2007 -0500

    Use the new 8888x0565mmx function in fbpict.c

diff --git a/fb/fbpict.c b/fb/fbpict.c
index 3ff609f..cd6cac2 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1175,7 +1175,12 @@ fbComposite (CARD8      op,
 			func = fbCompositeSrc_8888x0888;
 			break;
 		    case PICT_r5g6b5:
-			func = fbCompositeSrc_8888x0565;
+#ifdef USE_MMX
+			if (fbHaveMMX())
+			    func = fbCompositeSrc_8888x0565mmx;
+			else
+#endif
+			    func = fbCompositeSrc_8888x0565;
 			break;
 		    default:
 			break;
@@ -1221,7 +1226,12 @@ fbComposite (CARD8      op,
 			func = fbCompositeSrc_8888x0888;
 			break;
 		    case PICT_b5g6r5:
-			func = fbCompositeSrc_8888x0565;
+#ifdef USE_MMX
+			if (fbHaveMMX())
+			    func = fbCompositeSrc_8888x0565mmx;
+			else
+#endif
+			    func = fbCompositeSrc_8888x0565;
 			break;
 		    default:
 			break;
diff-tree 876b806ec09d5ff0c6cd19df91006c4eefedfaa6 (from 13568d2aa43da4216bbcb46e1125ff28c323ac54)
Author: Soren Sandmann Pedersen <ssp at dhcp83-218.boston.redhat.com>
Date:   Tue Feb 6 17:16:23 2007 -0500

    Reapply patch to fix AMD CPU detection

diff --git a/fb/fbpict.c b/fb/fbpict.c
index 28503c0..3ff609f 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -1516,7 +1516,9 @@ static unsigned int detectCPUFeatures(vo
             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-tree 13568d2aa43da4216bbcb46e1125ff28c323ac54 (from 5a3334410367a2186b2c667fa1eb6cf0baf93e95)
Author: Soren Sandmann Pedersen <ssp at dhcp83-218.boston.redhat.com>
Date:   Tue Feb 6 17:12:01 2007 -0500

    Revert "Fix for AMD cpu detection. Bug 9614, Dan Williams."
    
    This reverts commit b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 since
    unrelated changes in fbpict.c broke the build.

diff --git a/fb/fbpict.c b/fb/fbpict.c
index 39d8d9f..28503c0 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -189,23 +189,6 @@ fbCompositeSolidMask_nx8888x8888C (CARD8
     fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
     fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
 
-    {
-	comp_image_t src, msk, dst;
-	comp_pixel_t src_pixel;
-	comp_format_t msk_format = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff };
-	
-	src_pixel.red   = src & 0x000000ff;
-	src_pixel.green = src & 0x0000ff00;
-	src_pixel.blue  = src & 0x00ff0000;
-	src_pixel.alpha = src & 0xff000000;
-	
-	comp_image_init_solid (&src, &src_pixel);
-	comp_image_init_bits  (&msk, maskLine, maskStride, &msk_format);
-	comp_image_init_bits  (&dst, dstLine, dstStride, &dst_format);
-
-	comp_over_c (src, msk, dst, srcX, srcY, mskX, mskY, dstX, dstY);
-    }
-    
     while (height--)
     {
 	dst = dstLine;
@@ -1533,9 +1516,7 @@ static unsigned int detectCPUFeatures(vo
             features |= SSE;
         if (result & (1 << 26))
             features |= SSE2;
-        if ((features & MMX) && !(features & SSE) &&
-            (strcmp(vendor, "AuthenticAMD") == 0 ||
-             strcmp(vendor, "Geode by NSC") == 0)) {
+        if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) {
             /* check for AMD MMX extensions */
 
             unsigned int result;            
diff-tree 5a3334410367a2186b2c667fa1eb6cf0baf93e95 (from b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6)
Author: Soren Sandmann Pedersen <ssp at dhcp83-218.boston.redhat.com>
Date:   Tue Feb 6 17:11:01 2007 -0500

    Add new fbCompositeSrc_8888x0565mmx() function, based on patch by Dan
    Williams. Bug 9682.

diff --git a/fb/fbmmx.c b/fb/fbmmx.c
index f74930a..5bbede1 100644
--- a/fb/fbmmx.c
+++ b/fb/fbmmx.c
@@ -1339,6 +1339,104 @@ fbCompositeSrc_8888x8888mmx (CARD8	op,
 }
 
 void
+fbCompositeSrc_8888x0565mmx (CARD8      op,
+			     PicturePtr pSrc,
+			     PicturePtr pMask,
+			     PicturePtr pDst,
+			     INT16      xSrc,
+			     INT16      ySrc,
+			     INT16      xMask,
+			     INT16      yMask,
+			     INT16      xDst,
+			     INT16      yDst,
+			     CARD16     width,
+			     CARD16     height)
+{
+    CARD16	*dstLine, *dst;
+    CARD32	*srcLine, *src;
+    FbStride	dstStride, srcStride;
+    CARD16	w;
+    
+    CHECKPOINT();
+    
+    fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
+    fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
+    
+    assert (pSrc->pDrawable == pMask->pDrawable);
+    
+    while (height--)
+    {
+	dst = dstLine;
+	dstLine += dstStride;
+	src = srcLine;
+	srcLine += srcStride;
+	w = width;
+	
+	CHECKPOINT();
+	
+	while (w && (unsigned long)dst & 7)
+	{
+	    __m64 vsrc = load8888 (*src);
+	    ullong d = *dst;
+	    __m64 vdest = expand565 ((__m64)d, 0);
+	    
+	    vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
+	    
+	    *dst = (ullong)vdest;
+	    
+	    w--;
+	    dst++;
+	    src++;
+	}
+	
+	CHECKPOINT();
+	
+	while (w >= 4)
+	{
+	    __m64 vsrc0, vsrc1, vsrc2, vsrc3;
+	    __m64 vdest;
+
+	    vsrc0 = load8888(*(src + 0));
+	    vsrc1 = load8888(*(src + 1));
+	    vsrc2 = load8888(*(src + 2));
+	    vsrc3 = load8888(*(src + 3));
+
+	    vdest = *(__m64 *)dst;
+	    
+	    vdest = pack565(over(vsrc0, expand_alpha(vsrc0), expand565(vdest, 0)), vdest, 0);
+	    vdest = pack565(over(vsrc1, expand_alpha(vsrc1), expand565(vdest, 1)), vdest, 1);
+	    vdest = pack565(over(vsrc2, expand_alpha(vsrc2), expand565(vdest, 2)), vdest, 2);
+	    vdest = pack565(over(vsrc3, expand_alpha(vsrc3), expand565(vdest, 3)), vdest, 3);
+	    
+	    *(__m64 *)dst = vdest;
+
+	    w -= 4;
+	    dst += 4;
+	    src += 4;
+	}
+
+	CHECKPOINT();
+	
+	while (w)
+	{
+	    __m64 vsrc = load8888 (*src);
+	    ullong d = *dst;
+	    __m64 vdest = expand565 ((__m64)d, 0);
+	    
+	    vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
+	    
+	    *dst = (ullong)vdest;
+	    
+	    w--;
+	    dst++;
+	    src++;
+	}
+    }
+    
+    _mm_empty();
+}
+
+void
 fbCompositeSolidMask_nx8x8888mmx (CARD8      op,
 				  PicturePtr pSrc,
 				  PicturePtr pMask,
diff --git a/fb/fbmmx.h b/fb/fbmmx.h
index 34718e3..b3e4d71 100644
--- a/fb/fbmmx.h
+++ b/fb/fbmmx.h
@@ -130,6 +130,18 @@ void fbCompositeSrc_8888RevNPx8888mmx (C
 				       INT16      yDst,
 				       CARD16     width,
 				       CARD16     height);
+void fbCompositeSrc_8888x0565mmx (CARD8      op,
+				  PicturePtr pSrc,
+				  PicturePtr pMask,
+				  PicturePtr pDst,
+				  INT16      xSrc,
+				  INT16      ySrc,
+				  INT16      xMask,
+				  INT16      yMask,
+				  INT16      xDst,
+				  INT16      yDst,
+				  CARD16     width,
+				  CARD16     height);
 void fbCompositeSrc_8888RevNPx0565mmx (CARD8      op,
 				       PicturePtr pSrc,
 				       PicturePtr pMask,
diff-tree b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 (from 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6)
Author: Soren Sandmann Pedersen <ssp at dhcp83-218.boston.redhat.com>
Date:   Tue Feb 6 16:43:37 2007 -0500

    Fix for AMD cpu detection. Bug 9614, Dan Williams.
    
    Credit for the fixes in this patch goes to:
    
    Marco Gritti <mpg at redhat dot com>
    Jordan Crouse <jordan dot crouse at amd dot com>

diff --git a/fb/fbpict.c b/fb/fbpict.c
index 28503c0..39d8d9f 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -189,6 +189,23 @@ fbCompositeSolidMask_nx8888x8888C (CARD8
     fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
     fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
 
+    {
+	comp_image_t src, msk, dst;
+	comp_pixel_t src_pixel;
+	comp_format_t msk_format = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff };
+	
+	src_pixel.red   = src & 0x000000ff;
+	src_pixel.green = src & 0x0000ff00;
+	src_pixel.blue  = src & 0x00ff0000;
+	src_pixel.alpha = src & 0xff000000;
+	
+	comp_image_init_solid (&src, &src_pixel);
+	comp_image_init_bits  (&msk, maskLine, maskStride, &msk_format);
+	comp_image_init_bits  (&dst, dstLine, dstStride, &dst_format);
+
+	comp_over_c (src, msk, dst, srcX, srcY, mskX, mskY, dstX, dstY);
+    }
+    
     while (height--)
     {
 	dst = dstLine;
@@ -1516,7 +1533,9 @@ static unsigned int detectCPUFeatures(vo
             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-tree 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6 (from 17d85387d1e6851d35474b65929e268ca64ef65b)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Mon Feb 5 03:39:36 2007 +0200

    XkbCopyKeymap: fix copy-and-waste accident
    
    When we reallocated modmap, we accidentally clobbered syms with the
    result, leaving syms definitely too small, and modmap also potentially too
    small (as well as not actually allocated anymore).

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 400306a..062159e 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -1220,7 +1220,7 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
                     tmp = xalloc(src->max_key_code + 1);
                 if (!tmp)
                     return FALSE;
-                dst->map->syms = tmp;
+                dst->map->modmap = tmp;
             }
             memcpy(dst->map->modmap, src->map->modmap, src->max_key_code + 1);
         }
diff-tree 17d85387d1e6851d35474b65929e268ca64ef65b (from 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec)
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Thu Jan 18 15:23:57 2007 +1100

    dmx, vfb, xnest: fix fbcmap compilation
    
    Don't always define XFree86Server, but only for damn fbcmap.c.
    Split fbcmap.c into its own library to achieve this.

diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am
index 89136b9..17d27ed 100644
--- a/hw/dmx/Makefile.am
+++ b/hw/dmx/Makefile.am
@@ -2,6 +2,7 @@ DIST_SUBDIRS = input config glxProxy exa
 
 SUBDIRS = input config examples
 bin_PROGRAMS = Xdmx
+noinst_LIBRARIES = libfbcmap.a
 
 if XINERAMA
 PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
@@ -16,13 +17,20 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/di
 GLX_DEFS = @GL_CFLAGS@ 
 endif
 
-# It's essential that fbcmap.c be compiled with this flag for DMX to work!!
-DMX_CFLAGS = -DXFree86Server=1
-
 if BUILDDOCS
 SUBDIRS += doc
 endif
 
+AM_CFLAGS = \
+      -DHAVE_DMX_CONFIG_H \
+      $(DIX_CFLAGS) \
+      $(GLX_INCS) \
+      $(GLX_DEFS) \
+      @DMXMODULES_CFLAGS@
+
+libfbcmap_a_SOURCES = libfbcmap.a
+libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
+
 Xdmx_SOURCES = dmx.c \
                dmxcb.c \
                dmxcb.h \
@@ -67,7 +75,6 @@ Xdmx_SOURCES = dmx.c \
                dmxvisual.h \
                dmxwindow.c \
                dmxwindow.h \
-               $(top_srcdir)/fb/fbcmap.c \
                $(top_srcdir)/mi/miinitext.c \
                $(GLX_SRCS) 
 
@@ -82,16 +89,9 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \
              $(GLX_LIBS) \
              input/libdmxinput.a \
              config/libdmxconfig.a \
+	     libfbcmap.a \
              @DMXMODULES_LIBS@
 
-Xdmx_CFLAGS = \
-              -DHAVE_DMX_CONFIG_H \
-              $(DIX_CFLAGS) \
-              $(GLX_INCS) \
-              $(GLX_DEFS) \
-              $(DMX_CFLAGS) \
-              @DMXMODULES_CFLAGS@
-
 # Man page
 appmandir = $(APP_MAN_DIR)
 
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 4f711fd..40c3854 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -1,12 +1,21 @@
 bin_PROGRAMS = Xvfb
+noinst_LIBRARIES = libfbcmap.a
+
+AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
+            -DNO_HW_ONLY_EXTS \
+            -DNO_MODULE_EXTS \
+            $(XVFBMODULES_CFLAGS) \
+	    $(DIX_CFLAGS)
 
 SRCS =	InitInput.c \
 	InitOutput.c \
 	lk201kbd.h \
 	$(top_srcdir)/Xext/dpmsstubs.c \
 	$(top_srcdir)/Xi/stubs.c \
-	$(top_srcdir)/mi/miinitext.c \
-	$(top_srcdir)/fb/fbcmap.c
+	$(top_srcdir)/mi/miinitext.c
+
+libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
+libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c
 
 Xvfb_SOURCES = $(SRCS)
 
@@ -14,16 +23,8 @@ Xvfb_LDADD = $(XORG_CORE_LIBS) \
              $(XVFB_LIBS) \
              $(XSERVER_LIBS) \
              $(EXTENSION_LIBS) \
-             $(XVFBMODULES_LIBS)
-
-Xvfb_LDFLAGS =
-
-AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
-            -DNO_HW_ONLY_EXTS \
-            -DNO_MODULE_EXTS \
-            -DXFree86Server \
-            $(XVFBMODULES_CFLAGS) \
-	    $(DIX_CFLAGS)
+             $(XVFBMODULES_LIBS) \
+	     libfbcmap.a
 
 # Man page
 include $(top_srcdir)/cpprules.in
diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am
index cce1fef..b897616 100644
--- a/hw/xnest/Makefile.am
+++ b/hw/xnest/Makefile.am
@@ -1,4 +1,10 @@
 bin_PROGRAMS = Xnest
+noinst_LIBRARIES = libfbcmap.a
+
+AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \
+            -DNO_HW_ONLY_EXTS \
+            $(DIX_CFLAGS) \
+            $(XNESTMODULES_CFLAGS)
 
 SRCS =	Args.c \
 	Args.h \
@@ -37,23 +43,17 @@ SRCS =	Args.c \
 	xnest-config.h \
 	$(top_srcdir)/Xext/dpmsstubs.c \
 	$(top_srcdir)/Xi/stubs.c \
-	$(top_srcdir)/mi/miinitext.c \
-	$(top_srcdir)/fb/fbcmap.c
+	$(top_srcdir)/mi/miinitext.c
 
+libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c
+libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server
 
 Xnest_SOURCES = $(SRCS)
 
 Xnest_LDADD = $(XORG_CORE_LIBS) \
               $(XNEST_LIBS) \
-              $(XNESTMODULES_LIBS)
-
-Xnest_LDFLAGS =
-
-AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \
-            -DNO_HW_ONLY_EXTS \
-            -DXFree86Server \
-            $(DIX_CFLAGS) \
-            $(XNESTMODULES_CFLAGS)
+              $(XNESTMODULES_LIBS) \
+	      libfbcmap.a
 
 EXTRA_DIST = os2Stub.c \
              icon \
diff-tree 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec (from eb228e8d1eaa78911541b2fec5d04a74c1299718)
Author: Dave Airlie <airlied at linux.ie>
Date:   Mon Feb 5 09:09:12 2007 +1100

    remove array_cache from everywhere

diff --git a/GL/mesa/.gitignore b/GL/mesa/.gitignore
index 44e2733..a00885d 100644
--- a/GL/mesa/.gitignore
+++ b/GL/mesa/.gitignore
@@ -2,8 +2,6 @@ X/drivers
 X/glxheader.h
 X/xmesaP.h
 X/xm*.c
-array_cache/*.c
-array_cache/*.h
 mesa/drivers
 mesa/glxheader.h
 mesa/xm*.c
diff --git a/GL/mesa/X/Makefile.am b/GL/mesa/X/Makefile.am
index 2a9f422..45345a7 100644
--- a/GL/mesa/X/Makefile.am
+++ b/GL/mesa/X/Makefile.am
@@ -2,7 +2,6 @@ noinst_LTLIBRARIES = libX.la
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
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 at 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..20b7935 100644
--- a/GL/mesa/main/Makefile.am
+++ b/GL/mesa/main/Makefile.am
@@ -7,7 +7,6 @@ AM_CFLAGS = \
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
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 at 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..3519545 100644
--- a/GL/mesa/shader/Makefile.am
+++ b/GL/mesa/shader/Makefile.am
@@ -9,7 +9,6 @@ AM_CFLAGS = \
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
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 at 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..04001c4 100644
--- a/GL/mesa/shader/slang/Makefile.am
+++ b/GL/mesa/shader/slang/Makefile.am
@@ -8,7 +8,6 @@ AM_CFLAGS = \
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../grammar \
            -I../../X \
-           -I../../array_cache \
            -I../../glapi \
            -I../../main \
            -I../../math \
diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am
index d972af6..5ed6576 100644
--- a/GL/mesa/swrast/Makefile.am
+++ b/GL/mesa/swrast/Makefile.am
@@ -7,7 +7,6 @@ AM_CFLAGS = \
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
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 at 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 b59a5fa..5d9bdb1 100644
--- a/GL/mesa/tnl/Makefile.am
+++ b/GL/mesa/tnl/Makefile.am
@@ -7,7 +7,6 @@ AM_CFLAGS = \
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
diff --git a/GL/mesa/vbo/Makefile.am b/GL/mesa/vbo/Makefile.am
index 09046bb..9943f2a 100644
--- a/GL/mesa/vbo/Makefile.am
+++ b/GL/mesa/vbo/Makefile.am
@@ -7,7 +7,6 @@ AM_CFLAGS = \
 
 INCLUDES = -I at MESA_SOURCE@/include \
            -I../X \
-           -I../array_cache \
            -I../glapi \
            -I../main \
            -I../math \
diff-tree eb228e8d1eaa78911541b2fec5d04a74c1299718 (from fb1bc1c65b88527b42a0e4abed23e5ddaae711b7)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Sun Feb 4 22:06:59 2007 +0000

    clean up more of the vbo fallout

diff --git a/configure.ac b/configure.ac
index d23c3c9..4a33ac0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1838,7 +1838,6 @@ Makefile
 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
diff-tree fb1bc1c65b88527b42a0e4abed23e5ddaae711b7 (from d8e148ec841d340327e6813127b0e0ffc4db712d)
Author: Dave Airlie <airlied at linux.ie>
Date:   Sun Feb 4 18:39:58 2007 +1100

    add vbo to .gitignore

diff --git a/GL/mesa/.gitignore b/GL/mesa/.gitignore
index 82ab827..44e2733 100644
--- a/GL/mesa/.gitignore
+++ b/GL/mesa/.gitignore
@@ -30,3 +30,5 @@ tnl/*.c
 tnl/*.h
 x86
 x86-64
+vbo/*.c
+vbo/*.h
diff-tree d8e148ec841d340327e6813127b0e0ffc4db712d (from 5dcad9e9d7d9993d65f989219bee94a060bbf476)
Author: Dave Airlie <airlied at linux.ie>
Date:   Sun Feb 4 18:39:04 2007 +1100

    update xserver for vbo code in mesa

diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am
index 5393628..99d3834 100644
--- a/GL/mesa/Makefile.am
+++ b/GL/mesa/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = main math swrast swrast_setup tnl shader X glapi
+SUBDIRS = main math swrast swrast_setup tnl shader X glapi vbo
 
 noinst_LTLIBRARIES = libGLcore.la
 
@@ -11,4 +11,5 @@ libGLcore_la_LIBADD = main/libmain.la \
                       shader/libshader.la \
 		      shader/grammar/libgrammar.la \
 		      shader/slang/libslang.la \
+                      vbo/libvbo.la \
                       X/libX.la
diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am
index 717e6fd..b59a5fa 100644
--- a/GL/mesa/tnl/Makefile.am
+++ b/GL/mesa/tnl/Makefile.am
@@ -19,13 +19,9 @@ INCLUDES = -I at 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 \
@@ -42,9 +38,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..09046bb
--- /dev/null
+++ b/GL/mesa/vbo/Makefile.am
@@ -0,0 +1,36 @@
+noinst_LTLIBRARIES = libvbo.la
+
+AM_CFLAGS = \
+	$(DIX_CFLAGS) \
+	-DXFree86Server \
+	@GLX_DEFINES@
+
+INCLUDES = -I at MESA_SOURCE@/include \
+           -I../X \
+           -I../array_cache \
+           -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 4205606..7d1e06e 100755
--- a/GL/symlink-mesa.sh
+++ b/GL/symlink-mesa.sh
@@ -148,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
@@ -205,6 +214,7 @@ symlink_mesa() {
     symlink_mesa_glapi
     symlink_mesa_ppc
     symlink_mesa_sparc
+    symlink_mesa_vbo
     symlink_mesa_x86
     symlink_mesa_x8664
 }
diff --git a/configure.ac b/configure.ac
index c0a2770..d23c3c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1848,6 +1848,7 @@ GL/mesa/shader/slang/Makefile
 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-tree 5dcad9e9d7d9993d65f989219bee94a060bbf476 (from 170a55022ebc7b148bff93886eda152a0d5ce79a)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Fri Feb 2 14:44:55 2007 -0800

    Fix bus error on startup in 64-bit Xephyr
    
    hostx_get_visual_masks takes unsigned long * arguments, but was being
    passed pointers to CARD32's.

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 7db8675..2ca51c3 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -81,7 +81,8 @@ Bool
 ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
 {
   int width = 640, height = 480; 
-
+  unsigned long redMask, greenMask, blueMask;
+  
   if (hostx_want_screen_size(&width, &height) 
       || !screen->width || !screen->height)
     {
@@ -133,30 +134,24 @@ ephyrScreenInitialize (KdScreenInfo *scr
 	{
 	  screen->fb[0].depth = 15;
 	  screen->fb[0].bitsPerPixel = 16;
-	  
-	  hostx_get_visual_masks (&screen->fb[0].redMask,
-				  &screen->fb[0].greenMask,
-				  &screen->fb[0].blueMask);
-	  
 	}
       else if (screen->fb[0].depth <= 16)
 	{
 	  screen->fb[0].depth = 16;
 	  screen->fb[0].bitsPerPixel = 16;
-	  
-	  hostx_get_visual_masks (&screen->fb[0].redMask,
-				  &screen->fb[0].greenMask,
-				  &screen->fb[0].blueMask);
 	}
       else
 	{
 	  screen->fb[0].depth = 24;
 	  screen->fb[0].bitsPerPixel = 32;
-	  
-	  hostx_get_visual_masks (&screen->fb[0].redMask,
-				  &screen->fb[0].greenMask,
-				  &screen->fb[0].blueMask);
 	}
+
+      hostx_get_visual_masks (&redMask, &greenMask, &blueMask);
+
+      screen->fb[0].redMask = (Pixel) redMask;
+      screen->fb[0].greenMask = (Pixel) greenMask;
+      screen->fb[0].blueMask = (Pixel) blueMask;
+
     }
   
   scrpriv->randr = screen->randr;
diff-tree 170a55022ebc7b148bff93886eda152a0d5ce79a (from e6a505be84f5f72349d6860dc5a5058367516019)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Fri Feb 2 20:56:12 2007 +0000

    remove file

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 at 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-tree e6a505be84f5f72349d6860dc5a5058367516019 (from af20485ec370801f2aabfaeae17bbd030a849bd1)
Author: Dan Nicholson <dan at conor.dwcab.com>
Date:   Fri Feb 2 20:53:01 2007 +0000

    The array_cache sources don't exist anymore in the Mesa tree,
    so we shouldn't try to build them.

diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am
index 18eebfc..5393628 100644
--- a/GL/mesa/Makefile.am
+++ b/GL/mesa/Makefile.am
@@ -1,11 +1,10 @@
-SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi
+SUBDIRS = main math swrast swrast_setup tnl shader X glapi
 
 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 \
diff-tree af20485ec370801f2aabfaeae17bbd030a849bd1 (from cf5b29d75dad7c74543f49f010c817623a3df747)
Author: Alan Hourihane <alanh at fairlite.demon.co.uk>
Date:   Fri Feb 2 19:14:46 2007 +0000

    Remove array_cache for recent Mesa changes

diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh
index 9687ce8..4205606 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
@@ -203,7 +194,6 @@ symlink_mesa_x8664() {
 symlink_mesa() {
     symlink_mesa_main
     symlink_mesa_math
-    symlink_mesa_ac
     symlink_mesa_swrast
     symlink_mesa_ss
     symlink_mesa_tnl
diff-tree cf5b29d75dad7c74543f49f010c817623a3df747 (from 4f2f3233c808fd86bf9f6c09937feda9e0b367fd)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date:   Fri Feb 2 12:57:38 2007 +0200

    dmx: drop leftover __GLXdrawablePrivateRec struct.

diff --git a/hw/dmx/glxProxy/glxdrawable.h b/hw/dmx/glxProxy/glxdrawable.h
index 59fffa7..baed683 100644
--- a/hw/dmx/glxProxy/glxdrawable.h
+++ b/hw/dmx/glxProxy/glxdrawable.h
@@ -49,58 +49,6 @@ typedef struct {
 
 } __GLXpixmap;
 
-struct __GLXdrawablePrivateRec {
-    /*
-    ** list of drawable private structs
-    */
-    struct __GLXdrawablePrivateRec *last;
-    struct __GLXdrawablePrivateRec *next;
-
-    DrawablePtr pDraw;
-    XID drawId;
-    __GLXpixmap *pGlxPixmap;
-
-    /*
-    ** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
-    ** Needed by the resource freer because pDraw might already have been
-    ** freed.
-    */
-    int type;
-
-    /*
-    ** Configuration of the visual to which this drawable was created.
-    */
-    __GLXvisualConfig *pGlxVisual;
-
-    /*
-    ** cached drawable size and origin
-    */
-    GLint xorigin, yorigin;
-    GLint width, height;
-
-    /*
-    ** list of contexts bound to this drawable
-    */
-    struct __GLXcontextRec *glxc;
-
-    /*
-    ** "methods" that the drawble should be able to respond to.
-    */
-    void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
-    void (*updatePalette)(struct __GLXdrawablePrivateRec *);
-    GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
-
-    /*
-    ** The GL drawable (information shared between GLX and the GL core)
-    */
-    __GLdrawablePrivate glPriv;
-
-    /*
-    ** reference count
-    */
-    int refCount;
-};
-
 typedef struct {
     DrawablePtr pDraw;
     int type;
diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
index db5be43..021d4c1 100644
--- a/hw/dmx/glxProxy/glxserver.h
+++ b/hw/dmx/glxProxy/glxserver.h
@@ -58,9 +58,6 @@
 #include <GL/glxproto.h>
 #include <GL/glxint.h>
 
-/* For glxscreens.h */
-typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
-
 #include "glxscreens.h"
 #include "glxdrawable.h"
 #include "glxcontext.h"
diff-tree 4f2f3233c808fd86bf9f6c09937feda9e0b367fd (from 8274ea6aa97b06a56b7468c3908894c0ff72b687)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Feb 1 15:10:29 2007 -0800

    Fix the size expectations of xRRSetCrtcGamma.
    
    It was using REQUEST_SIZE_MATCH (client request length must equal request size)
    rather than REQUEST_AT_LEAST_SIZE (client request length must be at least
    big enough for request size), and this request has data following the request
    structure.

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index c84ec61..fdd1d42 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -870,7 +870,7 @@ ProcRRSetCrtcGamma (ClientPtr client)
     unsigned long		len;
     CARD16			*red, *green, *blue;
     
-    REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
+    REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
     crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
     if (!crtc)
 	return RRErrorBase + BadRRCrtc;
diff-tree 8274ea6aa97b06a56b7468c3908894c0ff72b687 (from 8bce182568f14edfb03911d8c5d791fd83bb6222)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Feb 1 12:15:54 2007 -0800

    Set the Damage version supported in the server, instead of using damageproto.
    
    This was caught by distributions upgrading damageproto to 1.1, before the
    server they had supported it.  The server then advertised the new version
    without supporting the protocol.

diff --git a/damageext/damageext.c b/damageext/damageext.c
index ae1091e..739d20f 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -35,6 +35,13 @@ int		DamageClientPrivateIndex;
 RESTYPE		DamageExtType;
 RESTYPE		DamageExtWinType;
 
+/* Version of the damage extension supported by the server, as opposed to the
+ * DAMAGE_* defines from damageproto for what version the proto header
+ * supports.
+ */
+#define SERVER_DAMAGE_MAJOR	1
+#define SERVER_DAMAGE_MINOR	1
+
 #define prScreen	screenInfo.screens[0]
 
 static void
@@ -143,16 +150,16 @@ ProcDamageQueryVersion(ClientPtr client)
     rep.type = X_Reply;
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
-    if (stuff->majorVersion < DAMAGE_MAJOR) {
+    if (stuff->majorVersion < SERVER_DAMAGE_MAJOR) {
 	rep.majorVersion = stuff->majorVersion;
 	rep.minorVersion = stuff->minorVersion;
     } else {
-	rep.majorVersion = DAMAGE_MAJOR;
-	if (stuff->majorVersion == DAMAGE_MAJOR && 
-	    stuff->minorVersion < DAMAGE_MINOR)
+	rep.majorVersion = SERVER_DAMAGE_MAJOR;
+	if (stuff->majorVersion == SERVER_DAMAGE_MAJOR && 
+	    stuff->minorVersion < SERVER_DAMAGE_MINOR)
 	    rep.minorVersion = stuff->minorVersion;
 	else
-	    rep.minorVersion = DAMAGE_MINOR;
+	    rep.minorVersion = SERVER_DAMAGE_MINOR;
     }
     pDamageClient->major_version = rep.majorVersion;
     pDamageClient->minor_version = rep.minorVersion;
diff-tree 8bce182568f14edfb03911d8c5d791fd83bb6222 (from 31f2d4a57e04f5ea635fbb50c508405c4fc37b65)
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan 29 17:30:59 2007 -0800

    Restore a few important lines killed in the previous commit.
    
    Typical results were failure to sync, and a black screen.

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 7f5ae36..d5085b5 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -725,6 +725,11 @@ xf86SetModeCrtc(DisplayModePtr p, int ad
         p->CrtcVSyncEnd         *= p->VScan;
         p->CrtcVTotal           *= p->VScan;
     }
+    p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
+    p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
+    p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
+    p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
+
     p->CrtcHAdjusted = FALSE;
     p->CrtcVAdjusted = FALSE;
 }
diff-tree 3814862a869ee83d307eb01225d5949039f435d8 (from parents)
Merge: a216de9b7ff55e2b73c487d037f248f00bd2e63b 31f2d4a57e04f5ea635fbb50c508405c4fc37b65
Author: Ian Romanick <idr at us.ibm.com>
Date:   Mon Jan 29 15:14:31 2007 -0800

    Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework
    
    Conflicts:
    
    	hw/xfree86/os-support/bus/linuxPci.c

diff --cc hw/xfree86/os-support/bus/linuxPci.c
index 46ca083,55ed878..c8f43c9
@@@ -398,10 -570,8 +398,11 @@@
  
  	xf86InitVidMem();
  
 -       prot = ((Flags & VIDMEM_READONLY) == 0);
 -       if (((fd = linuxPciOpenFile(Tag, prot)) < 0) ||
 +	/* If dev is NULL, linuxPciOpenFile will return -1, and this routine
 +	 * will fail gracefully.
 +	 */
- 	if (((fd = linuxPciOpenFile(dev, FALSE)) < 0) ||
++        prot = ((Flags & VIDMEM_READONLY) == 0);
++        if (((fd = linuxPciOpenFile(Tag, prot)) < 0) ||
  	    (ioctl(fd, mmap_ioctl, 0) < 0))
  	    break;
  
diff-tree 31f2d4a57e04f5ea635fbb50c508405c4fc37b65 (from 1627af54497bee659ea30f2850b39cbbf576e22d)
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan 29 09:39:33 2007 -0800

    Bug #9680: Remove bogus blank length limiting in xf86SetModeCrtc().
    
    Our modes typically come from EDID or default modes, and when the monitor
    asks for a specific mode, deciding to tweak it usually results in incorrect
    display.  And if the user is specifying a mode by hand, tweaking it then is
    still pretty rude.
    
    Reviewed by: ajax

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 3cebac7..7f5ae36 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -727,45 +727,6 @@ xf86SetModeCrtc(DisplayModePtr p, int ad
     }
     p->CrtcHAdjusted = FALSE;
     p->CrtcVAdjusted = FALSE;
-
-    /*
-     * XXX
-     *
-     * The following is taken from VGA, but applies to other cores as well.
-     */
-    p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
-    p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
-    if ((p->CrtcVBlankEnd - p->CrtcVBlankStart) >= 127) {
-        /* 
-         * V Blanking size must be < 127.
-         * Moving blank start forward is safer than moving blank end
-         * back, since monitors clamp just AFTER the sync pulse (or in
-         * the sync pulse), but never before.
-         */
-        p->CrtcVBlankStart = p->CrtcVBlankEnd - 127;
-	/*
-	 * If VBlankStart is now > VSyncStart move VBlankStart
-	 * to VSyncStart using the maximum width that fits into
-	 * VTotal.
-	 */
-	if (p->CrtcVBlankStart > p->CrtcVSyncStart) {
-	    p->CrtcVBlankStart = p->CrtcVSyncStart;
-	    p->CrtcVBlankEnd = min(p->CrtcHBlankStart + 127, p->CrtcVTotal);
-	}
-    }
-    p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
-    p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
-
-    if ((p->CrtcHBlankEnd - p->CrtcHBlankStart) >= 63 * 8) {
-        /*
-         * H Blanking size must be < 63*8. Same remark as above.
-         */
-        p->CrtcHBlankStart = p->CrtcHBlankEnd - 63 * 8;
-	if (p->CrtcHBlankStart > p->CrtcHSyncStart) {
-	    p->CrtcHBlankStart = p->CrtcHSyncStart;
-	    p->CrtcHBlankEnd = min(p->CrtcHBlankStart + 63 * 8, p->CrtcHTotal);
-	}
-    }
 }
 
 /**
diff-tree 1627af54497bee659ea30f2850b39cbbf576e22d (from cf7ca9d09cba14d107152a5179de38e5ef7bd784)
Author: Jonathan Lim <jlim at sgi.com>
Date:   Fri Jan 26 13:00:45 2007 +0100

    Call linuxPciOpenFile() for r/w access if applicable.
    
    Currently, the call to linuxPciOpenFile() is always made for read
    only access which causes the subsequent mmap call to fail when the
    memory is mapped read/write.
    
    Xorg #9692

diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 03388f1..55ed878 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -570,7 +570,8 @@ linuxMapPci(int ScreenNum, int Flags, PC
 
 	xf86InitVidMem();
 
-	if (((fd = linuxPciOpenFile(Tag ,FALSE)) < 0) ||
+       prot = ((Flags & VIDMEM_READONLY) == 0);
+       if (((fd = linuxPciOpenFile(Tag, prot)) < 0) ||
 	    (ioctl(fd, mmap_ioctl, 0) < 0))
 	    break;
 
diff-tree a216de9b7ff55e2b73c487d037f248f00bd2e63b (from parents)
Merge: 24506ea65be4cb29c5e1486aa0a529a40ce5c230 cf7ca9d09cba14d107152a5179de38e5ef7bd784
Author: Ian Romanick <idr at us.ibm.com>
Date:   Thu Jan 25 10:17:32 2007 -0800

    Merge branch 'master' of ssh+git://idr@git.freedesktop.org/git/xorg/xserver into pci-rework

diff-tree cf7ca9d09cba14d107152a5179de38e5ef7bd784 (from 5abd50e37ceda134897891ed32e05215db67e0b4)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Wed Jan 24 20:20:48 2007 -0800

    Plug memory leak in doLoadModule()

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 12f5dc9..ec0f181 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -903,7 +903,7 @@ doLoadModule(const char *module, const c
      * check the elements in the path
      */
     if (PathIsAbsolute(module))
-	xstrdup(module);
+	found = xstrdup(module);
     path_elem = pathlist;
     while (!found && *path_elem != NULL) {
 	found = FindModule(m, *path_elem, subdirlist, patterns);
diff-tree 5abd50e37ceda134897891ed32e05215db67e0b4 (from b32a40817fc0e2ac2edf2fa22a8813087fce2e7b)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Wed Jan 24 18:54:38 2007 -0800

    Correct help lines for configure's --with-vendor-name flags

diff --git a/configure.ac b/configure.ac
index c3107dc..c0a2770 100644
--- a/configure.ac
+++ b/configure.ac
@@ -398,11 +398,11 @@ AC_ARG_ENABLE(debug,         AS_HELP_STR
 AC_ARG_WITH(int10,           AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
 				[INT10="$withval"],
 				[INT10="$DEFAULT_INT10"])
-AC_ARG_WITH(vendor-name,     AS_HELP_STRING([--with-vendor-string=VENDOR],
+AC_ARG_WITH(vendor-name,     AS_HELP_STRING([--with-vendor-name=VENDOR],
 				  [Vendor string reported by the server]),
 			     	[ VENDOR_STRING="$withval" ],
 			     	[ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ])
-AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-string-short=VENDOR],
+AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR],
 				  [Short version of vendor string reported by the server]),
 			     	[ VENDOR_STRING_SHORT="$withval" ],
 			     	[ VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ])
diff-tree b32a40817fc0e2ac2edf2fa22a8813087fce2e7b (from a53586eebc166e35c1f48942205832810061daee)
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Wed Jan 24 16:29:49 2007 -0800

    Correct variable descriptions in comment for SecurityCheckResourceIDAccess

diff --git a/Xext/security.c b/Xext/security.c
index 4fbf6f2..bd397a9 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -946,10 +946,10 @@ SecurityAuditResourceIDAccess(
  *	rtype is its type or class.
  *	access_mode represents the intended use of the resource; see
  *	  resource.h.
- *	rval is a pointer to the resource structure for this resource.
+ *	res is a pointer to the resource structure for this resource.
  *
  * Returns:
- *	If access is granted, the value of rval that was passed in, else NULL.
+ *	If access is granted, the value of rval that was passed in, else FALSE.
  *
  * Side Effects:
  *	Disallowed resource accesses are audited.



More information about the xorg-commit mailing list