From: Dave Airlie <airl...@redhat.com>

This bumps totalPixmapSize in all attached screens.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 dix/privates.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/dix/privates.c b/dix/privates.c
index af6d327..7f7ec8b 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -168,11 +168,28 @@ fixupDefaultColormaps(FixupFunc fixup, unsigned bytes)
     return TRUE;
 }
 
+static Bool
+fixupTotalPixmapSizes(FixupFunc fixup, unsigned bytes)
+{
+    int s;
+
+    for (s = 0; s < screenInfo.numScreens; s++) {
+        ScreenPtr pScreen = screenInfo.screens[s];
+        pScreen->totalPixmapSize += bytes;
+    }
+    for (s = 0; s < screenInfo.numGPUScreens; s++) {
+        ScreenPtr pScreen = screenInfo.gpuscreens[s];
+        pScreen->totalPixmapSize += bytes;
+    }
+    return TRUE;
+}
+
 static Bool (*const allocated_early[PRIVATE_LAST]) (FixupFunc, unsigned) = {
 [PRIVATE_SCREEN] = fixupScreens,
         [PRIVATE_CLIENT] = fixupServerClient,
         [PRIVATE_EXTENSION] = fixupExtensions,
-        [PRIVATE_COLORMAP] = fixupDefaultColormaps,};
+        [PRIVATE_COLORMAP] = fixupDefaultColormaps,
+        [PRIVATE_PIXMAP] = fixupTotalPixmapSizes,};
 
 /*
  * Register a private key. This takes the type of object the key will
-- 
1.7.10.2

_______________________________________________
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