While a redirected window is flipped, its pixmap may still be used as
and EGL image and should also get invalidated. When sending invalidate
events for a window, also send the events for its pixmap.

Signed-off-by: Ville Syrjälä <syrj...@sci.fi>
---
 glx/glxdri2.c             |    2 +-
 hw/xfree86/dri2/dri2.c    |    3 ++-
 hw/xfree86/dri2/dri2.h    |    3 ++-
 hw/xfree86/dri2/dri2ext.c |    4 ++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 8187a3e..5e524db 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -423,7 +423,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
 }
 
 static void
-__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv)
+__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
 {
 #if __DRI2_FLUSH_VERSION >= 3
     __GLXDRIdrawable *private = priv;
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 86e98a5..d6441a2 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -587,7 +587,7 @@ DRI2InvalidateDrawable(DrawablePtr pDraw)
     pPriv->needInvalidate = FALSE;
 
     list_for_each_entry(ref, &pPriv->reference_list, link)
-       ref->invalidate(pDraw, ref->priv);
+       ref->invalidate(pDraw, ref->priv, ref->id);
 }
 
 /*
@@ -958,6 +958,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 
target_msc,
         * windows using the same pixmap
         */
        TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
+       DRI2InvalidateDrawable(&pPixmap->drawable);
     } else
        DRI2InvalidateDrawable(pDraw);
 
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 9c93209..a67e35f 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -166,7 +166,8 @@ typedef int         (*DRI2ScheduleWaitMSCProcPtr)(ClientPtr 
client,
                                                      CARD64 remainder);
 
 typedef void           (*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
-                                                void *data);
+                                                void *data,
+                                                XID id);
 
 /**
  * DRI2 calls this hook when ever swap_limit is going to be changed. Default
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index e612cf0..73ef7f2 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -156,13 +156,13 @@ ProcDRI2Authenticate(ClientPtr client)
 }
 
 static void
-DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv)
+DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id)
 {
     xDRI2InvalidateBuffers event;
     ClientPtr client = priv;
 
     event.type = DRI2EventBase + DRI2_InvalidateBuffers;
-    event.drawable = pDraw->id;
+    event.drawable = id;
 
     WriteEventsToClient(client, 1, (xEvent *)&event);
 }
-- 
1.7.3.4

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to