diff --git a/src/i810_reg.h b/src/i810_reg.h index 860d1db..aabf5b6 100644 --- a/src/i810_reg.h +++ b/src/i810_reg.h @@ -2100,6 +2100,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DSPARB 0x70030 +#define DSPARB_CSTART_SHIFT 7 +#define DSPARB_BSTART_SHIFT 0 #define DSPFW1 0x70034 #define DSPFW2 0x70038 #define DSPFW3 0x7003c diff --git a/src/i830_driver.c b/src/i830_driver.c index 8d993ba..5660e6b 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1898,9 +1898,26 @@ static void SetHWOperatingState(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + DPRINTF(PFX, "SetHWOperatingState\n"); + /* + * Disable outputs & pipes since some of these regs can only be updated + * when they're off. + */ + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + output->funcs->dpms(output, DPMSModeOff); + } + i830WaitForVblank(pScrn); + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + crtc->funcs->dpms(crtc, DPMSModeOff); + } + i830WaitForVblank(pScrn); + /* Disable clock gating reported to work incorrectly according to the specs. */ if (IS_IGD_GM(pI830)) { @@ -1921,6 +1938,13 @@ SetHWOperatingState(ScrnInfoPtr pScrn) i830_start_ring(pScrn); if (!pI830->SWCursor) I830InitHWCursor(pScrn); + + /* + * Fixup FIFO defaults: + * we don't use plane C at all so we can allocate the 96 FIFO RAM + * entries equally between planes A and B. + */ + OUTREG(DSPARB, (95 << DSPARB_CSTART_SHIFT) | (48 << DSPARB_BSTART_SHIFT)); } enum pipe { @@ -2443,6 +2467,15 @@ I830BlockHandler(int i, if (pScrn->vtSema && !pI830->noAccel && !pI830->directRenderingEnabled) I830EmitFlush(pScrn); + if (INREG(PIPEASTAT) & FIFO_UNDERRUN) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe A!\n"); + OUTREG(PIPEASTAT, INREG(PIPEASTAT) | FIFO_UNDERRUN); + } + if (INREG(PIPEBSTAT) & FIFO_UNDERRUN) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "underrun on pipe B!\n"); + OUTREG(PIPEBSTAT, INREG(PIPEBSTAT) | FIFO_UNDERRUN); + } + I830VideoBlockHandler(i, blockData, pTimeout, pReadmask); }