summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-07-31 14:37:45 +0100
committerKeith Whitwell <[email protected]>2007-07-31 14:37:45 +0100
commit9273150f9a8394f4ef630a96f0089ad8cad607f5 (patch)
tree6a62bb6a88ebcc0af7682a811ab0c628daadd602 /src/mesa/drivers/dri/common
parent9bc1c92a0b809c6b60d5e4a2c8909f5f98528919 (diff)
parent7aefdd518578687f961bb512a2b408857f0b9824 (diff)
Merge branch 'i915tex_privbuffers' into softpipe_0_1_branch
Conflicts: src/mesa/drivers/dri/i915tex/intel_buffers.c src/mesa/drivers/dri/i915tex/intel_context.c src/mesa/drivers/dri/i915tex/intel_fbo.c src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c8
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index c30e66f1722..6e8a5b52180 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -120,7 +120,7 @@ static __DRIdrawable *__driFindDrawable(void *drawHash, __DRIid draw)
* Find drawables in the local hash that have been destroyed on the
* server.
*
- * \param drawHash Hash-table containing all know drawables.
+ * \param drawHash Hash-table containing all known drawables.
*/
static void __driGarbageCollectDrawables(void *drawHash)
{
@@ -235,6 +235,12 @@ static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn,
prp->refcount--;
}
+ /* destroy the drawables if they no longer exist on the server */
+ if ((pdp->refcount == 0) || (prp->refcount == 0)) {
+ /* probably shouldn't need the collector here,
+ as we know the affected drawables (or could there be others?) */
+ __driGarbageCollectDrawables(pdp->driScreenPriv->drawHash);
+ }
/* XXX this is disabled so that if we call SwapBuffers on an unbound
* window we can determine the last context bound to the window and
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index d36af3e5bee..d4f7f2527bb 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -209,7 +209,11 @@ driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
+#if 0
+ /* if the driver needs the hw lock for ResizeBuffers, the drawable
+ might have changed again by now */
assert(fb->Width == dPriv->w);
assert(fb->Height == dPriv->h);
+#endif
}
}