diff options
author | Eric Anholt <eric@anholt.net> | 2007-05-03 13:44:12 -0700 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-05-03 13:55:37 -0700 |
commit | b930bb9d6da8c24dbe0949afb7bb2aa4bcb24687 (patch) | |
tree | e2e4d990a982e44a232add4ffa72e72c695ae78b /src/i830_dri.c | |
parent | 775fc125aa7ecd0f054959ef210be2df4dc54345 (diff) |
Disable vblank interrupts when no DRI clients are running.
(cherry picked from commit 6621dd71ada839f4c1742e9e5b272e924cee21d9)
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r-- | src/i830_dri.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index 2203c9e5..9498661f 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -590,13 +590,13 @@ I830DRIScreenInit(ScreenPtr pScreen) } pDRIInfo->TransitionTo2d = I830DRITransitionTo2d; + pDRIInfo->TransitionTo3d = I830DRITransitionTo3d; #if DRIINFO_MAJOR_VERSION > 5 || \ (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 1) if (!pDRIInfo->ClipNotify) #endif { - pDRIInfo->TransitionTo3d = I830DRITransitionTo3d; pDRIInfo->TransitionSingleToMulti3D = I830DRITransitionSingleToMulti3d; pDRIInfo->TransitionMultiToSingle3D = I830DRITransitionMultiToSingle3d; } @@ -1543,16 +1543,24 @@ I830DRITransitionTo3d(ScreenPtr pScreen) I830Ptr pI830 = I830PTR(pScrn); I830DRISetPfMask(pScreen, pI830->allowPageFlip ? 0x3 : 0); + + pI830->want_vblank_interrupts = TRUE; + I830DRISetVBlankInterrupt(pScrn, TRUE); } static void I830DRITransitionTo2d(ScreenPtr pScreen) { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen); I830DRISetPfMask(pScreen, 0); sPriv->pf_enabled = 0; + + pI830->want_vblank_interrupts = FALSE; + I830DRISetVBlankInterrupt(pScrn, FALSE); } #if DRI_SUPPORTS_CLIP_NOTIFY @@ -1684,6 +1692,12 @@ I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); drmI830VBlankPipe pipe; + /* If we have no 3d running, then don't bother enabling the vblank + * interrupt. + */ + if (!pI830->want_vblank_interrupts) + on = FALSE; + if (pI830->directRenderingEnabled && pI830->drmMinor >= 5) { if (on) { if (xf86_config->num_crtc > 1 && xf86_config->crtc[1]->enabled) |