main/xorg-server: add some fixes from fedora

This commit is contained in:
Natanael Copa 2011-05-01 10:27:25 +00:00
parent e39d5af0c3
commit 321b8e24ec
4 changed files with 1210 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xorg-server
pkgver=1.10.1
pkgrel=0
pkgrel=1
pkgdesc="X.Org X servers"
url="http://xorg.freedesktop.org"
arch="all"
@ -60,6 +60,10 @@ makedepends="
source="http://xorg.freedesktop.org/releases/individual/xserver/$pkgname-$pkgver.tar.bz2
xorg-redhat-die-ugly-pattern-die-die-die.patch
bg-none-revert.patch
glx-pixmap-crash.patch
xserver-1.10-pointer-barriers.patch
"
depends_dev="pixman-dev libpciaccess-dev xproto randrproto renderproto
@ -69,9 +73,10 @@ depends_dev="pixman-dev libpciaccess-dev xproto randrproto renderproto
prepare() {
cd "$srcdir"/$pkgname-$pkgver
for i in ../*.patch; do
msg "Applying $i..."
patch -Np1 -i "$i" || return 1
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
# Fix dbus config path
sed -i -e 's/\$(sysconfdir)/\/etc/' config/Makefile.* || return 1
@ -92,7 +97,6 @@ build() {
--with-default-font-path=${_fontroot}/misc,${_fontroot}/100dpi:unscaled,${_fontroot}/75dpi:unscaled,${_fontroot}/TTF,${_fontroot}/Type1 \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-dri-driver-path=/usr/lib/xorg/modules/dri \
--enable-composite \
--enable-config-udev \
--enable-dri \
@ -149,4 +153,7 @@ xephyr() {
}
md5sums="75f117c74f2ecaf9dd167f6a66ac98de xorg-server-1.10.1.tar.bz2
222de594206d1148a90eddfda4f7a11a xorg-redhat-die-ugly-pattern-die-die-die.patch"
222de594206d1148a90eddfda4f7a11a xorg-redhat-die-ugly-pattern-die-die-die.patch
030dd3ec221b895de3057d7513d8c1d7 bg-none-revert.patch
baa098b7e1f95ab55e4c29fb3332baaf glx-pixmap-crash.patch
db48cea655c7bccec9171c5df1558a64 xserver-1.10-pointer-barriers.patch"

View File

@ -0,0 +1,58 @@
From 3bc6ed2d8c9028ec28015d05b60af67a194f3694 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 29 Mar 2011 14:09:46 +0000
Subject: Revert "composite: Don't backfill non-bg-None windows"
This reverts commit 6dd775f57d2f94f0ddaee324aeec33b9b66ed5bc.
Bugzilla: https://bugs.freedesktop.org/34427
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
diff --git a/composite/compalloc.c b/composite/compalloc.c
index e4064f6..7164c0d 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -508,17 +508,6 @@ compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin)
return Success;
}
-static int
-bgNoneVisitWindow(WindowPtr pWin, void *null)
-{
- if (pWin->backgroundState != BackgroundPixmap)
- return WT_WALKCHILDREN;
- if (pWin->background.pixmap != None)
- return WT_WALKCHILDREN;
-
- return WT_STOPWALKING;
-}
-
static PixmapPtr
compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
{
@@ -539,21 +528,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h, Bool map)
if (!map)
return pPixmap;
- /*
- * If there's no bg=None in the tree, we're done.
- *
- * We could optimize this more by collection the regions of all the
- * bg=None subwindows and feeding that in as the clip for the
- * CopyArea below, but since window trees are shallow these days it
- * might not be worth the effort.
- */
- if (TraverseTree(pWin, bgNoneVisitWindow, NULL) == WT_NOMATCH)
- return pPixmap;
-
- /*
- * Copy bits from the parent into the new pixmap so that it will
- * have "reasonable" contents in case for background None areas.
- */
if (pParent->drawable.depth == pWin->drawable.depth)
{
GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);
--
cgit v0.8.3-6-g21f6

View File

@ -0,0 +1,85 @@
From 390ba6686d1baf80627c01d4a4273981d6606cc9 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 28 Mar 2011 16:30:09 +0000
Subject: glx: Fix lifetime tracking for pixmaps
GLX pixmaps take a reference on the underlying pixmap; X and GLX pixmap
IDs can be destroyed in either order with no error. Only windows need
to be tracked under both XIDs.
Fixes piglit/glx-pixmap-life.
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 66d4c7e..d5b764f 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1127,10 +1127,11 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen,
return BadAlloc;
}
- /* Add the glx drawable under the XID of the underlying X drawable
- * too. That way we'll get a callback in DrawableGone and can
- * clean up properly when the drawable is destroyed. */
- if (drawableId != glxDrawableId &&
+ /*
+ * Windows aren't refcounted, so track both the X and the GLX window
+ * so we get called regardless of destruction order.
+ */
+ if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW &&
!AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
pGlxDraw->destroy (pGlxDraw);
return BadAlloc;
@@ -1161,6 +1162,8 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config
err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId,
glxDrawableId, GLX_DRAWABLE_PIXMAP);
+ ((PixmapPtr)pDraw)->refcnt++;
+
return err;
}
diff --git a/glx/glxext.c b/glx/glxext.c
index 3f3dd79..9cfc096 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -118,15 +118,15 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{
__GLXcontext *c, *next;
- /* If this drawable was created using glx 1.3 drawable
- * constructors, we added it as a glx drawable resource under both
- * its glx drawable ID and it X drawable ID. Remove the other
- * resource now so we don't a callback for freed memory. */
- if (glxPriv->drawId != glxPriv->pDraw->id) {
- if (xid == glxPriv->drawId)
- FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE);
- else
- FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
+ if (glxPriv->type == GLX_DRAWABLE_WINDOW) {
+ /* If this was created by glXCreateWindow, free the matching resource */
+ if (glxPriv->drawId != glxPriv->pDraw->id) {
+ if (xid == glxPriv->drawId)
+ FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE);
+ else
+ FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
+ }
+ /* otherwise this window was implicitly created by MakeCurrent */
}
for (c = glxAllContexts; c; c = next) {
@@ -143,6 +143,10 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
c->readPriv = NULL;
}
+ /* drop our reference to any backing pixmap */
+ if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+ glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr)glxPriv->pDraw);
+
glxPriv->destroy(glxPriv);
return True;
--
cgit v0.8.3-6-g21f6

File diff suppressed because it is too large Load Diff