[PATCH] dri2: Only invalidate our tree upon Pixmap changes

Keith Packard keithp at keithp.com
Sun Oct 26 17:23:42 PDT 2014


Chris Wilson <chris at chris-wilson.co.uk> writes:

> 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.

Might be better to just catch this in DIX and not call the
SetWindowPixmap chain at all?

diff --git a/composite/compwindow.c b/composite/compwindow.c
index 9a6b2da..77bdfa2 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -567,10 +567,11 @@ compCreateWindow(WindowPtr pWin)
     if (pWin->parent && ret) {
         CompSubwindowsPtr csw = GetCompSubwindows(pWin->parent);
         CompClientWindowPtr ccw;
+        PixmapPtr parent_pixmap = (*pScreen->GetWindowPixmap)(pWin->parent);
+        PixmapPtr window_pixmap = (*pScreen->GetWindowPixmap)(pWin);
 
-        (*pScreen->SetWindowPixmap) (pWin,
-                                     (*pScreen->GetWindowPixmap) (pWin->
-                                                                  parent));
+        if (window_pixmap != parent_pixmap)
+            (*pScreen->SetWindowPixmap) (pWin, parent_pixmap);
         if (csw)
             for (ccw = csw->clients; ccw; ccw = ccw->next)
                 compRedirectWindow(clients[CLIENT_ID(ccw->id)],

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20141026/5c9f6430/attachment.sig>


More information about the xorg-devel mailing list