]> git.draconx.ca Git - gentoo-draconx.git/blob - x11-base/xorg-server/files/0003-shm-Replace-open-coded-version-of-GetScratchPixmapHe.patch
7cdd931f6911b984ee24e949a4ce7ad500a0af96
[gentoo-draconx.git] / x11-base / xorg-server / files / 0003-shm-Replace-open-coded-version-of-GetScratchPixmapHe.patch
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
5
6 fbShmCreatePixmap() was just another variant of wrapping an arbitrary
7 data pointer within a pixmap, ala GetScratchPixmapHeader().
8
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
11 address space.
12
13 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 ---
15  Xext/shm.c |   16 ++++------------
16  1 files changed, 4 insertions(+), 12 deletions(-)
17
18 diff --git a/Xext/shm.c b/Xext/shm.c
19 index b08af82..c6a3aee 100644
20 --- a/Xext/shm.c
21 +++ b/Xext/shm.c
22 @@ -1018,18 +1018,10 @@ static PixmapPtr
23  fbShmCreatePixmap (ScreenPtr pScreen,
24                    int width, int height, int depth, char *addr)
25  {
26 -    PixmapPtr pPixmap;
27 -
28 -    pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
29 -    if (!pPixmap)
30 -       return NullPixmap;
31 -
32 -    if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
33 -           BitsPerPixel(depth), PixmapBytePad(width, depth), (pointer)addr)) {
34 -       (*pScreen->DestroyPixmap)(pPixmap);
35 -       return NullPixmap;
36 -    }
37 -    return pPixmap;
38 +    return GetScratchPixmapHeader(pScreen, width, height, depth,
39 +                                 BitsPerPixel(depth),
40 +                                 PixmapBytePad(width, depth),
41 +                                 addr);
42  }
43  
44  static int
45 -- 
46 1.7.3.4
47