xserver/hw/xgl Makefile.am, 1.6, 1.7 xgl.h, 1.13, 1.14 xglcopy.c, 1.6, 1.7 xglget.c, 1.3, 1.4 xglglx.c, 1.6, 1.7 xglglyph.c, 1.5, 1.6 xglinput.c, 1.4, 1.5 xglpixmap.c, 1.10, 1.11 xglscreen.c, 1.8, 1.9 xglsync.c, 1.7, 1.8 xgltrap.c, 1.5, 1.6

David Reveman <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Tue, 7 Jun 2005 01:53:43 -0700 (PDT)
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: davidr

Update of /cvs/xserver/xserver/hw/xgl
In directory gabe:/tmp/cvs-serv19611/hw/xgl

Modified Files:
	Makefile.am xgl.h xglcopy.c xglget.c xglglx.c xglglyph.c 
	xglinput.c xglpixmap.c xglscreen.c xglsync.c xgltrap.c 
Log Message:
GLX improvements and remove use of pbuffers for offscreen rendering in Xgl

Index: Makefile.am
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Makefile.am	5 Jun 2005 01:58:41 -0000	1.6
+++ Makefile.am	7 Jun 2005 08:53:40 -0000	1.7
@@ -14,7 +14,6 @@
 	xglparse.c     \
 	xglscreen.c    \
 	xglarea.c      \
-	xgloffscreen.c \
 	xglgeometry.c  \
 	xglpixmap.c    \
 	xglsync.c      \

Index: xgl.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xgl.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- xgl.h	27 Apr 2005 09:29:33 -0000	1.13
+++ xgl.h	7 Jun 2005 08:53:40 -0000	1.14
@@ -89,9 +89,6 @@
 extern xglVisualPtr xglVisuals;
 extern int	    nxglVisuals;
 
-extern xglVisualPtr xglPbufferVisuals;
-extern int	    nxglPbufferVisuals;
-
 #define xglAreaAvailable 0
 #define xglAreaDivided   1
 #define xglAreaOccupied  2
@@ -201,25 +198,15 @@
 
 #endif
 
-#define XGL_MAX_OFFSCREEN_AREAS 8
-
-typedef struct _xglOffscreen {
-    xglRootAreaRec	    rootArea;
-    glitz_drawable_t	    *drawable;
-    glitz_drawable_format_t *format;
-    glitz_drawable_buffer_t buffer;
-} xglOffscreenRec, *xglOffscreenPtr;
-
 typedef struct _xglScreen {
     xglVisualPtr		  pVisual;
     xglPixmapFormatRec		  pixmapFormats[33];
     glitz_drawable_t		  *drawable;
     glitz_surface_t		  *surface;
+    glitz_surface_t		  *backSurface;
     glitz_surface_t		  *solid;
     PixmapPtr			  pScreenPixmap;
     unsigned long		  features;
-    xglOffscreenRec		  pOffscreen[XGL_MAX_OFFSCREEN_AREAS];
-    int				  nOffscreen;
     int				  geometryUsage;
     int				  geometryDataType;
     Bool			  yInverted;
@@ -264,7 +251,11 @@
 #endif
 
     BSFuncRec			  BackingStoreFuncs;
-    
+
+#ifdef GLXEXT
+    DestroyWindowProcPtr	  DestroyWindow;
+#endif
+
 } xglScreenRec, *xglScreenPtr;
 
 extern int xglScreenPrivateIndex;
@@ -342,8 +333,6 @@
     glitz_surface_t   *surface;
     glitz_buffer_t    *buffer;
     int		      target;
-    xglAreaPtr	      pArea;
-    int		      score;
     Bool	      acceleratedTile;
     pointer	      bits;
     int		      stride;
@@ -437,23 +426,6 @@
     (((pBox)->x2 - (pBox)->x1) > 0 && \
      ((pBox)->y2 - (pBox)->y1) > 0)
 
-#define XGL_MAX_PIXMAP_SCORE  32768
-#define XGL_MIN_PIXMAP_SCORE -32768
-
-#define XGL_INCREMENT_PIXMAP_SCORE(pPixmapPriv, incr)	 \
-    {							 \
-	(pPixmapPriv)->score += (incr);			 \
-	if ((pPixmapPriv)->score > XGL_MAX_PIXMAP_SCORE) \
-	    (pPixmapPriv)->score = XGL_MAX_PIXMAP_SCORE; \
-    }
-
-#define XGL_DECREMENT_PIXMAP_SCORE(pPixmapPriv, decr)	 \
-    {							 \
-	(pPixmapPriv)->score -= (decr);			 \
-	if ((pPixmapPriv)->score < XGL_MIN_PIXMAP_SCORE) \
-	    (pPixmapPriv)->score = XGL_MIN_PIXMAP_SCORE; \
-    }
-
 
 /* xglinput.c */
 
@@ -574,23 +546,6 @@
 	     pointer	closure);
 
 
-/* xgloffscreen.c */
-
-Bool
-xglInitOffscreen (ScreenPtr	   pScreen,
-		  xglScreenInfoPtr pScreenInfo);
-
-void
-xglFiniOffscreen (ScreenPtr pScreen);
-
-Bool
-xglFindOffscreenArea (ScreenPtr pScreen,
-		      PixmapPtr	pPixmap);
-
-void
-xglLeaveOffscreenArea (PixmapPtr pPixmap);
-
-
 /* xglgeometry.c */
 
 #define GEOMETRY_DATA_TYPE_SHORT 0

Index: xglcopy.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglcopy.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xglcopy.c	16 Mar 2005 20:05:19 -0000	1.6
+++ xglcopy.c	7 Jun 2005 08:53:40 -0000	1.7
@@ -38,9 +38,6 @@
     int		    srcXoff, srcYoff;
     int		    dstXoff, dstYoff;
 
-    XGL_SCREEN_PRIV (pDst->pScreen);
-    XGL_DRAWABLE_PIXMAP_PRIV (pSrc);
-    
     if (!nBox)
 	return TRUE;
 
@@ -53,10 +50,6 @@
     XGL_GET_DRAWABLE (pSrc, src, srcXoff, srcYoff);
     XGL_GET_DRAWABLE (pDst, dst, dstXoff, dstYoff);
 
-    /* blit to screen */
-    if (dst == pScreenPriv->surface)
-	XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000);
-    
     glitz_surface_set_clip_region (dst,
 				   dstXoff, dstYoff,
 				   (glitz_box_t *) pBox, nBox);

Index: xglget.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglget.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xglget.c	26 Jan 2005 10:58:52 -0000	1.3
+++ xglget.c	7 Jun 2005 08:53:40 -0000	1.4
@@ -45,6 +45,9 @@
     /* Many apps use GetImage to sync with the visable frame buffer */
     if (pDrawable->type == DRAWABLE_WINDOW)
     {
+	if (!xglSyncSurface (&pScreenPriv->pScreenPixmap->drawable))
+	    FatalError (XGL_SW_FAILURE_STRING);
+
 	glitz_surface_flush (pScreenPriv->surface);
 	glitz_drawable_finish (pScreenPriv->drawable);
     }

Index: xglglx.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglglx.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xglglx.c	2 May 2005 00:33:52 -0000	1.6
+++ xglglx.c	7 Jun 2005 08:53:40 -0000	1.7
@@ -32,8 +32,19 @@
 #include "glxserver.h"
 #include "glxdrawable.h"
 #include "glxscreens.h"
+#include "glxutil.h"
+#include "unpack.h"
+#include "g_disptab.h"
 #include "micmap.h"
 
+#define XGL_MAX_TEXTURE_UNITS 8
+
+#define XGL_TEXTURE_1D_BIT	  (1 << 0)
[...4063 lines suppressed...]
 	if (depth == 16)
@@ -3531,6 +4821,9 @@
     {
 	screenInfoPriv.screenProbe    = __glDDXScreenInfo.screenProbe;
 	__glDDXScreenInfo.screenProbe = xglScreenProbe;
+
+	__glXSingleTable[9]     = xglXWaitX;
+	__glXSwapSingleTable[9] = xglXSwapWaitX;
     }
 
     visuals    = pScreen->visuals;
@@ -3571,8 +4864,6 @@
     xfree (installedCmaps);
     xfree (pConfigPriv);
     xfree (pConfig);
-
-    ErrorF ("[glx] initialized\n");
     
     return TRUE;
 }

Index: xglglyph.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglglyph.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xglglyph.c	1 May 2005 22:55:25 -0000	1.5
+++ xglglyph.c	7 Jun 2005 08:53:40 -0000	1.6
@@ -1145,8 +1145,6 @@
     
     if (pMask)
     {
-	xglLeaveOffscreenArea ((PixmapPtr) pMask->pDrawable);
-	
 	CompositePicture (op,
 			  pSrc,
 			  pMask,

Index: xglinput.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglinput.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xglinput.c	26 Jan 2005 10:58:52 -0000	1.4
+++ xglinput.c	7 Jun 2005 08:53:40 -0000	1.5
@@ -33,7 +33,7 @@
 #include <X11/XF86keysym.h>
 #endif
 
-#define NUM_BUTTONS 5
+#define NUM_BUTTONS 7
 
 int
 xglMouseProc (DeviceIntPtr pDevice,

Index: xglpixmap.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglpixmap.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- xglpixmap.c	13 Apr 2005 14:27:47 -0000	1.10
+++ xglpixmap.c	7 Jun 2005 08:53:40 -0000	1.11
@@ -101,8 +101,6 @@
     XGL_PIXMAP_PRIV (pPixmap);
     
     pPixmapPriv->surface = NULL;
-    pPixmapPriv->pArea = NULL;
-    pPixmapPriv->score = 0;
     pPixmapPriv->acceleratedTile = FALSE;
     pPixmapPriv->pictureMask = ~0;
     pPixmapPriv->target = xglPixmapTargetNo;
@@ -211,9 +209,6 @@
 {
     XGL_PIXMAP_PRIV (pPixmap);
     
-    if (pPixmapPriv->pArea)
-	xglWithdrawArea (pPixmapPriv->pArea);
-	
     if (pPixmap->devPrivate.ptr)
     {
 	if (pPixmapPriv->buffer)
@@ -316,9 +311,6 @@
 	pPixmap->drawable.width != oldWidth ||
 	pPixmap->drawable.height != oldHeight)
     {
-	if (pPixmapPriv->pArea)
-	    xglWithdrawArea (pPixmapPriv->pArea);
-	
 	if (pPixmapPriv->surface)
 	    glitz_surface_destroy (pPixmapPriv->surface);
 
@@ -372,11 +364,6 @@
 	    REGION_INIT (pPixmap->drawable.pScreen, pRegion,
 			 &pPixmapPriv->bitBox, 1);
 	}
-
-	/*
-	 * We probably don't want accelerated drawing to this pixmap.
-	 */
-	pPixmapPriv->score = XGL_MIN_PIXMAP_SCORE;
     }
 
     /*

Index: xglscreen.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglscreen.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- xglscreen.c	27 Apr 2005 09:29:33 -0000	1.8
+++ xglscreen.c	7 Jun 2005 08:53:40 -0000	1.9
@@ -159,9 +159,6 @@
     depth = pScreenPriv->pVisual->pPixel->depth;
     bpp   = pScreenPriv->pVisual->pPixel->masks.bpp;
 
-    if (!xglInitOffscreen (pScreen, pScreenInfo))
-	return FALSE;
-    
     xglInitPixmapFormats (pScreen);
     if (!pScreenPriv->pixmapFormats[depth].format)
 	return FALSE;
@@ -189,6 +186,8 @@
 			  GLITZ_DRAWABLE_BUFFER_FRONT_COLOR,
 			  0, 0);
 
+    pScreenPriv->backSurface = NULL;
+    
     if (monitorResolution == 0)
 	monitorResolution = XGL_DEFAULT_DPI;
 
@@ -365,7 +364,7 @@
 {
     XGL_SCREEN_PRIV (pScreen);
     XGL_PIXMAP_PRIV (pScreenPriv->pScreenPixmap);
-    
+
 #ifdef RENDER
     int i;
     
@@ -386,11 +385,12 @@
     if (pScreenPriv->solid)
 	glitz_surface_destroy (pScreenPriv->solid);
 
+    if (pScreenPriv->backSurface)
+	glitz_surface_destroy (pScreenPriv->backSurface);
+
     if (pScreenPriv->surface)
 	glitz_surface_destroy (pScreenPriv->surface);
 
-    xglFiniOffscreen (pScreen);
-
     GEOMETRY_UNINIT (&pScreenPriv->scratchGeometry);
 
     XGL_SCREEN_UNWRAP (CloseScreen);

Index: xglsync.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xglsync.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xglsync.c	13 Apr 2005 14:27:47 -0000	1.7
+++ xglsync.c	7 Jun 2005 08:53:40 -0000	1.8
@@ -73,8 +73,6 @@
     XGL_DRAWABLE_PIXMAP (pDrawable);
     XGL_PIXMAP_PRIV (pPixmap);
 
-    XGL_DECREMENT_PIXMAP_SCORE (pPixmapPriv, 20);
-    
     if (pPixmapPriv->allBits)
 	return xglMapPixmapBits (pPixmap);
 
@@ -295,22 +293,12 @@
 
     switch (pPixmapPriv->target) {
     case xglPixmapTargetNo:
+    case xglPixmapTargetOut:
 	break;
     case xglPixmapTargetIn:
-	XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 10);
-	
 	if (xglSyncSurface (pDrawable))
 	    return TRUE;
 	break;
-    case xglPixmapTargetOut:
-	XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 10);
-
-	if (pPixmapPriv->lock)
-	    return FALSE;
-	
-	if (xglFindOffscreenArea (pDrawable->pScreen, pPixmap))
-	    return TRUE;
-	break;
     }
     
     return FALSE;

Index: xgltrap.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/xgl/xgltrap.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xgltrap.c	13 Apr 2005 14:27:47 -0000	1.5
+++ xgltrap.c	7 Jun 2005 08:53:40 -0000	1.6
@@ -375,8 +375,6 @@
     
     if (pMask)
     {
-	xglLeaveOffscreenArea ((PixmapPtr) pMask->pDrawable);
-	
 	CompositePicture (op, pSrc, pMask, pDst,
 			  extents.x1 + xSrc - xDst,
 			  extents.y1 + ySrc - yDst,