xserver: Branch 'master' - 2 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Tue Jun 23 08:16:11 PDT 2009
glx/glxext.c | 25 ++++++++++++++++++++++++-
hw/xfree86/dri2/dri2.c | 12 ++++++++++--
2 files changed, 34 insertions(+), 3 deletions(-)
New commits:
commit 3020b1d43e34fca08cd51f7c7c8ed51497d49ef3
Author: Michel Dänzer <daenzer at vmware.com>
Date: Tue Jun 23 16:45:40 2009 +0200
glx: Clean up more thoroughly if the drawable of a current context goes away.
Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale.
diff --git a/glx/glxext.c b/glx/glxext.c
index 520eb2e..a571ec9 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -128,8 +128,31 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
for (c = glxAllContexts; c; c = c->next) {
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
+ int i;
+
(*c->loseCurrent)(c);
- __glXFlushContextCache();
+ c->isCurrent = GL_FALSE;
+ if (c == __glXLastContext)
+ __glXFlushContextCache();
+
+ for (i = 1; i < currentMaxClients; i++) {
+ if (clients[i]) {
+ __GLXclientState *cl = glxGetClient(clients[i]);
+
+ if (cl->inUse) {
+ int j;
+
+ for (j = 0; j < cl->numCurrentContexts; j++) {
+ if (cl->currentContexts[j] == c)
+ cl->currentContexts[j] = NULL;
+ }
+ }
+ }
+ }
+
+ if (!c->idExists) {
+ __glXFreeContext(c);
+ }
}
if (c->drawPriv == glxPriv)
c->drawPriv = NULL;
commit df597709d71f47b8516e27c6fb1bfffd59de5e48
Author: Michel Dänzer <daenzer at vmware.com>
Date: Tue Jun 23 16:45:39 2009 +0200
dri2: Don't crash if pPriv is NULL.
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 385c5e8..aead33b 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -186,10 +186,18 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
int need_fake_front = 0;
int have_fake_front = 0;
int front_format = 0;
- const int dimensions_match = (pDraw->width == pPriv->width)
- && (pDraw->height == pPriv->height);
+ int dimensions_match;
int i;
+ if (!pPriv) {
+ *width = pDraw->width;
+ *height = pDraw->height;
+ *out_count = 0;
+ return NULL;
+ }
+
+ dimensions_match = (pDraw->width == pPriv->width)
+ && (pDraw->height == pPriv->height);
buffers = xalloc((count + 1) * sizeof(buffers[0]));
More information about the xorg-commit
mailing list