[xserver patch v4 4/5] glx/dri2: Notify the driver when its buffers become invalid.

Francisco Jerez currojerez at riseup.net
Mon Feb 8 10:25:15 PST 2010


Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
 glx/glxdri2.c |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 0f998de..dae7b42 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -67,6 +67,7 @@ struct __GLXDRIscreen {
 
     xf86EnterVTProc	*enterVT;
     xf86LeaveVTProc	*leaveVT;
+    PreConfigureWindowProcPtr PreConfigureWindow;
 
     const __DRIcoreExtension *core;
     const __DRIdri2Extension *dri2;
@@ -217,13 +218,13 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
     __GLXDRIscreen *screen = priv->screen;
     CARD64 unused;
 
-    if (screen->flush)
-	(*screen->flush->flushInvalidate)(priv->driDrawable);
-
     if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
 			__glXdriSwapEvent, drawable->pDraw) != Success)
 	return FALSE;
 
+    if (screen->flush)
+	(*screen->flush->invalidate)(priv->driDrawable);
+
     return TRUE;
 }
 
@@ -607,6 +608,24 @@ glxDRILeaveVT (int index, int flags)
 }
 
 static void
+glxDRIPreConfigureWindow(WindowPtr pWin, int x, int y, int w, int h, int bw,
+			 WindowPtr pSib)
+{
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    __GLXDRIscreen *screen = (__GLXDRIscreen *)glxGetScreen(pScreen);
+    __GLXDRIdrawable *draw = (__GLXDRIdrawable *)glxGetDrawableFromWindow(pWin);
+
+    if (screen->PreConfigureWindow)
+	    (*screen->PreConfigureWindow)(pWin, x, y, w, h, bw, pSib);
+
+    if (!draw || (draw->height == h && draw->width == w))
+	    return;
+
+    if (screen->flush)
+	    screen->flush->invalidate(draw->driDrawable);
+}
+
+static void
 initializeExtensions(__GLXDRIscreen *screen)
 {
     const __DRIextension **extensions;
@@ -782,6 +801,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     screen->leaveVT = pScrn->LeaveVT;
     pScrn->LeaveVT = glxDRILeaveVT;
 
+    screen->PreConfigureWindow = pScreen->PreConfigureWindow;
+    pScreen->PreConfigureWindow = glxDRIPreConfigureWindow;
+
     LogMessage(X_INFO,
 	       "AIGLX: Loaded and initialized %s\n", filename);
 
-- 
1.6.4.4



More information about the xorg-devel mailing list