summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/unichrome
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-10-30 13:16:50 +0100
committerMichel Dänzer <[email protected]>2007-10-30 13:16:50 +0100
commit3177b4e2cf7d2fff7428cb6057bebbe60ff5cc6c (patch)
tree7fdc9e12fd8b95d03e1fe768a9bbb606db8f14e9 /src/mesa/drivers/dri/unichrome
parentdc1264970e585c0939606922b3e964db4b9c28b3 (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/unichrome')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c18
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c3
2 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index 5d95d97d539..1551be5e751 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -465,7 +465,6 @@ viaCreateContext(const __GLcontextModes *visual,
GLcontext *ctx, *shareCtx;
struct via_context *vmesa;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
- __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
(((GLubyte *)sPriv->pSAREA) + viaScreen->sareaPrivOffset);
@@ -659,10 +658,6 @@ viaCreateContext(const __GLcontextModes *visual,
driQueryOptionb(&vmesa->optionCache, "no_rast"))
FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1);
- dPriv->vblFlags =
- vmesa->viaScreen->irqEnabled ?
- driGetDefaultVBlankFlags(&vmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
-
if (getenv("VIA_PAGEFLIP"))
vmesa->allowPageFlip = 1;
@@ -838,12 +833,17 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
- if (vmesa->driDrawable != driDrawPriv) {
- driDrawableInitVBlank(driDrawPriv);
- }
-
if ((vmesa->driDrawable != driDrawPriv)
|| (vmesa->driReadable != driReadPriv)) {
+ if (driDrawPriv->swap_interval == (unsigned)-1) {
+ driDrawPriv->vblFlags =
+ vmesa->viaScreen->irqEnabled ?
+ driGetDefaultVBlankFlags(&vmesa->optionCache) :
+ VBLANK_FLAG_NO_IRQ;
+
+ driDrawableInitVBlank(driDrawPriv);
+ }
+
vmesa->driDrawable = driDrawPriv;
vmesa->driReadable = driReadPriv;
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index 3c7dafd0e6b..a14a4613d3e 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -523,8 +523,7 @@ static void viaWaitIdleVBlank( __DRIdrawablePrivate *dPriv,
vmesa->thrashing)
viaSwapOutWork(vmesa);
- driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags,
- & missed_target );
+ driWaitForVBlank( dPriv, & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
(*dri_interface->getUST)( &vmesa->swap_missed_ust );