From 25539d955903f408742bd1b79ce80b559c8f9af9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 6 Jun 2011 05:36:08 +0000 Subject: [PATCH 3/4] shm: Replace open-coded version of GetScratchPixmapHeader 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 --- 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.3.4