From f022bff5aa828cfdbb4749f672fc51c345f9cb33 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 13 Jul 2007 20:47:17 +0200 Subject: bugfixes (wrt fb updates), cleanups move drawable validation back to where it was now that the driDrawable information isn't used directly anymore. Fix bogus fb updates (the context we get for SwapBuffer processing may not have the drawable being processed attached!) glthreads behaves a bit better but still not correct. --- src/mesa/drivers/dri/i915tex/intel_context.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/mesa/drivers/dri/i915tex/intel_context.c') diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index 451c7fd1ba..41eaafece2 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -572,7 +572,6 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driDrawPriv, __DRIdrawablePrivate * driReadPriv) { - GLuint updatebufsize = GL_FALSE; #if 0 if (driDrawPriv) { @@ -620,22 +619,18 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, } } - /* only update GLframebuffer size to match window - if here for the first time */ - if (intel->ctx.FirstTimeCurrent) { - updatebufsize = GL_TRUE; - driUpdateFramebufferSize(&intel->ctx, driDrawPriv); + /* update GLframebuffer size to match window if needed */ + driUpdateFramebufferSize(&intel->ctx, driDrawPriv); - if (driReadPriv != driDrawPriv) { - driUpdateFramebufferSize(&intel->ctx, driReadPriv); - } + if (driReadPriv != driDrawPriv) { + driUpdateFramebufferSize(&intel->ctx, driReadPriv); } _mesa_make_current(&intel->ctx, &intel_fb->Base, readFb); /* The drawbuffer won't always be updated by _mesa_make_current: */ - if (updatebufsize && intel->ctx.DrawBuffer == &intel_fb->Base) { + if (intel->ctx.DrawBuffer == &intel_fb->Base) { if (intel->driDrawable != driDrawPriv) { intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0) @@ -646,9 +641,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, &intel_fb->vbl_seq); intel->driDrawable = driDrawPriv; intelWindowMoved(intel); + intel->lastStamp = driDrawPriv->lastStamp; + } + else if (intel->lastStamp != driDrawPriv->lastStamp) { + intel_draw_buffer(&intel->ctx, &intel_fb->Base); } - - intel_draw_buffer(&intel->ctx, &intel_fb->Base); } } else { @@ -677,8 +674,7 @@ intelContendedLock(struct intel_context *intel, GLuint flags) * checking must be done *after* this call: */ if (dPriv) - intel->revalidateDrawable = GL_TRUE; -// DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); if (sarea->width != intelScreen->width || sarea->height != intelScreen->height || -- cgit v1.2.3