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

Eric Anholt anholt at kemper.freedesktop.org
Tue Jun 10 11:32:31 PDT 2008


 src/i830.h        |    1 +
 src/i830_driver.c |   16 ++++++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 79f94ee3c4652019395b9c329d94f7779c558571
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jun 10 11:31:22 2008 -0700

    Set up/restore PWRCTXA from enter/leavevt not server start/exit.
    
    This should improve behavior in the presence of VT switching, but also avoids
    a crash on X exit from writing the register after unmapping mmio.

diff --git a/src/i830.h b/src/i830.h
index 62e645a..2a804ab 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -653,6 +653,7 @@ typedef struct _I830Rec {
    uint32_t saveRENCLK_GATE_D2;
    uint32_t saveDSPCLK_GATE_D;
    uint32_t saveRAMCLK_GATE_D;
+   uint32_t savePWRCTXA;
 
    enum last_3d *last_3d;
 
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b28b4de..091b5ca 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2099,6 +2099,9 @@ SaveHWState(ScrnInfoPtr pScrn)
       pI830->saveRAMCLK_GATE_D = INREG(RAMCLK_GATE_D);
    }
 
+   if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
+      pI830->savePWRCTXA = INREG(PWRCTXA);
+
    if (IS_MOBILE(pI830) && !IS_I830(pI830))
       pI830->saveLVDS = INREG(LVDS);
    pI830->savePFIT_CONTROL = INREG(PFIT_CONTROL);
@@ -2165,6 +2168,10 @@ RestoreHWState(ScrnInfoPtr pScrn)
       OUTREG(RENCLK_GATE_D2, pI830->saveRENCLK_GATE_D2);
       OUTREG(RAMCLK_GATE_D, pI830->saveRAMCLK_GATE_D);
    }
+
+   if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
+      OUTREG(PWRCTXA, pI830->savePWRCTXA);
+
    /*
     * Pipe regs
     * To restore the saved state, we first need to program the PLL regs,
@@ -2896,9 +2903,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
        return FALSE;
    }
 
-   if (pI830->power_context)
-       OUTREG(PWRCTXA, pI830->power_context->offset | PWRCTX_EN);
-
    I830UnmapMMIO(pScrn);
 
    i830_fixup_mtrrs(pScrn);
@@ -3367,6 +3371,9 @@ I830EnterVT(int scrnIndex, int flags)
 
    i830_init_clock_gating(pScrn);
 
+   if (pI830->power_context)
+       OUTREG(PWRCTXA, pI830->power_context->offset | PWRCTX_EN);
+
    /* Clear the framebuffer */
    memset(pI830->FbBase + pScrn->fbOffset, 0,
 	  pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
@@ -3522,9 +3529,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
    }
 #endif
 
-   if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
-       OUTREG(PWRCTXA, 0);
-
    if (I830IsPrimary(pScrn)) {
       xf86GARTCloseScreen(scrnIndex);
 


More information about the xorg-commit mailing list