Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e265b08b6bebf8514a189c80db57a2d3 > files > 38

x11-server-1.3.0.0-25.1mdv2008.0.src.rpm

--- xorg-server-1.3.0.0/fb/fbpixmap.c.orig	2007-09-14 15:06:25.000000000 -0300
+++ xorg-server-1.3.0.0/fb/fbpixmap.c	2007-09-14 15:28:21.000000000 -0300
@@ -30,6 +30,9 @@
 
 #include "fb.h"
 
+/* X isn't multithreaded... */
+static int temporary_hack;
+
 PixmapPtr
 fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
 {
@@ -55,7 +58,11 @@ fbCreatePixmapBpp (ScreenPtr pScreen, in
 #ifdef FB_DEBUG
     datasize += 2 * paddedWidth;
 #endif
-    pPixmap = AllocatePixmap(pScreen, datasize);
+    if (temporary_hack == 0) {
+	pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, 32/* just to make sure it will have enough memory */);
+    }
+    else
+	pPixmap = AllocatePixmap(pScreen, datasize);
     if (!pPixmap)
 	return NullPixmap;
     pPixmap->drawable.type = DRAWABLE_PIXMAP;
@@ -64,7 +71,9 @@ fbCreatePixmapBpp (ScreenPtr pScreen, in
     pPixmap->drawable.depth = depth;
     pPixmap->drawable.bitsPerPixel = bpp;
     pPixmap->drawable.id = 0;
-    pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+    if (temporary_hack) {
+        pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+    }
     pPixmap->drawable.x = 0;
     pPixmap->drawable.y = 0;
     pPixmap->drawable.width = width;
@@ -89,12 +98,17 @@ PixmapPtr
 fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
 {
     int	bpp;
+    PixmapPtr pPixmap;
+
     bpp = BitsPerPixel (depth);
 #ifdef FB_SCREEN_PRIVATE
     if (bpp == 32 && depth <= 24)
 	bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
 #endif
-    return fbCreatePixmapBpp (pScreen, width, height, depth, bpp);
+    temporary_hack = 1;
+    pPixmap = fbCreatePixmapBpp (pScreen, width, height, depth, bpp);
+    temporary_hack = 0;
+    return pPixmap;
 }
 
 Bool