diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-10-30 13:16:50 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-10-30 13:16:50 +0100 |
commit | 3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c (patch) | |
tree | 7fdc9e12fd8b95d03e1fe768a9bbb606db8f14e9 /src/mesa/drivers/dri/r300 | |
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/r300')
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_context.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_ioctl.c | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 8316b745ce..787d4b5c57 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -127,7 +127,6 @@ GLboolean radeonInitContext(radeonContextPtr radeon, void *sharedContextPrivate) { __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv; radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private); GLcontext* ctx; GLcontext* shareCtx; @@ -178,9 +177,6 @@ GLboolean radeonInitContext(radeonContextPtr radeon, radeon->do_usleeps ? "usleeps" : "busy waits", fthrottle_mode, radeon->radeonScreen->irq); - dPriv->vblFlags = (radeon->radeonScreen->irq != 0) - ? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ; - (*dri_interface->getUST) (&radeon->swap_ust); return GL_TRUE; @@ -278,7 +274,15 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, radeon->glCtx); if (radeon->dri.drawable != driDrawPriv) { - driDrawableInitVBlank(driDrawPriv); + if (driDrawPriv->swap_interval == (unsigned)-1) { + driDrawPriv->vblFlags = + (radeon->radeonScreen->irq != 0) + ? driGetDefaultVBlankFlags(&radeon-> + optionCache) + : VBLANK_FLAG_NO_IRQ; + + driDrawableInitVBlank(driDrawPriv); + } } radeon->dri.readable = driReadPriv; diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c index eeef71aaaf..866b1deaa0 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.c +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c @@ -187,8 +187,7 @@ void radeonCopyBuffer(__DRIdrawablePrivate * dPriv, if (!rect) { UNLOCK_HARDWARE(radeon); - driWaitForVBlank(dPriv, &dPriv->vblSeq, dPriv->vblFlags, - &missed_target); + driWaitForVBlank(dPriv, &missed_target); LOCK_HARDWARE(radeon); } @@ -293,8 +292,7 @@ void radeonPageFlip(__DRIdrawablePrivate * dPriv) */ radeonWaitForFrameCompletion(radeon); UNLOCK_HARDWARE(radeon); - driWaitForVBlank(dPriv, &dPriv->vblSeq, dPriv->vblFlags, - &missed_target); + driWaitForVBlank(dPriv, &missed_target); if (missed_target) { radeon->swap_missed_count++; (void)(*dri_interface->getUST) (&radeon->swap_missed_ust); |