diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 09:35:23 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-15 09:35:23 +0000 |
commit | 235ff9f8c20d93b22b11cc378f7e53f20a058038 (patch) | |
tree | e9ae8dbeaba5b30c57fd04b60a6c8475cc5e1a98 /src/i830_driver.c | |
parent | 9e8e19c6fde15fe5b9bb7532316dedeeca54b8d9 (diff) |
Bug #1944 (https://bugs.freedesktop.org/show_bug.cgi?id=1944)XORG-6_8_1_901
attachment #1403 (https://bugs.freedesktop.org/attachment.cgi?id=1403):
Various I8xx driver fixes, including:
- Fixed server crash on reset when a structure allocated in
PreInit() was freed on CloseScreen().
- Fixed ring buffer lock ups that happened because the structure
that contained ringbuffer data was not zeroed after allocation.
- Fixed numerous warnings due to signed unsigned comparisons.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r-- | src/i830_driver.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index c0fed71f..c6d6c583 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -594,6 +594,7 @@ SetDisplayDevices(ScrnInfoPtr pScrn, int devices) I830Ptr pI830 = I830PTR(pScrn); vbeInfoPtr pVbe = pI830->pVbe; CARD32 temp; + #ifdef I915G_WORKAROUND int getmode; int mode; @@ -1018,7 +1019,7 @@ static Bool I830MapMem(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - unsigned i; + long i; for (i = 2; i < pI830->FbMapSize; i <<= 1) ; pI830->FbMapSize = i; @@ -2898,7 +2899,7 @@ SetRingRegs(ScrnInfoPtr pScrn) OUTREG(LP_RING + RING_TAIL, 0); OUTREG(LP_RING + RING_HEAD, 0); - if ((pI830->LpRing->mem.Start & I830_RING_START_MASK) != + if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) != pI830->LpRing->mem.Start) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830SetRingRegs: Ring buffer start (%lx) violates its " @@ -3441,7 +3442,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); temp = INREG(stridereg); - if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) { + if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); @@ -3459,7 +3460,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) sizereg = pI830->pipe ? DSPASIZE : DSPBSIZE; temp = INREG(stridereg); - if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) { + if (temp / pI8302->cpp != (CARD32)(pI830->entityPrivate->pScrn_2->displayWidth)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); @@ -3478,7 +3479,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); temp = INREG(stridereg); - if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) { + if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); @@ -3494,7 +3495,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) sizereg = !pI830->pipe ? DSPASIZE : DSPBSIZE; temp = INREG(stridereg); - if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) { + if (temp / pI8302->cpp != ((CARD32)pI830->entityPrivate->pScrn_2->displayWidth)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); @@ -3515,7 +3516,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) continue; temp = INREG(stridereg); - if (temp / pI830->cpp != pScrn->displayWidth) { + if (temp / pI830->cpp != (CARD32)pScrn->displayWidth) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i), (int)(temp / pI830->cpp), pScrn->displayWidth); @@ -4354,6 +4355,9 @@ I830BIOSLeaveVT(int scrnIndex, int flags) SaveHWOperatingState(pScrn); #endif + ResetState(pScrn, TRUE); + RestoreHWState(pScrn); + if (IsPrimary(pScrn)) { if (!SetDisplayDevices(pScrn, pI830->savedDevices)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -4365,8 +4369,6 @@ I830BIOSLeaveVT(int scrnIndex, int flags) } } - ResetState(pScrn, TRUE); - RestoreHWState(pScrn); RestoreBIOSMemSize(pScrn); if (IsPrimary(pScrn)) I830UnbindGARTMemory(pScrn); @@ -4506,7 +4508,8 @@ I830BIOSSaveScreen(ScreenPtr pScreen, int mode) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); Bool on = xf86IsUnblank(mode); - CARD32 temp, ctrl, base, i; + CARD32 temp, ctrl, base; + int i; DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on)); |