summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-10-30 13:16:50 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-10-30 13:16:50 +0100
commit3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c (patch)
tree7fdc9e12fd8b95d03e1fe768a9bbb606db8f14e9 /src/mesa/drivers/dri/r200
parentdc1264970e585c0939606922b3e964db4b9c28b3 (diff)
downloadexternal_mesa3d-3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c.zip
external_mesa3d-3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c.tar.gz
external_mesa3d-3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c.tar.bz2
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/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c16
-rw-r--r--src/mesa/drivers/dri/r200/r200_ioctl.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 2b18889..982bd9e 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -248,7 +248,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
void *sharedContextPrivate)
{
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
radeonScreenPtr screen = (radeonScreenPtr)(sPriv->private);
struct dd_function_table functions;
r200ContextPtr rmesa;
@@ -500,9 +499,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
fthrottle_mode,
rmesa->r200Screen->irq);
- dPriv->vblFlags = (rmesa->r200Screen->irq != 0)
- ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
rmesa->prefer_gart_client_texturing =
(getenv("R200_GART_CLIENT_TEXTURES") != 0);
@@ -667,14 +663,18 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
if (R200_DEBUG & DEBUG_DRI)
fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
- if ( newCtx->dri.drawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv );
- }
-
newCtx->dri.readable = driReadPriv;
if ( newCtx->dri.drawable != driDrawPriv ||
newCtx->lastStamp != driDrawPriv->lastStamp ) {
+ if (driDrawPriv->swap_interval == (unsigned)-1) {
+ driDrawPriv->vblFlags = (newCtx->r200Screen->irq != 0)
+ ? driGetDefaultVBlankFlags(&newCtx->optionCache)
+ : VBLANK_FLAG_NO_IRQ;
+
+ driDrawableInitVBlank( driDrawPriv );
+ }
+
newCtx->dri.drawable = driDrawPriv;
r200SetCliprects(newCtx);
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index 2ab9ff8..34e7ada 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -449,7 +449,7 @@ void r200CopyBuffer( __DRIdrawablePrivate *dPriv,
if (!rect)
{
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags, & missed_target );
+ driWaitForVBlank( dPriv, & missed_target );
LOCK_HARDWARE( rmesa );
}
@@ -553,7 +553,7 @@ void r200PageFlip( __DRIdrawablePrivate *dPriv )
*/
r200WaitForFrameCompletion( rmesa );
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags, & missed_target );
+ driWaitForVBlank( dPriv, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
(void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );