diff options
author | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-07-07 10:15:32 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-07-07 10:15:32 -0700 |
commit | bf831117b4659cc4f2774098dee938505f780a9b (patch) | |
tree | 627823ca5638f14cc19bc6b2f815b1bcae1a6c40 /src | |
parent | b426866fe1be2ad3861559beff69186379a6afad (diff) |
FBC fixes:
- allow FBC and Tiling to be forced off if configured to do so
- only touch FBC registers if pI830->fb_compression is true
Diffstat (limited to 'src')
-rw-r--r-- | src/i830_display.c | 5 | ||||
-rw-r--r-- | src/i830_driver.c | 40 |
2 files changed, 30 insertions, 15 deletions
diff --git a/src/i830_display.c b/src/i830_display.c index 853f4e40..f3b5c50a 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -747,7 +747,7 @@ i830_disable_fb_compression(xf86CrtcPtr crtc) ScrnInfoPtr pScrn = crtc->scrn; I830Ptr pI830 = I830PTR(pScrn); uint32_t fbc_ctl; - char pipe = (INREG(FBC_CONTROL2) & 1) ? 'b' : 'a';; + char pipe = (INREG(FBC_CONTROL2) & 1) ? 'b' : 'a'; /* Disable compression */ fbc_ctl = INREG(FBC_CONTROL); @@ -764,7 +764,8 @@ static void i830_crtc_prepare (xf86CrtcPtr crtc) { /* Temporarily turn off FB compression during modeset */ - i830_disable_fb_compression(crtc); + if (i830_use_fb_compression(crtc)) + i830_disable_fb_compression(crtc); crtc->funcs->dpms (crtc, DPMSModeOff); } diff --git a/src/i830_driver.c b/src/i830_driver.c index dcbed227..51a17f04 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1753,10 +1753,12 @@ SaveHWState(ScrnInfoPtr pScrn) vgaRegPtr vgaReg = &hwp->SavedReg; int i; - pI830->saveFBC_CFB_BASE = INREG(FBC_CFB_BASE); - pI830->saveFBC_LL_BASE = INREG(FBC_LL_BASE); - pI830->saveFBC_CONTROL2 = INREG(FBC_CONTROL2); - pI830->saveFBC_CONTROL = INREG(FBC_CONTROL); + if (pI830->fb_compression) { + pI830->saveFBC_CFB_BASE = INREG(FBC_CFB_BASE); + pI830->saveFBC_LL_BASE = INREG(FBC_LL_BASE); + pI830->saveFBC_CONTROL2 = INREG(FBC_CONTROL2); + pI830->saveFBC_CONTROL = INREG(FBC_CONTROL); + } /* Save video mode information for native mode-setting. */ pI830->saveDSPACNTR = INREG(DSPACNTR); @@ -1982,10 +1984,12 @@ RestoreHWState(ScrnInfoPtr pScrn) OUTREG(SWF31, pI830->saveSWF[15]); OUTREG(SWF32, pI830->saveSWF[16]); - OUTREG(FBC_CFB_BASE, pI830->saveFBC_CFB_BASE); - OUTREG(FBC_LL_BASE, pI830->saveFBC_LL_BASE); - OUTREG(FBC_CONTROL2, pI830->saveFBC_CONTROL2); - OUTREG(FBC_CONTROL, pI830->saveFBC_CONTROL); + if (pI830->fb_compression) { + OUTREG(FBC_CFB_BASE, pI830->saveFBC_CFB_BASE); + OUTREG(FBC_LL_BASE, pI830->saveFBC_LL_BASE); + OUTREG(FBC_CONTROL2, pI830->saveFBC_CONTROL2); + OUTREG(FBC_CONTROL, pI830->saveFBC_CONTROL); + } vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS); vgaHWLock(hwp); @@ -2320,14 +2324,19 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pI830->CacheLines = -1; } - /* Enable tiling by default where supported or if the user forced it on */ + /* Enable tiling by default where supported */ if (i830_tiling_supported(pI830)) pI830->tiling = TRUE; else pI830->tiling = FALSE; - if (xf86ReturnOptValBool(pI830->Options, OPTION_TILING, FALSE)) - pI830->tiling = TRUE; + /* Allow user override if they set a value */ + if (xf86IsOptionSet(pI830->Options, OPTION_TILING)) { + if (xf86ReturnOptValBool(pI830->Options, OPTION_TILING, FALSE)) + pI830->tiling = TRUE; + else + pI830->tiling = FALSE; + } /* Enable FB compression if possible */ if (i830_fb_compression_supported(pI830)) @@ -2335,8 +2344,13 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) else pI830->fb_compression = FALSE; - if (xf86ReturnOptValBool(pI830->Options, OPTION_FBC, FALSE)) - pI830->fb_compression = TRUE; + /* Again, allow user override if set */ + if (xf86IsOptionSet(pI830->Options, OPTION_FBC)) { + if (xf86ReturnOptValBool(pI830->Options, OPTION_FBC, FALSE)) + pI830->fb_compression = TRUE; + else + pI830->fb_compression = FALSE; + } if (pI830->fb_compression) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Framebuffer compression enabled, " |