xf86-video-intel: src/i830_dri.c src/i830.h

Eric Anholt anholt at kemper.freedesktop.org
Fri May 4 00:00:06 EEST 2007


 src/i830.h     |    1 +
 src/i830_dri.c |   16 +++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
diff-tree 3b769af53e0ef6ef9b56afd679446c73a0e63ea5 (from 775fc125aa7ecd0f054959ef210be2df4dc54345)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu May 3 13:44:12 2007 -0700

    Disable vblank interrupts when no DRI clients are running.

diff --git a/src/i830.h b/src/i830.h
index 8034302..7b0ab15 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -326,6 +326,7 @@ typedef struct _I830Rec {
    unsigned int third_tiled;
    unsigned int depth_tiled;
 
+   Bool want_vblank_interrupts;
 #ifdef DAMAGE
    DamagePtr pDamage;
    RegionRec driRegion;
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 2203c9e..9498661 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 p
     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)



More information about the xorg-commit mailing list