xserver: Branch 'xgl-0-0-1' - 3 commits

David Reveman davidr at kemper.freedesktop.org
Fri Jan 25 14:12:35 PST 2008


 hw/xgl/glx/xglx.c         |   22 +++++++++++++---------
 hw/xgl/glxext/xglglxext.c |   28 ++++++++++++++++++++--------
 2 files changed, 33 insertions(+), 17 deletions(-)

New commits:
commit 5934d2734d94ce92d08a0a81078d75aabf5ebb1e
Author: David Reveman <davidr at novell.com>
Date:   Fri Jan 25 16:17:04 2008 -0500

    Handle root window size changes properly by checking if size of
    drawable changed instead of if the pixmap changed.

diff --git a/hw/xgl/glxext/xglglxext.c b/hw/xgl/glxext/xglglxext.c
index c2fcdd9..0f1f11c 100644
--- a/hw/xgl/glxext/xglglxext.c
+++ b/hw/xgl/glxext/xglglxext.c
@@ -69,12 +69,12 @@ typedef struct _xglGLBuffer {
     xglVisualPtr     pVisual;
     glitz_drawable_t *drawable;
     glitz_surface_t  *backSurface;
-    PixmapPtr	     pPixmap;
     GCPtr	     pGC;
     RegionRec	     damage;
     int		     screenX, screenY;
     int		     xOff, yOff;
     int		     yFlip;
+    int		     width, height;
 } xglGLBufferRec, *xglGLBufferPtr;
 
 typedef int xglGLXVisualConfigRec, *xglGLXVisualConfigPtr;
@@ -5562,7 +5562,6 @@ xglCreateDrawable (__GLXcontext *context,
 
     pBufferPriv->pScreen   = pScreen;
     pBufferPriv->pDrawable = NULL;
-    pBufferPriv->pPixmap   = NULL;
     pBufferPriv->pGC	   = NULL;
 
     pBufferPriv->base.destroy       = xglDestroyDrawable;
@@ -5573,6 +5572,9 @@ xglCreateDrawable (__GLXcontext *context,
     pBufferPriv->drawable    = NULL;
     pBufferPriv->backSurface = NULL;
 
+    pBufferPriv->width  = -1;
+    pBufferPriv->height = -1;
+
     REGION_INIT (pScreen, &pBufferPriv->damage, NullBox, 0);
 
     pBufferPriv->pVisual = 0;
@@ -5903,8 +5905,10 @@ xglMakeCurrent (__GLXcontext *context)
 
 	ValidateGC (pDrawBufferPriv->pDrawable, pDrawBufferPriv->pGC);
 
-	pReadBufferPriv->pPixmap = (PixmapPtr) 0;
-	pDrawBufferPriv->pPixmap = (PixmapPtr) 0;
+	pReadBufferPriv->width  = -1;
+	pReadBufferPriv->height = -1;
+	pDrawBufferPriv->width  = -1;
+	pDrawBufferPriv->height = -1;
 
 	pContext->pReadBuffer = pReadBufferPriv;
 	pContext->pDrawBuffer = pDrawBufferPriv;
@@ -6021,17 +6025,25 @@ xglForceCurrent (__GLXcontext *context)
 	    }
 
 	    /* buffer changed */
-	    if (cctx->pDrawBuffer->pPixmap != pDrawPixmap ||
-		cctx->pReadBuffer->pPixmap != pReadPixmap)
+	    if (cctx->pDrawBuffer->width  != pDrawPixmap->drawable.width ||
+		cctx->pDrawBuffer->height != pDrawPixmap->drawable.height)
 	    {
 		if (!xglResizeBuffer (cctx->pDrawBuffer))
 		    return FALSE;
 
+		cctx->pDrawBuffer->width  = pDrawPixmap->drawable.width;
+		cctx->pDrawBuffer->height = pDrawPixmap->drawable.height;
+	    }
+
+	    /* buffer changed */
+	    if (cctx->pReadBuffer->width  != pReadPixmap->drawable.width ||
+		cctx->pReadBuffer->height != pReadPixmap->drawable.height)
+	    {
 		if (!xglResizeBuffer (cctx->pReadBuffer))
 		    return FALSE;
 
-		cctx->pReadBuffer->pPixmap = pReadPixmap;
-		cctx->pDrawBuffer->pPixmap = pDrawPixmap;
+		cctx->pReadBuffer->width  = pReadPixmap->drawable.width;
+		cctx->pReadBuffer->height = pReadPixmap->drawable.height;
 	    }
 
 	    if (!xglSyncSurface (pContext->pDrawBuffer->pDrawable))
commit 4e65c6ec69af131def0f92bb85eee84aab54aacd
Author: David Reveman <davidr at novell.com>
Date:   Fri Jan 25 14:45:16 2008 -0500

    Check return value of XRRSetCrtcConfig.

diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c
index ca0f7f2..23a49df 100644
--- a/hw/xgl/glx/xglx.c
+++ b/hw/xgl/glx/xglx.c
@@ -624,6 +624,7 @@ xglxRRCrtcSet (ScreenPtr   pScreen,
     XRRScreenResources *r;
     RROutput	       *o = NULL;
     RRMode	       m = None;
+    Status	       status;
     int		       i;
 
     XGLX_SCREEN_PRIV (pScreen);
@@ -652,19 +653,22 @@ xglxRRCrtcSet (ScreenPtr   pScreen,
     for (i = 0; i < numOutputs; i++)
 	o[i] = (RROutput) outputs[i]->devPrivate;
 
-    XRRSetCrtcConfig (xdisplay, r,
-		      (RRCrtc) crtc->devPrivate,
-		      CurrentTime,
-		      x, y,
-		      m,
-		      rotation,
-		      o, numOutputs);
+    status = XRRSetCrtcConfig (xdisplay, r,
+			       (RRCrtc) crtc->devPrivate,
+			       CurrentTime,
+			       x, y,
+			       m,
+			       rotation,
+			       o, numOutputs);
 
     XRRFreeScreenResources (r);
 
     if (o)
 	free (o);
 
+    if (status != RRSetConfigSuccess)
+	return FALSE;
+
     return RRCrtcNotify (crtc, mode, x, y, rotation, numOutputs, outputs);
 }
 
commit 4ad493c4d89536a16fc2577e9280a9b63cf0b248
Author: David Reveman <davidr at novell.com>
Date:   Fri Jan 25 14:43:32 2008 -0500

    Free screen resources when done using them.

diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c
index 74fc8bd..ca0f7f2 100644
--- a/hw/xgl/glx/xglx.c
+++ b/hw/xgl/glx/xglx.c
@@ -649,8 +649,6 @@ xglxRRCrtcSet (ScreenPtr   pScreen,
 	    return FALSE;
     }
 
-    XRRFreeScreenResources (r);
-
     for (i = 0; i < numOutputs; i++)
 	o[i] = (RROutput) outputs[i]->devPrivate;
 
@@ -662,6 +660,8 @@ xglxRRCrtcSet (ScreenPtr   pScreen,
 		      rotation,
 		      o, numOutputs);
 
+    XRRFreeScreenResources (r);
+
     if (o)
 	free (o);
 


More information about the xorg-commit mailing list