x11perf -ucreate highlights an instance where compCreateWindow reassigns
the same Pixmap to the Window. Currently this triggers an expensive
invalidation of the entire window hierachy, making sure that DRI2
clients are kept informed of the handle changes. However, as the backing
Pixmap for the Window is actually unchanged, there is no need to
invalidate at all.

Signed-off-by: Chris Wilson <[email protected]>
---
 hw/xfree86/dri2/dri2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 140c833..028cfae 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1393,13 +1393,15 @@ DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
     DrawablePtr pDraw = (DrawablePtr) pWin;
     ScreenPtr pScreen = pDraw->pScreen;
     DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+    PixmapPtr pOld = pScreen->GetWindowPixmap(pWin);
 
     pScreen->SetWindowPixmap = ds->SetWindowPixmap;
     (*pScreen->SetWindowPixmap) (pWin, pPix);
     ds->SetWindowPixmap = pScreen->SetWindowPixmap;
     pScreen->SetWindowPixmap = DRI2SetWindowPixmap;
 
-    DRI2InvalidateDrawableAll(pDraw);
+    if (pPix != pOld)
+       DRI2InvalidateDrawableAll(pDraw);
 }
 
 #define MAX_PRIME DRI2DriverPrimeMask
-- 
2.1.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to