diff options
author | Michel Dänzer <[email protected]> | 2007-10-30 13:16:50 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2007-10-30 13:16:50 +0100 |
commit | 3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c (patch) | |
tree | 7fdc9e12fd8b95d03e1fe768a9bbb606db8f14e9 /src/mesa/drivers/dri/mga/mga_xmesa.c | |
parent | dc1264970e585c0939606922b3e964db4b9c28b3 (diff) |
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.
Diffstat (limited to 'src/mesa/drivers/dri/mga/mga_xmesa.c')
-rw-r--r-- | src/mesa/drivers/dri/mga/mga_xmesa.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 31042f9739b..896f2d94fc6 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -452,7 +452,6 @@ mgaCreateContext( const __GLcontextModes *mesaVis, GLcontext *ctx, *shareCtx; mgaContextPtr mmesa; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv; mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private; drm_mga_sarea_t *saPriv = (drm_mga_sarea_t *)(((char*)sPriv->pSAREA)+ mgaScreen->sarea_priv_offset); @@ -651,9 +650,6 @@ mgaCreateContext( const __GLcontextModes *mesaVis, debug_control ); #endif - dPriv->vblFlags = (mmesa->mgaScreen->irq == 0) - ? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache); - (*dri_interface->getUST)( & mmesa->swap_ust ); if (driQueryOptionb(&mmesa->optionCache, "no_rast")) { @@ -883,7 +879,13 @@ mgaMakeCurrent(__DRIcontextPrivate *driContextPriv, mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate; if (mmesa->driDrawable != driDrawPriv) { - driDrawableInitVBlank( driDrawPriv ); + if (driDrawPriv->swap_interval == (unsigned)-1) { + driDrawPriv->vblFlags = (mmesa->mgaScreen->irq == 0) + ? VBLANK_FLAG_NO_IRQ + : driGetDefaultVBlankFlags(&mmesa->optionCache); + + driDrawableInitVBlank( driDrawPriv ); + } mmesa->driDrawable = driDrawPriv; mmesa->dirty = ~0; |