1 From 25539d955903f408742bd1b79ce80b559c8f9af9 Mon Sep 17 00:00:00 2001
2 From: Chris Wilson <chris@chris-wilson.co.uk>
3 Date: Mon, 6 Jun 2011 05:36:08 +0000
4 Subject: [PATCH 3/4] shm: Replace open-coded version of GetScratchPixmapHeader
6 fbShmCreatePixmap() was just another variant of wrapping an arbitrary
7 data pointer within a pixmap, ala GetScratchPixmapHeader().
9 By using the common version, the fbShmCreatePixmap() is also updated to
10 pass the information that the pixmap contents are not part of the ddx
13 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 Xext/shm.c | 16 ++++------------
16 1 files changed, 4 insertions(+), 12 deletions(-)
18 diff --git a/Xext/shm.c b/Xext/shm.c
19 index b08af82..c6a3aee 100644
22 @@ -1018,18 +1018,10 @@ static PixmapPtr
23 fbShmCreatePixmap (ScreenPtr pScreen,
24 int width, int height, int depth, char *addr)
28 - pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
32 - if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
33 - BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) {
34 - (*pScreen->DestroyPixmap)(pPixmap);
38 + return GetScratchPixmapHeader(pScreen, width, height, depth,
39 + BitsPerPixel(depth),
40 + PixmapBytePad(width, depth),