From 3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 30 Oct 2007 13:16:50 +0100 Subject: More vblank cleanups. * Fix crash at context creation in most drivers supporting vblank. * Don't pass vblank sequence or flags to functions that get passed the drawable private already. * Attempt to initialize vblank related drawable private fields just once per drawable. May need more work in some drivers. --- src/mesa/drivers/dri/radeon/radeon_context.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index fe6d3c21b8..18d9b0b65a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -424,9 +424,6 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); - rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0) - ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ; - (*dri_interface->getUST)( & rmesa->swap_ust ); @@ -592,15 +589,18 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, if (RADEON_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *) newCtx->glCtx); - if ( newCtx->dri.drawable != driDrawPriv ) { - /* XXX we may need to validate the drawable here!!! */ - driDrawableInitVBlank( driDrawPriv ); - } - newCtx->dri.readable = driReadPriv; if ( (newCtx->dri.drawable != driDrawPriv) || newCtx->lastStamp != driDrawPriv->lastStamp ) { + if (driDrawPriv->swap_interval == (unsigned)-1) { + driDrawPriv->vblFlags = (newCtx->radeonScreen->irq != 0) + ? driGetDefaultVBlankFlags(&newCtx->optionCache) + : VBLANK_FLAG_NO_IRQ; + + driDrawableInitVBlank( driDrawPriv ); + } + newCtx->dri.drawable = driDrawPriv; radeonSetCliprects(newCtx); -- cgit v1.2.3