xserver: Branch 'glucose-2'

Alan Hourihane alanh at kemper.freedesktop.org
Fri Oct 19 03:46:13 PDT 2007


 glucose/glucose.c         |   39 +++++++++++++++++++++++++++++----------
 glucose/glucose_context.c |    2 +-
 glucose/glucose_format.c  |    2 +-
 hw/xgl/xglglx.c           |    4 ++--
 xgl/xgl.h                 |    5 +++++
 xgl/xglcompose.c          |    4 ++--
 xgl/xglcopy.c             |    4 ++--
 xgl/xglget.c              |    4 ++--
 xgl/xglpixmap.c           |    8 ++++----
 xgl/xglsolid.c            |    4 ++--
 xgl/xglsync.c             |    8 ++++----
 xgl/xgltile.c             |    8 ++++----
 12 files changed, 58 insertions(+), 34 deletions(-)

New commits:
commit b45d236590764837643e2e9d4e941de7d0ffeb88
Author: Alan Hourihane <alanh at tungstengraphics.com>
Date:   Fri Oct 19 11:46:01 2007 +0100

    Fix recent merge problems and add enter/leave wrapper
    from Jose's code.

diff --git a/glucose/glucose.c b/glucose/glucose.c
index f805275..6d6004b 100644
--- a/glucose/glucose.c
+++ b/glucose/glucose.c
@@ -130,12 +130,10 @@ glucoseCreateWindow(WindowPtr pWin)
   {
     glitz_drawable_t	    *drawable;
     glitz_drawable_format_t *format;
-    __GLcontextModes *modes = pScreenPriv->screen->modes;
+    __GLcontextModes *fbconfigs = pScreenPriv->screen->fbconfigs;
     PixmapPtr pPixmap = pScreen->GetScreenPixmap(pScreen);
     xglScreenPtr xglScreenPriv = XGL_GET_SCREEN_PRIV (pScreen);
 
-    __pGlxClient = serverClient;
-    
     /* track root pixmap */
     if (pPixmap)
     {
@@ -144,17 +142,21 @@ glucoseCreateWindow(WindowPtr pWin)
 	AddResource(pPixmap->drawable.id, RT_PIXMAP, (pointer)pPixmap);
     }
 
-    pScreenPriv->rootDrawable = pScreenPriv->screen->createDrawable(pScreenPriv->screen, (DrawablePtr)pPixmap, GLX_DRAWABLE_PIXMAP, pPixmap->drawable.id, modes);
+    xglLeaveServer();
+    
+    pScreenPriv->rootDrawable = pScreenPriv->screen->createDrawable(pScreenPriv->screen, (DrawablePtr)pPixmap, GLX_DRAWABLE_PIXMAP, pPixmap->drawable.id, fbconfigs);
 
     if (!pScreenPriv->rootDrawable) {
+    	xglEnterServer();
   	xf86DrvMsg(pScreen->myNum, X_WARNING,
 		  "GLucose - creating root drawable failed\n");
     	return FALSE;
     }
 
-    pScreenPriv->rootContext = pScreenPriv->screen->createContext(pScreenPriv->screen, modes, NULL);
+    pScreenPriv->rootContext = pScreenPriv->screen->createContext(pScreenPriv->screen, fbconfigs, NULL);
 
     if (!pScreenPriv->rootContext) {
+    	xglEnterServer();
   	xf86DrvMsg(pScreen->myNum, X_WARNING,
 		  "GLucose - creating root context failed\n");
 	pScreenPriv->rootDrawable->destroy(pScreenPriv->rootDrawable);
@@ -165,10 +167,9 @@ glucoseCreateWindow(WindowPtr pWin)
     pScreenPriv->rootContext->drawPriv =
     	pScreenPriv->rootContext->readPriv = pScreenPriv->rootDrawable;
 
-    __glXleaveServer(FALSE);
     err = pScreenPriv->rootContext->makeCurrent(pScreenPriv->rootContext);
     if (!err) {
-    	__glXenterServer(FALSE);
+    	xglEnterServer();
   	xf86DrvMsg(pScreen->myNum, X_WARNING, 
 		  "GLucose makeCurrent failed, err is %d\n",err);
 	pScreenPriv->rootContext->destroy(pScreenPriv->rootContext);
@@ -186,7 +187,7 @@ glucoseCreateWindow(WindowPtr pWin)
                                                     pScreen->height);
 
     if (!drawable) {
-    	__glXenterServer(FALSE);
+    	xglEnterServer();
         xf86DrvMsg(pScreen->myNum, X_ERROR,
 		  "GLucose could not create glitz drawable, not initializing.\n");
 
@@ -205,7 +206,7 @@ glucoseCreateWindow(WindowPtr pWin)
 		  "GLucose reports GLitz features as 0x%lx\n",xglScreenPriv->features);
 
     if (!glucoseFinishScreenInit(pScreen)) {
-    	__glXenterServer(FALSE);
+    	xglEnterServer();
         xf86DrvMsg(pScreen->myNum, X_ERROR,
 		  "GLucose could not initialize.\n");
 	pScreenPriv->rootContext->destroy(pScreenPriv->rootContext);
@@ -215,7 +216,7 @@ glucoseCreateWindow(WindowPtr pWin)
 	return FALSE;
     }
 
-    __glXenterServer(FALSE);
+    xglEnterServer();
 
     /* now fixup root pixmap */
     pPixmap = pScreen->GetScreenPixmap(pScreen);
@@ -733,6 +734,8 @@ glucoseCloseScreen (int	  index,
 
     xglFiniPixmap (pScreenPriv->pScreenPixmap);
 
+    xglLeaveServer();
+    
 #ifdef RENDER
     int i;
 
@@ -781,3 +784,19 @@ glucoseCloseScreen (int	  index,
 
     return (*pScreen->CloseScreen) (index, pScreen);
 }
+ 
+static ClientPtr pOldGlxClient = NULL;
+
+void xglLeaveServer(void) {
+    assert(pOldGlxClient == NULL);
+    __glXleaveServer(TRUE);
+    pOldGlxClient = __pGlxClient;
+    __pGlxClient = serverClient;
+}
+
+void xglEnterServer(void) {
+    assert(__pGlxClient == serverClient);
+    __pGlxClient = pOldGlxClient;
+    pOldGlxClient = NULL;
+    __glXenterServer(TRUE);
+}
diff --git a/glucose/glucose_context.c b/glucose/glucose_context.c
index 1f6c452..dbb8a33 100644
--- a/glucose/glucose_context.c
+++ b/glucose/glucose_context.c
@@ -54,7 +54,7 @@ _glitz_glucose_context_create (glitz_glucose_screen_info_t *screen_info,
     __GLXscreen *screen = screen_info->display_info->display;
     __GLcontextModes *mode;
 
-    mode = _gl_context_modes_find_visual(screen->modes, visualid);
+    mode = _gl_context_modes_find_visual(screen->fbconfigs, visualid);
 
     context->context = screen->createContext (screen, mode, share_list);
     context->id = visualid;
diff --git a/glucose/glucose_format.c b/glucose/glucose_format.c
index fdfde0a..fb94a63 100644
--- a/glucose/glucose_format.c
+++ b/glucose/glucose_format.c
@@ -140,7 +140,7 @@ _glitz_glucose_query_formats (glitz_glucose_screen_info_t *screen_info)
     format.d.id           = 0;
     format.d.color.fourcc = GLITZ_FOURCC_RGB;
 
-    mode = screen->modes;
+    mode = screen->fbconfigs;
 
     for (i = 0; i < screen->numVisuals; i++)
     {
diff --git a/hw/xgl/xglglx.c b/hw/xgl/xglglx.c
index 9fae97f..8a9430f 100644
--- a/hw/xgl/xglglx.c
+++ b/hw/xgl/xglglx.c
@@ -204,12 +204,12 @@ xglUnloadGLXModules (void)
 }
 
 void
-__glXenterServer(GLboolean rendering)
+xglEnterServer(void)
 {
 }
 
 void
-__glXleaveServer(GLboolean rendering)
+xglLeaveServer(void)
 {
 }
 
diff --git a/xgl/xgl.h b/xgl/xgl.h
index d79d0c0..b31509d 100644
--- a/xgl/xgl.h
+++ b/xgl/xgl.h
@@ -1506,4 +1506,9 @@ unsigned int
 xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
 			 unsigned int	 numKeys);
 
+
+void xglLeaveServer(void);
+
+void xglEnterServer(void);
+
 #endif /* _XGL_H_ */
diff --git a/xgl/xglcompose.c b/xgl/xglcompose.c
index 5f27f54..0099d0a 100644
--- a/xgl/xglcompose.c
+++ b/xgl/xglcompose.c
@@ -262,14 +262,14 @@ xglCompositeGeneral (CARD8	     op,
     else
 	GEOMETRY_DISABLE (dst);
 
-    __glXleaveServer(FALSE);
+    xglLeaveServer();
     glitz_composite (XGL_OPERATOR (op),
 		     src, mask, dst,
 		     xSrc, ySrc,
 		     xMask, yMask,
 		     xDst + dstXoff, yDst + dstYoff,
 		     width, height);
-    __glXenterServer(FALSE);
+    xglEnterServer();
 
     glitz_surface_set_clip_region (dst, 0, 0, NULL, 0);
 
diff --git a/xgl/xglcopy.c b/xgl/xglcopy.c
index c5c479c..a640163 100644
--- a/xgl/xglcopy.c
+++ b/xgl/xglcopy.c
@@ -64,7 +64,7 @@ xglCopy (DrawablePtr pSrc,
 				   dstXoff, dstYoff,
 				   (glitz_box_t *) pBox, nBox);
 
-    __glXleaveServer(FALSE);
+    xglLeaveServer();
     glitz_copy_area (src,
 		     dst,
 		     srcXoff + dx,
@@ -73,7 +73,7 @@ xglCopy (DrawablePtr pSrc,
 		     pPixmap->drawable.height - dstYoff,
 		     dstXoff,
 		     dstYoff);
-    __glXenterServer(FALSE);
+    xglEnterServer();
 
     glitz_surface_set_clip_region (dst, 0, 0, NULL, 0);
 
diff --git a/xgl/xglget.c b/xgl/xglget.c
index 5804012..893ab2c 100644
--- a/xgl/xglget.c
+++ b/xgl/xglget.c
@@ -48,10 +48,10 @@ xglGetImage (DrawablePtr   pDrawable,
 	if (!xglSyncSurface (&pScreenPriv->pScreenPixmap->drawable))
 	    FatalError (XGL_SW_FAILURE_STRING);
 
-	__glXleaveServer(FALSE);
+	xglLeaveServer();
 	glitz_surface_flush (pScreenPriv->surface);
 	glitz_drawable_finish (pScreenPriv->drawable);
-	__glXenterServer(FALSE);
+	xglEnterServer();
     }
 
     XGL_GET_DRAWABLE (pDrawable, surface, xOff, yOff);
diff --git a/xgl/xglpixmap.c b/xgl/xglpixmap.c
index 56c7ecd..872d415 100644
--- a/xgl/xglpixmap.c
+++ b/xgl/xglpixmap.c
@@ -300,9 +300,9 @@ xglFiniPixmap (PixmapPtr pPixmap)
 
     if (pPixmapPriv->surface) {
     	/* leaving because texture destruction can occur and flush primitives */
-        __glXleaveServer(FALSE);
+        xglLeaveServer();
 	glitz_surface_destroy (pPixmapPriv->surface);
-        __glXenterServer(FALSE);
+        xglEnterServer();
     }
 }
 
@@ -568,14 +568,14 @@ xglCreatePixmapSurface (PixmapPtr pPixmap)
 	if (!pPixmapPriv->pVisual || !pPixmapPriv->pVisual->format.surface)
 	    return FALSE;
 
-	__glXleaveServer(FALSE);
+	xglLeaveServer();
 	pPixmapPriv->surface =
 	    glitz_surface_create (pScreenPriv->drawable,
 				  pPixmapPriv->pVisual->format.surface,
 				  pPixmap->drawable.width,
 				  pPixmap->drawable.height,
 				  0, NULL);
-	__glXenterServer(FALSE);
+	xglEnterServer();
 	if (!pPixmapPriv->surface)
 	{
 	    pPixmapPriv->pVisual = NULL;
diff --git a/xgl/xglsolid.c b/xgl/xglsolid.c
index 3a820ad..97ef7d1 100644
--- a/xgl/xglsolid.c
+++ b/xgl/xglsolid.c
@@ -67,7 +67,7 @@ xglSolid (DrawablePtr	   pDrawable,
     if (!GEOMETRY_ENABLE (pGeometry, surface))
 	return FALSE;
 
-    __glXleaveServer(FALSE);
+    xglLeaveServer();
     glitz_composite (op,
 		     solid, NULL, surface,
 		     0, 0,
@@ -75,7 +75,7 @@ xglSolid (DrawablePtr	   pDrawable,
 		     x + xOff,
 		     y + yOff,
 		     width, height);
-    __glXenterServer(FALSE);
+    xglEnterServer();
 
     glitz_surface_set_clip_region (surface, 0, 0, NULL, 0);
 
diff --git a/xgl/xglsync.c b/xgl/xglsync.c
index ad7f66d..b951be4 100644
--- a/xgl/xglsync.c
+++ b/xgl/xglsync.c
@@ -154,7 +154,7 @@ xglSyncBits (DrawablePtr pDrawable,
 	glitz_surface_set_clip_region (pPixmapPriv->surface,
 				       0, 0, (glitz_box_t *) pBox, nBox);
 
-	__glXleaveServer(FALSE);
+	xglLeaveServer();
 	glitz_get_pixels (pPixmapPriv->surface,
 			  pExt->x1,
 			  pExt->y1,
@@ -162,7 +162,7 @@ xglSyncBits (DrawablePtr pDrawable,
 			  pExt->y2 - pExt->y1,
 			  &format,
 			  pPixmapPriv->buffer);
-	__glXenterServer(FALSE);
+	xglEnterServer();
 
 	glitz_surface_set_clip_region (pPixmapPriv->surface, 0, 0, NULL, 0);
     }
@@ -277,7 +277,7 @@ xglSyncSurface (DrawablePtr pDrawable)
 	glitz_surface_set_clip_region (pPixmapPriv->surface,
 				       0, 0, (glitz_box_t *) pBox, nBox);
 
-	__glXleaveServer(FALSE);
+	xglLeaveServer();
 	glitz_set_pixels (pPixmapPriv->surface,
 			  pExt->x1,
 			  pExt->y1,
@@ -285,7 +285,7 @@ xglSyncSurface (DrawablePtr pDrawable)
 			  pExt->y2 - pExt->y1,
 			  &format,
 			  pPixmapPriv->buffer);
-	__glXenterServer(FALSE);
+	xglEnterServer();
 
 	glitz_surface_set_clip_region (pPixmapPriv->surface, 0, 0, NULL, 0);
 
diff --git a/xgl/xgltile.c b/xgl/xgltile.c
index dc7c301..5c5fad1 100644
--- a/xgl/xgltile.c
+++ b/xgl/xgltile.c
@@ -222,7 +222,7 @@ xglTile (DrawablePtr	  pDrawable,
 	pTilePriv->pictureMask |= xglPCFillMask;
 	glitz_surface_set_fill (pTilePriv->surface, GLITZ_FILL_REPEAT);
 
-	__glXleaveServer(FALSE);
+	xglLeaveServer();
 	glitz_composite (op,
 			 pTilePriv->surface, NULL, surface,
 			 x + tileX,
@@ -231,7 +231,7 @@ xglTile (DrawablePtr	  pDrawable,
 			 x + xOff,
 			 y + yOff,
 			 width, height);
-	__glXenterServer(FALSE);
+	xglEnterServer();
 
 	glitz_surface_set_clip_region (surface, 0, 0, NULL, 0);
 
@@ -256,7 +256,7 @@ xglTile (DrawablePtr	  pDrawable,
     if (!GEOMETRY_ENABLE (pGeometry, surface))
 	return FALSE;
 
-    __glXleaveServer(FALSE);
+    xglLeaveServer();
     glitz_composite (op,
 		     pTilePriv->surface, NULL, surface,
 		     0, 0,
@@ -264,7 +264,7 @@ xglTile (DrawablePtr	  pDrawable,
 		     x + xOff,
 		     y + yOff,
 		     width, height);
-    __glXenterServer(FALSE);
+    xglEnterServer();
 
     if (glitz_surface_get_status (surface))
 	return FALSE;


More information about the xorg-commit mailing list