diff --git a/src/i830_display.c b/src/i830_display.c index 853f4e4..f3b5c50 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 dcbed22..51a17f0 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, "