summaryrefslogtreecommitdiff
path: root/testing/xorg-server
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-10-11 23:14:37 +0000
committerroot <root@rshg054.dnsready.net>2011-10-11 23:14:37 +0000
commitf482dc1bd42773a12552e5a60df119410a0d8bd8 (patch)
tree7ef11817f41aecf969aeeb03f0dbb3cc28e2d8b4 /testing/xorg-server
parentcbcf42aba84733e1b9072f5320519c99bf8c0ac7 (diff)
Tue Oct 11 23:14:37 UTC 2011
Diffstat (limited to 'testing/xorg-server')
-rw-r--r--testing/xorg-server/PKGBUILD14
-rw-r--r--testing/xorg-server/git-fixes.patch288
-rw-r--r--testing/xorg-server/revert-trapezoids.patch179
3 files changed, 479 insertions, 2 deletions
diff --git a/testing/xorg-server/PKGBUILD b/testing/xorg-server/PKGBUILD
index ab8e8ae14..1de69bf3c 100644
--- a/testing/xorg-server/PKGBUILD
+++ b/testing/xorg-server/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 138468 2011-09-24 11:29:23Z jgc $
+# $Id: PKGBUILD 140222 2011-10-10 09:08:07Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgbase=xorg-server
pkgname=('xorg-server' 'xorg-server-xephyr' 'xorg-server-xdmx' 'xorg-server-xvfb' 'xorg-server-xnest' 'xorg-server-common' 'xorg-server-devel')
pkgver=1.11.1
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
license=('custom')
url="http://xorg.freedesktop.org"
@@ -13,12 +13,16 @@ options=('!libtool')
source=(${url}/releases/individual/xserver/${pkgbase}-${pkgver}.tar.bz2
autoconfig-nvidia.patch
autoconfig-sis.patch
+ revert-trapezoids.patch
+ git-fixes.patch
xvfb-run
xvfb-run.1
10-quirks.conf)
sha1sums=('ed0358b61294f1283aad42cf1e609752ceeffafd'
'0249b892f27243d8fe6fe6d226bf4c2391cedf49'
'962fecc159c128728f14e8ba231c5b00391ff4ac'
+ 'd9f7d9553e772c2682c15079019d30c658a4f83b'
+ 'd73125bf93aea09b0beb55e75c510b9f72f5d21a'
'c94f742d3f9cabf958ae58e4015d9dd185aabedc'
'6838fc00ef4618c924a77e0fb03c05346080908a'
'993798f3d22ad672d769dae5f48d1fa068d5578f')
@@ -32,6 +36,12 @@ build() {
# Use unofficial imedia SiS driver for supported SiS devices
patch -Np0 -i "${srcdir}/autoconfig-sis.patch"
+ # Revert commit that causes huge slowdowns with binary nVidia driver
+ patch -Np1 -i "${srcdir}/revert-trapezoids.patch"
+
+ # Add post-release patches from 1.11 branch
+ patch -Np1 -i "${srcdir}/git-fixes.patch"
+
autoreconf
./configure --prefix=/usr \
--enable-ipv6 \
diff --git a/testing/xorg-server/git-fixes.patch b/testing/xorg-server/git-fixes.patch
new file mode 100644
index 000000000..3c59c27c9
--- /dev/null
+++ b/testing/xorg-server/git-fixes.patch
@@ -0,0 +1,288 @@
+From bd6ea85209e5ab80375d4ec9994d10a89fd1374a Mon Sep 17 00:00:00 2001
+From: Jamey Sharp <jamey@minilop.net>
+Date: Wed, 15 Sep 2010 01:35:21 +0000
+Subject: Fix pixmap double-frees on error paths.
+
+If AddResource fails, it will automatically free the object that was
+passed to it by calling the appropriate deleteFunc; and of course
+FreeResource also calls the deleteFunc. In both cases it's wrong to call
+the destroy hook manually.
+
+Commit by Jamey Sharp and Josh Triplett.
+
+Signed-off-by: Jamey Sharp <jamey@minilop.net>
+Signed-off-by: Josh Triplett <josh@joshtriplett.org>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
+(cherry picked from commit 0f380a5005f800572773cd4667ce43c7459cc467)
+---
+diff --git a/Xext/shm.c b/Xext/shm.c
+index b08af82..4141a8f 100644
+--- a/Xext/shm.c
++++ b/Xext/shm.c
+@@ -991,7 +991,6 @@ CreatePmap:
+ pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pMap->drawable.id = newPix->info[j].id;
+ if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
+- (*pScreen->DestroyPixmap)(pMap);
+ result = BadAlloc;
+ break;
+ }
+@@ -1002,10 +1001,8 @@ CreatePmap:
+ }
+
+ if(result == BadAlloc) {
+- while(j--) {
+- (*pScreen->DestroyPixmap)(pMap);
++ while(j--)
+ FreeResource(newPix->info[j].id, RT_NONE);
+- }
+ free(newPix);
+ } else
+ AddResource(stuff->pid, XRT_PIXMAP, newPix);
+@@ -1110,7 +1107,6 @@ CreatePmap:
+ {
+ return Success;
+ }
+- pDraw->pScreen->DestroyPixmap(pMap);
+ }
+ return BadAlloc;
+ }
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 192c8c3..f8200b1 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -1419,7 +1419,6 @@ CreatePmap:
+ }
+ if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
+ return Success;
+- (*pDraw->pScreen->DestroyPixmap)(pMap);
+ }
+ return BadAlloc;
+ }
+--
+cgit v0.9.0.2-2-gbebe
+From 347f5610ca023fb31485aa19c20607af8bf9c834 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Tue, 30 Aug 2011 22:46:52 +0000
+Subject: Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices
+
+The corresponding DeviceIntPtr wasn't being gotten properly,
+resulting in BadDevice from dixLookupDevice().
+
+Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit f52d5cd374563544dafe29587411f345e31bbdf8)
+---
+diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
+index ae43433..5cdd8ac 100644
+--- a/Xi/xipassivegrab.c
++++ b/Xi/xipassivegrab.c
+@@ -261,9 +261,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
+ REQUEST(xXIPassiveUngrabDeviceReq);
+ REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
+
+- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
+- if (rc != Success)
+- return rc;
++ if (stuff->deviceid == XIAllDevices)
++ dev = inputInfo.all_devices;
++ else if (stuff->deviceid == XIAllMasterDevices)
++ dev = inputInfo.all_master_devices;
++ else
++ {
++ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
++ if (rc != Success)
++ return rc;
++ }
+
+ if (stuff->grab_type != XIGrabtypeButton &&
+ stuff->grab_type != XIGrabtypeKeycode &&
+--
+cgit v0.9.0.2-2-gbebe
+From e9ae33316012ffe9acfeeb7303ab3392c2ca2a2b Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <sam.spilsbury@canonical.com>
+Date: Wed, 14 Sep 2011 01:58:34 +0000
+Subject: Remove the SendEvent bit (0x80) before doing range checks on event type.
+
+Some extension libraries may set this bit before converting the event to
+wire protocol and as such range checking the event will cause an invalid
+BadValue error to result. As the documentation suggests the the bit
+should be "forced on", remove it before doing range checks and continue
+to force it on in the server.
+
+Reviewed-by: Jamey Sharp <jamey@minilop.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+(cherry picked from commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39)
+---
+diff --git a/dix/events.c b/dix/events.c
+index 8a4c6b9..9e58edb 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -5224,6 +5224,8 @@ CloseDownEvents(void)
+ InputEventList = NULL;
+ }
+
++#define SEND_EVENT_BIT 0x80
++
+ /**
+ * Server-side protocol handling for SendEvent request.
+ *
+@@ -5241,6 +5243,16 @@ ProcSendEvent(ClientPtr client)
+
+ REQUEST_SIZE_MATCH(xSendEventReq);
+
++ /* libXext and other extension libraries may set the bit indicating
++ * that this event came from a SendEvent request so remove it
++ * since otherwise the event type may fail the range checks
++ * and cause an invalid BadValue error to be returned.
++ *
++ * This is safe to do since we later add the SendEvent bit (0x80)
++ * back in once we send the event to the client */
++
++ stuff->event.u.u.type &= ~(SEND_EVENT_BIT);
++
+ /* The client's event type must be a core event type or one defined by an
+ extension. */
+
+@@ -5298,7 +5310,7 @@ ProcSendEvent(ClientPtr client)
+ client->errorValue = stuff->propagate;
+ return BadValue;
+ }
+- stuff->event.u.u.type |= 0x80;
++ stuff->event.u.u.type |= SEND_EVENT_BIT;
+ if (stuff->propagate)
+ {
+ for (;pWin; pWin = pWin->parent)
+--
+cgit v0.9.0.2-2-gbebe
+From b45e22675364915c32560c26404cf30d77ab68aa Mon Sep 17 00:00:00 2001
+From: Alan Hourihane <alanh@vmware.com>
+Date: Wed, 05 Oct 2011 02:42:46 +0000
+Subject: dixfonts: Don't overwrite local c variable until new_closure is safely initialized.
+
+Signed-off-by: Alan Hourihane <alanh@vmware.com>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit 7a33c5b934382b5554f41ab1502514e91c9bc52e)
+---
+diff --git a/dix/dixfonts.c b/dix/dixfonts.c
+index fbac124..d2bcb84 100644
+--- a/dix/dixfonts.c
++++ b/dix/dixfonts.c
+@@ -1302,31 +1302,30 @@ doPolyText(ClientPtr client, PTclosurePtr c)
+ goto bail;
+ }
+ *new_closure = *c;
+- c = new_closure;
+
+- len = c->endReq - c->pElt;
+- c->data = malloc(len);
+- if (!c->data)
++ len = new_closure->endReq - new_closure->pElt;
++ new_closure->data = malloc(len);
++ if (!new_closure->data)
+ {
+- free(c);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
+- memmove(c->data, c->pElt, len);
+- c->pElt = c->data;
+- c->endReq = c->pElt + len;
++ memmove(new_closure->data, new_closure->pElt, len);
++ new_closure->pElt = new_closure->data;
++ new_closure->endReq = new_closure->pElt + len;
+
+ /* Step 2 */
+
+- pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
++ pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen);
+ if (!pGC)
+ {
+- free(c->data);
+- free(c);
++ free(new_closure->data);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
+- if ((err = CopyGC(c->pGC, pGC, GCFunction |
++ if ((err = CopyGC(new_closure->pGC, pGC, GCFunction |
+ GCPlaneMask | GCForeground |
+ GCBackground | GCFillStyle |
+ GCTile | GCStipple |
+@@ -1337,15 +1336,16 @@ doPolyText(ClientPtr client, PTclosurePtr c)
+ Success)
+ {
+ FreeScratchGC(pGC);
+- free(c->data);
+- free(c);
++ free(new_closure->data);
++ free(new_closure);
+ err = BadAlloc;
+ goto bail;
+ }
++ c = new_closure;
+ origGC = c->pGC;
+ c->pGC = pGC;
+ ValidateGC(c->pDraw, c->pGC);
+-
++
+ ClientSleep(client, (ClientSleepProcPtr)doPolyText, c);
+
+ /* Set up to perform steps 3 and 4 */
+--
+cgit v0.9.0.2-2-gbebe
+From bec15eb73a17fb47963ff6b747ea504f7dc05deb Mon Sep 17 00:00:00 2001
+From: Kirill Elagin <kirelagin@gmail.com>
+Date: Tue, 04 Oct 2011 19:02:20 +0000
+Subject: Fix server crash due to invalid images
+
+See https://bugs.freedesktop.org/show_bug.cgi?id=39383
+
+Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit 53611213396479abfdce0f7752681572e0d26d78)
+---
+diff --git a/fb/fbpict.c b/fb/fbpict.c
+index d1fd0cb..57c93fd 100644
+--- a/fb/fbpict.c
++++ b/fb/fbpict.c
+@@ -163,7 +163,9 @@ create_bits_picture (PicturePtr pict,
+ (pixman_format_code_t)pict->format,
+ pixmap->drawable.width, pixmap->drawable.height,
+ (uint32_t *)bits, stride * sizeof (FbStride));
+-
++
++ if (!image)
++ return NULL;
+
+ #ifdef FB_ACCESS_WRAPPER
+ #if FB_SHIFT==5
+--
+cgit v0.9.0.2-2-gbebe
+From 65469f5ea98074ab27ce0a2d482157b9d5c2cbc7 Mon Sep 17 00:00:00 2001
+From: vdb@picaros.org <vdb@picaros.org>
+Date: Sat, 17 Sep 2011 16:55:47 +0000
+Subject: Fix a rare memory leak
+
+Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+(cherry picked from commit e4cddf509e1729e8ff40354275b65455111ad2bd)
+---
+diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
+index c2814d4..3fae039 100644
+--- a/hw/xfree86/modes/xf86Crtc.c
++++ b/hw/xfree86/modes/xf86Crtc.c
+@@ -133,6 +133,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn,
+ crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ {
++ free(crtc->gamma_red);
+ free(crtc);
+ return NULL;
+ }
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/testing/xorg-server/revert-trapezoids.patch b/testing/xorg-server/revert-trapezoids.patch
new file mode 100644
index 000000000..b9046c5cb
--- /dev/null
+++ b/testing/xorg-server/revert-trapezoids.patch
@@ -0,0 +1,179 @@
+diff -ru a/fb/fbpict.c b/fb/fbpict.c
+--- a/fb/fbpict.c 2011-08-01 01:44:24.000000000 +0200
++++ b/fb/fbpict.c 2011-10-05 22:45:29.000000000 +0200
+@@ -364,7 +364,7 @@
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+ ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
+- ps->Trapezoids = fbTrapezoids;
++ ps->Trapezoids = miTrapezoids;
+ ps->AddTraps = fbAddTraps;
+ ps->AddTriangles = fbAddTriangles;
+ ps->Triangles = fbTriangles;
+diff -ru a/render/mipict.c b/render/mipict.c
+--- a/render/mipict.c 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mipict.c 2011-10-05 22:02:53.000000000 +0200
+@@ -573,6 +573,67 @@
+ }
+ }
+
++void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps)
++{
++ ScreenPtr pScreen = pDst->pDrawable->pScreen;
++ PictureScreenPtr ps = GetPictureScreen(pScreen);
++
++ /*
++ * Check for solid alpha add
++ */
++ if (op == PictOpAdd && miIsSolidAlpha (pSrc))
++ {
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
++ }
++ else if (maskFormat)
++ {
++ PicturePtr pPicture;
++ BoxRec bounds;
++ INT16 xDst, yDst;
++ INT16 xRel, yRel;
++
++ xDst = traps[0].left.p1.x >> 16;
++ yDst = traps[0].left.p1.y >> 16;
++
++ miTrapezoidBounds (ntrap, traps, &bounds);
++ if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
++ return;
++ pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ if (!pPicture)
++ return;
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pPicture, traps,
++ -bounds.x1, -bounds.y1);
++ xRel = bounds.x1 + xSrc - xDst;
++ yRel = bounds.y1 + ySrc - yDst;
++ CompositePicture (op, pSrc, pPicture, pDst,
++ xRel, yRel, 0, 0, bounds.x1, bounds.y1,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ FreePicture (pPicture, 0);
++ }
++ else
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ for (; ntrap; ntrap--, traps++)
++ miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
++ }
++}
++
+ Bool
+ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+ {
+@@ -599,7 +660,7 @@
+ ps->Composite = 0; /* requires DDX support */
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+- ps->Trapezoids = 0;
++ ps->Trapezoids = miTrapezoids;
+ ps->Triangles = 0;
+
+ ps->RasterizeTrapezoid = 0; /* requires DDX support */
+diff -ru a/render/mipict.h b/render/mipict.h
+--- a/render/mipict.h 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mipict.h 2011-10-05 22:06:19.000000000 +0200
+@@ -129,6 +129,23 @@
+ CARD32 pixel,
+ xRenderColor *color);
+
++extern _X_EXPORT PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height);
++
++extern _X_EXPORT void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps);
++
+ extern _X_EXPORT Bool
+ miIsSolidAlpha (PicturePtr pSrc);
+
+diff -ru a/render/mitrap.c b/render/mitrap.c
+--- a/render/mitrap.c 2011-04-04 05:19:50.000000000 +0200
++++ b/render/mitrap.c 2011-10-05 22:05:29.000000000 +0200
+@@ -34,6 +34,55 @@
+ #include "picturestr.h"
+ #include "mipict.h"
+
++PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height)
++{
++ PixmapPtr pPixmap;
++ PicturePtr pPicture;
++ GCPtr pGC;
++ int error;
++ xRectangle rect;
++
++ if (width > 32767 || height > 32767)
++ return 0;
++
++ if (!pPictFormat)
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ if (!pPictFormat)
++ return 0;
++ }
++
++ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
++ pPictFormat->depth, 0);
++ if (!pPixmap)
++ return 0;
++ pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
++ if (!pGC)
++ {
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return 0;
++ }
++ ValidateGC (&pPixmap->drawable, pGC);
++ rect.x = 0;
++ rect.y = 0;
++ rect.width = width;
++ rect.height = height;
++ (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
++ FreeScratchGC (pGC);
++ pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
++ 0, 0, serverClient, &error);
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return pPicture;
++}
++
+ static xFixed
+ miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
+ {
+