6742579 integrate Mesa 7.0.3 to work with Xorg 1.3
authorNiveditha Rau <Niveditha.Rau@Sun.COM>
Fri, 05 Sep 2008 14:48:23 -0700
changeset 527 9765e161a086
parent 526 86cc0954813f
child 528 f4fd87f85ec5
6742579 integrate Mesa 7.0.3 to work with Xorg 1.3
open-src/lib/mesa/6742579.patch
open-src/lib/mesa/Makefile
open-src/lib/mesa/solaris-dri-port.patch
open-src/lib/mesa/solaris-paths.patch
open-src/lib/mesa/sun-src/configs/solaris-x64-gcc-dri
open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri
open-src/xserver/Makefile.inc
open-src/xserver/xorg/6742579.patch
open-src/xserver/xorg/Makefile
open-src/xserver/xorg/patch-list
open-src/xserver/xorg/sun-src/mesa/Makefile.am
open-src/xserver/xvnc/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/mesa/6742579.patch	Fri Sep 05 14:48:23 2008 -0700
@@ -0,0 +1,422 @@
+--- include/GL/internal/glcore.h	Thu Jun 19 16:28:49 2008
++++ include/GL/internal/glcore.h	Thu Jun 19 16:33:23 2008
+@@ -38,11 +38,17 @@
+ 
+ #include <sys/types.h>
+ 
++#ifdef CAPI
++#undef CAPI
++#endif
++#define CAPI
++
+ #define GL_CORE_SGI  1
+ #define GL_CORE_MESA 2
+ #define GL_CORE_APPLE 4
+ 
+ typedef struct __GLcontextRec __GLcontext;
++typedef struct __GLinterfaceRec __GLinterface;
+ 
+ /*
+ ** This file defines the interface between the GL core and the surrounding
+@@ -180,4 +186,333 @@
+ #define GLX_TEXTURE_2D_BIT_EXT             0x00000002
+ #define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
+ 
++/************************************************************************/
++
++/*
++** Structure used for allocating and freeing drawable private memory.
++** (like software buffers, for example).
++**
++** The memory allocation routines are provided by the surrounding
++** "operating system" code, and they are to be used for allocating
++** software buffers and things which are associated with the drawable,
++** and used by any context which draws to that drawable.  There are
++** separate memory allocation functions for drawables and contexts
++** since drawables and contexts can be created and destroyed independently
++** of one another, and the "operating system" may want to use separate
++** allocation arenas for each.
++**
++** The freePrivate function is filled in by the core routines when they
++** allocates software buffers, and stick them in "private".  The freePrivate
++** function will destroy anything allocated to this drawable (to be called
++** when the drawable is destroyed).
++*/
++typedef struct __GLdrawableRegionRec __GLdrawableRegion;
++typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
++typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
++
++typedef struct __GLregionRectRec {
++    /* lower left (inside the rectangle) */
++    GLint x0, y0;
++    /* upper right (outside the rectangle) */
++    GLint x1, y1;
++} __GLregionRect;
++
++struct __GLdrawableRegionRec {
++    GLint numRects;
++    __GLregionRect *rects;
++    __GLregionRect boundingRect;
++};
++
++/************************************************************************/
++
++/* masks for the buffers */
++#define __GL_FRONT_BUFFER_MASK		0x00000001
++#define	__GL_FRONT_LEFT_BUFFER_MASK	0x00000001
++#define	__GL_FRONT_RIGHT_BUFFER_MASK	0x00000002
++#define	__GL_BACK_BUFFER_MASK		0x00000004
++#define __GL_BACK_LEFT_BUFFER_MASK	0x00000004
++#define __GL_BACK_RIGHT_BUFFER_MASK	0x00000008
++#define	__GL_ACCUM_BUFFER_MASK		0x00000010
++#define	__GL_DEPTH_BUFFER_MASK		0x00000020
++#define	__GL_STENCIL_BUFFER_MASK	0x00000040
++#define	__GL_AUX_BUFFER_MASK(i)		(0x0000080 << (i))
++
++#define __GL_ALL_BUFFER_MASK		0xffffffff
++
++/* what Resize routines return if resize resorted to fallback case */
++#define __GL_BUFFER_FALLBACK	0x10
++
++typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, 
++				      __GLdrawablePrivate *glPriv, GLint bits);
++typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, 
++				  __GLdrawablePrivate *glPriv, GLint bits,
++				  __GLbufFallbackInitFn back);
++
++/*
++** A drawable buffer
++**
++** This data structure describes the context side of a drawable.  
++**
++** According to the spec there could be multiple contexts bound to the same
++** drawable at the same time (from different threads).  In order to avoid
++** multiple-access conflicts, locks are used to serialize access.  When a
++** thread needs to access (read or write) a member of the drawable, it takes
++** a lock first.  Some of the entries in the drawable are treated "mostly
++** constant", so we take the freedom of allowing access to them without
++** taking a lock (for optimization reasons).
++**
++** For more details regarding locking, see buffers.h in the GL core
++*/
++struct __GLdrawableBufferRec {
++    /*
++    ** Buffer dimensions
++    */
++    GLint width, height, depth;
++
++    /*
++    ** Framebuffer base address
++    */
++    void *base;
++
++    /*
++    ** Framebuffer size (in bytes)
++    */
++    GLuint size;
++
++    /*
++    ** Size (in bytes) of each element in the framebuffer
++    */
++    GLuint elementSize;
++    GLuint elementSizeLog2;
++
++    /*
++    ** Element skip from one scanline to the next.
++    ** If the buffer is part of another buffer (for example, fullscreen
++    ** front buffer), outerWidth is the width of that buffer.
++    */
++    GLint outerWidth;
++
++    /*
++    ** outerWidth * elementSize
++    */
++    GLint byteWidth;
++
++    /*
++    ** Allocation/deallocation is done based on this handle.  A handle
++    ** is conceptually different from the framebuffer 'base'.
++    */
++    void *handle;
++
++    /* imported */
++    GLboolean (*resize)(__GLdrawableBuffer *buf,
++			GLint x, GLint y, GLuint width, GLuint height, 
++			__GLdrawablePrivate *glPriv, GLuint bufferMask);
++    void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
++    void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
++    void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
++    		GLuint val, GLint x, GLint y, GLint w, GLint h);
++    void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
++
++    /* exported */
++    void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
++#ifdef __cplusplus
++    void *privatePtr;
++#else
++    void *private;
++#endif
++
++    /* private */
++    void *other;	/* implementation private data */
++    __GLbufMainInitFn mainInit;
++    __GLbufFallbackInitFn fallbackInit;
++};
++
++/*
++** The context side of the drawable private
++*/
++struct __GLdrawablePrivateRec {
++    /*
++    ** Drawable Modes
++    */
++    __GLcontextModes *modes;
++
++    /*
++    ** Drawable size
++    */
++    GLuint width, height;
++
++    /*
++    ** Origin in screen coordinates of the drawable
++    */
++    GLint xOrigin, yOrigin;
++#ifdef __GL_ALIGNED_BUFFERS
++    /*
++    ** Drawable offset from screen origin
++    */
++    GLint xOffset, yOffset;
++
++    /*
++    ** Alignment restriction
++    */
++    GLint xAlignment, yAlignment;
++#endif
++    /*
++    ** Should we invert the y axis?
++    */
++    GLint yInverted;
++
++    /*
++    ** Mask specifying which buffers are renderable by the hw
++    */
++    GLuint accelBufferMask;
++
++    /*
++    ** the buffers themselves
++    */
++    __GLdrawableBuffer frontBuffer;
++    __GLdrawableBuffer backBuffer;
++    __GLdrawableBuffer accumBuffer;
++    __GLdrawableBuffer depthBuffer;
++    __GLdrawableBuffer stencilBuffer;
++#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
++    __GLdrawableBuffer *auxBuffer;
++#endif
++
++    __GLdrawableRegion ownershipRegion;
++
++    /*
++    ** Lock for the drawable private structure
++    */
++    void *lock;
++#ifdef DEBUG
++    /* lock debugging info */
++    int lockRefCount;
++    int lockLine[10];
++    char *lockFile[10];
++#endif
++
++    /* imported */
++    void *(*malloc)(size_t size);
++    void *(*calloc)(size_t numElem, size_t elemSize);
++    void *(*realloc)(void *oldAddr, size_t newSize);
++    void (*free)(void *addr);
++
++    GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, 
++			     GLint x, GLint y, GLsizei width, GLsizei height);
++    void (*setClipRect)(__GLdrawablePrivate *glPriv, 
++			GLint x, GLint y, GLsizei width, GLsizei height);
++    void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
++    GLboolean (*resize)(__GLdrawablePrivate *glPriv);
++    void (*getDrawableSize)(__GLdrawablePrivate *glPriv, 
++			    GLint *x, GLint *y, GLuint *width, GLuint *height);
++
++    void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
++    void (*unlockDP)(__GLdrawablePrivate *glPriv);
++
++    /* exported */
++#ifdef __cplusplus
++    void *privatePtr;
++#else
++    void *private;
++#endif
++    void (*freePrivate)(__GLdrawablePrivate *);
++
++    /* client data */
++    void *other;
++};
++
++/*
++** Macros to lock/unlock the drawable private
++*/
++#if defined(DEBUG)
++#define __GL_LOCK_DP(glPriv,gc) \
++    (*(glPriv)->lockDP)(glPriv,gc); \
++    (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
++    (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
++    (glPriv)->lockRefCount++
++#define __GL_UNLOCK_DP(glPriv) \
++    (glPriv)->lockRefCount--; \
++    (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
++    (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
++    (*(glPriv)->unlockDP)(glPriv)
++#else /* DEBUG */
++#define __GL_LOCK_DP(glPriv,gc)		(*(glPriv)->lockDP)(glPriv,gc)
++#define	__GL_UNLOCK_DP(glPriv)		(*(glPriv)->unlockDP)(glPriv)
++#endif /* DEBUG */
++
++
++/*
++** Procedures which are imported by the GL from the surrounding
++** "operating system".  Math functions are not considered part of the
++** "operating system".
++*/
++typedef struct __GLimportsRec {
++    /* Memory management */
++    void * (*malloc)(__GLcontext *gc, size_t size);
++    void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
++    void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
++    void (*free)(__GLcontext *gc, void *addr);
++
++    /* Error handling */
++    void (*warning)(__GLcontext *gc, char *fmt);
++    void (*fatal)(__GLcontext *gc, char *fmt);
++
++    /* other system calls */
++    char *(CAPI *getenv)(__GLcontext *gc, const char *var);
++    int (CAPI *atoi)(__GLcontext *gc, const char *str);
++    int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
++    void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
++    int (CAPI *fclose)(__GLcontext *gc, void *stream);
++    int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
++
++    /* Drawing surface management */
++    __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
++    __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc);
++
++    /* Operating system dependent data goes here */
++    void *other;
++} __GLimports;
++
++/************************************************************************/
++
++/*
++** Procedures which are exported by the GL to the surrounding "operating
++** system" so that it can manage multiple GL context's.
++*/
++typedef struct __GLexportsRec {
++    /* Context management (return GL_FALSE on failure) */
++    GLboolean (*destroyContext)(__GLcontext *gc);
++    GLboolean (*loseCurrent)(__GLcontext *gc);
++    /* oldglPriv isn't used anymore, kept for backwards compatibility */
++    GLboolean (*makeCurrent)(__GLcontext *gc);
++    GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
++    GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
++    GLboolean (*forceCurrent)(__GLcontext *gc);
++
++    /* Drawing surface notification callbacks */
++    GLboolean (*notifyResize)(__GLcontext *gc);
++    void (*notifyDestroy)(__GLcontext *gc);
++    void (*notifySwapBuffers)(__GLcontext *gc);
++
++    /* Dispatch table override control for external agents like libGLS */
++    struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
++    void (*beginDispatchOverride)(__GLcontext *gc);
++    void (*endDispatchOverride)(__GLcontext *gc);
++} __GLexports;
++
++/************************************************************************/
++
++/*
++** This must be the first member of a __GLcontext structure.  This is the
++** only part of a context that is exposed to the outside world; everything
++** else is opaque.
++*/
++struct __GLinterfaceRec {
++    __GLimports imports;
++    __GLexports exports;
++};
++
++extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
++extern void __glCoreNopDispatch(void);
++
+ #endif /* __gl_core_h_ */
+
+--- include/GL/glext.h	Thu Jun 19 16:09:43 2008
++++ include/GL/glext.h	Thu Jun 19 16:11:18 2008
+@@ -3422,9 +3422,9 @@
+ /* (as used in the GL_EXT_timer_query extension). */
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #include <inttypes.h>
+-#elif defined(__sun__)
++#elif defined(sun)
+ #include <inttypes.h>
+-#if defined(__STDC__)
++#elif defined(__STDC__)
+ #if defined(__arch64__)
+ typedef long int int64_t;
+ typedef unsigned long int uint64_t;
+@@ -3450,7 +3450,6 @@
+ #else
+ #include <inttypes.h>     /* Fallback option */
+ #endif
+-#endif
+ 
+ #ifndef GL_EXT_timer_query
+ typedef int64_t GLint64EXT;
+
+
+--- include/GL/glxext.h	Thu Jun 19 16:13:43 2008
++++ include/GL/glxext.h	Thu Jun 19 16:14:31 2008
+@@ -386,9 +386,9 @@
+ /* (as used in the GLX_OML_sync_control extension). */
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #include <inttypes.h>
+-#elif defined(__sun__) || defined(__digital__)
++#elif defined(sun) || defined(__digital__)
+ #include <inttypes.h>
+-#if defined(__STDC__)
++#elif defined(__STDC__)
+ #if defined(__arch64__)
+ typedef long int int64_t;
+ typedef unsigned long int uint64_t;
+@@ -414,7 +414,6 @@
+ #else
+ #include <inttypes.h>     /* Fallback option */
+ #endif
+-#endif
+ 
+ #ifndef GLX_VERSION_1_3
+ #define GLX_VERSION_1_3 1
+
+--- src/mesa/drivers/dri/i965/intel_buffers.c     Thu Nov  1 08:30:52 2007
++++ src/mesa/drivers/dri/i965/intel_buffers.c        Thu Sep  4 21:35:02 2008
+@@ -192,6 +192,7 @@
+       }
+    }
+ 
++#if 0
+    {
+       if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
+         volatile drmI830Sarea *sarea = intel->sarea;
+@@ -224,6 +225,8 @@
+          intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
+       }
+    }
++#endif
++
+    _mesa_resize_framebuffer(&intel->ctx,
+                            (GLframebuffer*)dPriv->driverPrivate,
+                            dPriv->w, dPriv->h);
+
--- a/open-src/lib/mesa/Makefile	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/lib/mesa/Makefile	Fri Sep 05 14:48:23 2008 -0700
@@ -28,14 +28,14 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.13	08/08/08
+# @(#)Makefile	1.14	08/09/05
 #
 
 # Package name used in tarballs
 MODULE_NAME=mesa
 
 # Version number (used in path names)
-MODULE_VERSION=6.5.2
+MODULE_VERSION=7.0.3
 
 # Source tarball
 SOURCE_TARBALL_NAME=MesaLib-$(MODULE_VERSION).tar.bz2
@@ -57,14 +57,10 @@
 	solaris-paths.patch	\
 	mklib.patch		\
 	solaris-dri-port.patch	\
-	glext.h.patch		\
-	glxext.h.patch		\
+	6742579.patch		\
+	mesa965.patch		\
 	6538497.patch		\
-	6559710.patch		\
-	mesa965.patch		\
-	6709716.patch		\
-	6709720.patch		\
-	maxtexunit.patch
+	6559710.patch
 
 # Need to use GNU Make to build
 MODULE_MAKE=$(GNUMAKE)
--- a/open-src/lib/mesa/solaris-dri-port.patch	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/lib/mesa/solaris-dri-port.patch	Fri Sep 05 14:48:23 2008 -0700
@@ -236,17 +236,6 @@
  #if DO_TRI
     TAB[IND].triangle = TAG(triangle);
 
---- src/mesa/drivers/dri/Makefile.template	2006-07-12 19:43:20.000000000 -0700
-+++ src/mesa/drivers/dri/Makefile.template	2006-11-09 18:34:11.827373000 -0800
-@@ -49,7 +49,7 @@
- 	-I$(TOP)/src/mesa/swrast_setup \
- 	-I$(TOP)/src/egl/main \
- 	-I$(TOP)/src/egl/drivers/dri \
--	`pkg-config --cflags libdrm`
-+	$(LIBDRM_CFLAGS)
- 
- ##### RULES #####
-
 --- src/mesa/drivers/dri/common/mmio.h	Mon Apr 25 11:03:10 2005
 +++ src/mesa/drivers/dri/common/mmio.h	Mon Jul  2 21:19:02 2007
 @@ -34,6 +34,7 @@
--- a/open-src/lib/mesa/solaris-paths.patch	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/lib/mesa/solaris-paths.patch	Fri Sep 05 14:48:23 2008 -0700
@@ -6,8 +6,8 @@
  # Installation directories (for make install)
 -INSTALL_DIR = /usr/local
 -DRI_DRIVER_INSTALL_DIR = /usr/X11R6/lib/modules/dri
-+INSTALL_DIR = $(DESTDIR)/usr/X11$(ARCHLIBSUBDIR)
-+DRI_DRIVER_INSTALL_DIR = $(DESTDIR)/usr/X11/lib/modules/dri$(ARCHLIBSUBDIR)
++INSTALL_DIR = /usr/X11$(ARCHLIBSUBDIR)
++DRI_DRIVER_INSTALL_DIR = /usr/X11/lib/modules/dri$(ARCHLIBSUBDIR)
  
  # Where libGL will look for DRI hardware drivers
  DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
--- a/open-src/lib/mesa/sun-src/configs/solaris-x64-gcc-dri	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/lib/mesa/sun-src/configs/solaris-x64-gcc-dri	Fri Sep 05 14:48:23 2008 -0700
@@ -5,7 +5,7 @@
 
 CONFIG_NAME = solaris-x64-gcc-dri
 
-EXTRA_LIB_PATH = -L/usr/X11/lib/64 -R/usr/X11/lib/64
+EXTRA_LIB_PATH = -L/usr/X11/lib/64 -R/usr/X11/lib/64 -lXdamage -lXfixes
 
 EXPAT_LIB= -L/usr/sfw/lib/64 -R/usr/sfw/lib/64 -lexpat
 
--- a/open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/lib/mesa/sun-src/configs/solaris-x86-gcc-dri	Fri Sep 05 14:48:23 2008 -0700
@@ -45,9 +45,9 @@
 
 EXPAT_LIB= -L/usr/sfw/lib -R/usr/sfw/lib -lexpat
 
-GL_LIB_DEPS += -lXxf86vm $(LIBDRM_LIB) -lc -Wl,-M,mapfile.scope
+GL_LIB_DEPS += -L/usr/X11/lib -lXdamage -lXfixes -R/usr/X11/lib -lXdamage -lXfixes -lXxf86vm $(LIBDRM_LIB) -lc -Wl,-M,mapfile.scope
 DRI_LIB_DEPS = $(LIBDRM_LIB) $(EXPAT_LIB) -l$(GL_LIB) -lm -lc 
-APP_LIB_DEPS = $(LDFLAGS) $(EXTRA_LIB_PATH) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lm
+APP_LIB_DEPS = $(LDFLAGS) $(EXTRA_LIB_PATH) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lm -lXdamage
 
 INSTALL = /usr/ucb/install
 COPY_LIBS = cp -f
--- a/open-src/xserver/Makefile.inc	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/xserver/Makefile.inc	Fri Sep 05 14:48:23 2008 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.6	08/08/15
+# @(#)Makefile.inc	1.7	08/09/05
 #
 
 PWD:sh=pwd
@@ -46,7 +46,7 @@
 XORG_SOURCE_PATCHES:sh=cat -s ../xorg/patch-list ../xorg/closed-src/patch-list | sed '/^\#/ d'
 
 XSERVER_FONTDIR=$(X11_DIR)/lib/X11/fonts
-MESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-6.5.2
+MESA_SRC_DIR=$(TOP)/lib/mesa/$(BUILD_DIR)/Mesa-7.0.3
 
 SERVER_MODULES_DIR='$${libdir}/modules$(SERVERMOD_subdir)'
 DRI_MODULES_DIR='$${libdir}/modules/dri$(SERVERMOD_subdir)'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/6742579.patch	Fri Sep 05 14:48:23 2008 -0700
@@ -0,0 +1,496 @@
+--- GL/symlink-mesa.sh	Mon Jul  7 11:37:13 2008
++++ GL/symlink-mesa.sh	Mon Jul  7 12:56:34 2008
+@@ -85,15 +85,15 @@
+     done
+ }
+ 
+-symlink_mesa_ac() {
+-    src_dir src/mesa/array_cache
+-    dst_dir mesa/array_cache
++#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
++#}
+ 
+-    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
+@@ -121,6 +121,15 @@
+     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_shader() {
+     src_dir src/mesa/shader
+     dst_dir mesa/shader
+@@ -172,6 +181,10 @@
+     action xm_span.c
+     action xm_tri.c
+     action xmesaP.h
++    action xm_image.c
++    action xm_image.h
++    action xm_glide.c
++    action xm_glide.h
+ 
+     # another hack
+     src_dir src/mesa/drivers/common
+@@ -203,10 +216,11 @@
+ symlink_mesa() {
+     symlink_mesa_main
+     symlink_mesa_math
+-    symlink_mesa_ac
++#symlink_mesa_ac
+     symlink_mesa_swrast
+     symlink_mesa_ss
+     symlink_mesa_tnl
++    symlink_mesa_vbo
+     symlink_mesa_shader
+     symlink_mesa_shader_grammar
+     symlink_mesa_shader_slang
+@@ -226,10 +240,10 @@
+ 
+     action indirect_size.h
+ 
+-    src_dir src/mesa/drivers/dri/common
++    src_dir src/glx/x11
+ 
+-    action glcontextmodes.c
+-    action glcontextmodes.h
++    action glcontextmodes.c
++    action glcontextmodes.h
+ 
+     src_dir src/mesa/glapi
+ 
+
+--- GL/mesa/X/Makefile.am	Mon Jul  7 13:14:00 2008
++++ GL/mesa/X/Makefile.am	Mon Jul  7 13:18:30 2008
+@@ -2,7 +2,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -10,6 +9,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I../../glx \
+            -I$(top_srcdir)/GL/glx \
+@@ -36,4 +36,6 @@
+                   xm_line.c \
+                   xm_span.c \
+                   xm_tri.c \
++                  xm_image.c \
++                  xm_glide.c \
+ 		  drivers/common/driverfuncs.c
+
+
+--- GL/mesa/Makefile.am	Mon Jul  7 13:10:15 2008
++++ GL/mesa/Makefile.am	Mon Jul  7 13:13:10 2008
+@@ -1,4 +1,4 @@
+-SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi
++SUBDIRS = main math swrast swrast_setup tnl vbo shader X glapi
+ 
+ noinst_LTLIBRARIES = libGLcore.la
+ 
+@@ -5,10 +5,10 @@
+ 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 \
++                      vbo/libvbo.la \
+                       shader/libshader.la \
+ 		      shader/grammar/libgrammar.la \
+ 		      shader/slang/libslang.la \
+
+
+--- GL/mesa/glapi/Makefile.am	Mon Jul  7 13:18:29 2008
++++ GL/mesa/glapi/Makefile.am	Mon Jul  7 13:21:01 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -15,6 +14,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+
+
+--- GL/mesa/math/Makefile.am	Mon Jul  7 13:21:51 2008
++++ GL/mesa/math/Makefile.am	Mon Jul  7 13:24:36 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -15,6 +14,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+
+--- GL/mesa/shader/Makefile.am	Mon Jul  7 13:23:13 2008
++++ GL/mesa/shader/Makefile.am	Mon Jul  7 13:28:35 2008
+@@ -9,7 +9,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -19,6 +18,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+@@ -28,8 +28,13 @@
+                       atifragshader.c \
+                       nvfragparse.c \
+                       nvprogram.c \
+-                      nvvertexec.c \
+ 		      nvvertparse.c \
+                       program.c \
+-                      shaderobjects.c \
+-		      shaderobjects_3dlabs.c
++                      prog_debug.c \
++                      prog_execute.c \
++                      prog_instruction.c \
++                      prog_parameter.c \
++                      prog_print.c \
++                      prog_statevars.c \
++                      programopt.c \
++		      shader_api.c
+
+
+--- GL/mesa/tnl/Makefile.am	Mon Jul  7 13:28:59 2008
++++ GL/mesa/tnl/Makefile.am	Mon Jul  7 13:34:02 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -16,19 +15,13 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -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_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_draw.c \
+                       t_vb_cull.c \
+                       t_vb_fog.c \
+                       t_vb_light.c \
+@@ -42,9 +35,4 @@
+                       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
+
+
+--- GL/mesa/shader/slang/Makefile.am	Mon Jul  7 13:47:04 2008
++++ GL/mesa/shader/slang/Makefile.am	Mon Jul  7 13:51:53 2008
+@@ -8,7 +8,6 @@
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../grammar \
+            -I../../X \
+-           -I../../array_cache \
+            -I../../glapi \
+            -I../../main \
+            -I../../math \
+@@ -16,26 +15,28 @@
+            -I../../swrast \
+            -I../../swrast_setup \
+            -I../../tnl \
++           -I../../vbo \
+            -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_typeinfo.c \
++		      slang_vartable.c \
+ 		      slang_utility.c
+
+
+--- GL/mesa/shader/grammar/Makefile.am	Mon Jul  7 13:50:10 2008
++++ GL/mesa/shader/grammar/Makefile.am	Mon Jul  7 13:52:39 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../../X \
+-           -I../../array_cache \
+            -I../../glapi \
+            -I../../main \
+            -I../../math \
+@@ -15,6 +14,7 @@
+            -I../../swrast \
+            -I../../swrast_setup \
+            -I../../tnl \
++           -I../../vbo \
+            -I../.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+
+
+--- GL/glx/Makefile.am	Mon Jul  7 13:58:38 2008
++++ GL/glx/Makefile.am	Mon Jul  7 14:02:38 2008
+@@ -28,10 +28,14 @@
+ 	-I$(top_srcdir)/mi
+ 
+ 
++#nodist_libglx_la_SOURCES = indirect_size.h \
++#			   glapi.c \
++#			   glcontextmodes.c \
++#			   glcontextmode.h \
++#			   glthread.c
++
+ nodist_libglx_la_SOURCES = indirect_size.h \
+ 			   glapi.c \
+-			   glcontextmodes.c \
+-			   glcontextmode.h \
+ 			   glthread.c
+ 
+ libglxdri_la_SOURCES = \
+@@ -53,6 +57,9 @@
+         glxserver.h \
+         glxutil.c \
+         glxutil.h \
++        glcontextmodes.c \
++        glcontextmodes.h \
++        glxutil.h \
+         indirect_dispatch.c \
+         indirect_dispatch.h \
+         indirect_dispatch_swap.c \
+
+
+--- configure.ac	Mon Jul  7 17:03:19 2008
++++ configure.ac	Mon Jul  7 17:03:41 2008
+@@ -1723,7 +1723,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
+@@ -1733,6 +1732,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
+
+
+--- GL/mesa/swrast/Makefile.am	Sun Sep 17 23:04:17 2006
++++ GL/mesa/swrast/Makefile.am	Tue Jul  8 10:30:31 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -17,6 +16,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+@@ -24,7 +24,6 @@
+                       s_aatriangle.c \
+                       s_accum.c \
+                       s_alpha.c \
+-                      s_arbshader.c \
+                       s_atifragshader.c \
+                       s_bitmap.c \
+                       s_blend.c \
+@@ -40,10 +39,10 @@
+                       s_lines.c \
+                       s_logic.c \
+                       s_masking.c \
+-                      s_nvfragprog.c \
+                       s_points.c \
+                       s_readpix.c \
+                       s_span.c \
++                      s_fragprog.c \
+                       s_stencil.c \
+ 		      s_texcombine.c \
+ 		      s_texfilter.c \
+
+
+--- GL/mesa/X/xf86glx_util.c	Sun Sep 17 23:04:17 2006
++++ GL/mesa/X/xf86glx_util.c	Mon Jul  7 23:16:17 2008
+@@ -47,7 +47,7 @@
+ #endif
+ 
+ #define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
+-
++#if 0
+ XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data)
+ {
+     XMesaImage *image;
+@@ -102,6 +102,7 @@
+     }
+     return 0;
+ }
++#endif
+ 
+ #ifndef XMESA_USE_PUTPIXEL_MACRO
+ void XMesaPutPixel(XMesaImage *image, int x, int y, unsigned long pixel)
+
+--- GL/mesa/main/Makefile.am	Fri Nov 17 09:47:26 2006
++++ GL/mesa/main/Makefile.am	Tue Jul  8 10:32:41 2008
+@@ -7,7 +7,6 @@
+ 
+ INCLUDES = -I@MESA_SOURCE@/include \
+            -I../X \
+-           -I../array_cache \
+            -I../glapi \
+            -I../main \
+            -I../math \
+@@ -15,6 +14,7 @@
+            -I../swrast \
+            -I../swrast_setup \
+            -I../tnl \
++           -I../vbo \
+            -I.. \
+            -I$(top_srcdir)/hw/xfree86/os-support
+ 
+@@ -62,7 +62,7 @@
+                     matrix.c \
+                     mipmap.c \
+                     mm.c \
+-                    occlude.c \
++                    queryobj.c \
+                     pixel.c \
+                     points.c \
+                     polygon.c \
+@@ -69,6 +69,7 @@
+                     rastpos.c \
+                     rbadaptors.c \
+                     renderbuffer.c \
++                    shaders.c \
+                     state.c \
+                     stencil.c \
+                     texcompress.c \
+
+--- GL/mesa/Makefile.in	Thu Apr 19 18:24:24 2007
++++ GL/mesa/Makefile.in	Mon Aug 11 11:32:50 2008
+@@ -55,7 +55,7 @@
+ CONFIG_CLEAN_FILES =
+ LTLIBRARIES = $(noinst_LTLIBRARIES)
+ libGLcore_la_DEPENDENCIES = main/libmain.la math/libmath.la \
+-	array_cache/libac.la swrast/libswrast.la swrast_setup/libss.la \
++	vbo/libvbo.la swrast/libswrast.la swrast_setup/libss.la \
+ 	tnl/libtnl.la shader/libshader.la shader/grammar/libgrammar.la \
+ 	shader/slang/libslang.la X/libX.la
+ am_libGLcore_la_OBJECTS = dummy.lo
+@@ -540,12 +540,12 @@
+ target_alias = @target_alias@
+ xglmoduledir = @xglmoduledir@
+ xpconfigdir = @xpconfigdir@
+-SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi
++SUBDIRS = main math swrast swrast_setup vbo 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 \
++                      vbo/libvbo.la \
+                       swrast/libswrast.la \
+                       swrast_setup/libss.la \
+                       tnl/libtnl.la \
--- a/open-src/xserver/xorg/Makefile	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/xserver/xorg/Makefile	Fri Sep 05 14:48:23 2008 -0700
@@ -30,7 +30,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.64	08/08/08
+# @(#)Makefile	1.65	08/09/05
 #
 
 # Build 32-bit or 64-bit?
@@ -101,6 +101,8 @@
 source_gen:: $(LNDIR)
 	-$(RM) -f $(SOURCE_DIR)/hw/xfree86/scanpci/pci.ids \
 		$(SOURCE_DIR)/hw/xfree86/scanpci/xf86PciIds.h
+	(mkdir -p $(SOURCE_DIR)/GL/mesa/vbo)
+	(cp ./sun-src/mesa/Makefile.am $(SOURCE_DIR)/GL/mesa/vbo)
 	(cd $(SOURCE_DIR) && $(LNDIR) ../../sun-src)
 
 # Force broken xf1bpp sources in 1.3 to be regenerated
--- a/open-src/xserver/xorg/patch-list	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/xserver/xorg/patch-list	Fri Sep 05 14:48:23 2008 -0700
@@ -65,3 +65,4 @@
 6685465.patch
 kbd_mode.patch,-p1
 6721634.patch
+6742579.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/sun-src/mesa/Makefile.am	Fri Sep 05 14:48:23 2008 -0700
@@ -0,0 +1,34 @@
+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../swrast \
+           -I../swrast_setup \
+           -I../tnl \
+           -I../vbo \
+           -I.. \
+           -I$(top_srcdir)/hw/xfree86/os-support
+
+nodist_libvbo_la_SOURCES = vbo_context.c \
+                       vbo_exec.c \
+                       vbo_exec_api.c \
+                       vbo_exec_array.c \
+                       vbo_exec_draw.c \
+                       vbo_exec_eval.c \
+                       vbo_rebase.c \
+                       vbo_save.c \
+                       vbo_save_api.c \
+                       vbo_save_draw.c \
+                       vbo_save_loopback.c \
+                       vbo_split.c \
+                       vbo_split_copy.c \
+                       vbo_split_inplace.c
--- a/open-src/xserver/xvnc/Makefile	Fri Sep 05 06:33:56 2008 -0700
+++ b/open-src/xserver/xvnc/Makefile	Fri Sep 05 14:48:23 2008 -0700
@@ -31,7 +31,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.12	08/08/28
+# @(#)Makefile	1.13 08/09/05
 #
 
 # Package name used in tarballs
@@ -118,6 +118,8 @@
 	fi
 	mv $(XORG_SOURCE_DIR) $(XORG_BUILD_DIR)
 	(cd $(XORG_BUILD_DIR) && $(LNDIR) ../../../../../xorg/sun-src)
+	(mkdir -p $(XORG_BUILD_DIR)/GL/mesa/vbo)
+	(cp ../xorg/sun-src/mesa/Makefile.am $(XORG_BUILD_DIR)/GL/mesa/vbo)
 
 
 include ../Makefile.inc