fbShmCreatePixmap() was just another variant of wrapping an arbitrary
data pointer within a pixmap, ala GetScratchPixmapHeader().

By using the common version, the fbShmCreatePixmap() is also updated to
pass the information that the pixmap contents are not part of the ddx
address space.

Signed-off-by: Chris Wilson <[email protected]>
---
 Xext/shm.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/Xext/shm.c b/Xext/shm.c
index b08af82..c6a3aee 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -1018,18 +1018,10 @@ static PixmapPtr
 fbShmCreatePixmap (ScreenPtr pScreen,
                   int width, int height, int depth, char *addr)
 {
-    PixmapPtr pPixmap;
-
-    pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
-    if (!pPixmap)
-       return NullPixmap;
-
-    if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
-           BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) {
-       (*pScreen->DestroyPixmap)(pPixmap);
-       return NullPixmap;
-    }
-    return pPixmap;
+    return GetScratchPixmapHeader(pScreen, width, height, depth,
+                                 BitsPerPixel(depth),
+                                 PixmapBytePad(width, depth),
+                                 addr);
 }
 
 static int
-- 
1.7.5.3

_______________________________________________
[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