Commit 88714c3b authored by Egbert Eich's avatar Egbert Eich

Change order of SetDisplayDevice(), HWRestore(), UnbindGART() and

RestoreBIOSMemSize() to be exactly opposite to the Save procedure in EnterVT()
(Matthias Hopf, Alan Hourihane).
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.
parent 687298da
...@@ -173,7 +173,7 @@ extern void I830DPRINTF_stub(const char *filename, int line, ...@@ -173,7 +173,7 @@ extern void I830DPRINTF_stub(const char *filename, int line,
#define BEGIN_LP_RING(n) \ #define BEGIN_LP_RING(n) \
unsigned int outring, ringmask; \ unsigned int outring, ringmask; \
volatile unsigned char *virt; \ volatile unsigned char *virt; \
unsigned int needed; \ int needed; \
if ((n) & 1) \ if ((n) & 1) \
ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \ ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \
if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \
...@@ -206,7 +206,7 @@ extern void I830DPRINTF_stub(const char *filename, int line, ...@@ -206,7 +206,7 @@ extern void I830DPRINTF_stub(const char *filename, int line,
#define BEGIN_LP_RING(n) \ #define BEGIN_LP_RING(n) \
unsigned int outring, ringmask; \ unsigned int outring, ringmask; \
volatile unsigned char *virt; \ volatile unsigned char *virt; \
unsigned int needed; \ int needed; \
if ((n) & 1) \ if ((n) & 1) \
ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \ ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \
if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \
......
...@@ -172,7 +172,7 @@ typedef struct _I810Rec { ...@@ -172,7 +172,7 @@ typedef struct _I810Rec {
unsigned long OverlayPhysical; unsigned long OverlayPhysical;
unsigned long OverlayStart; unsigned long OverlayStart;
int colorKey; int colorKey;
int surfaceAllocation[I810_TOTAL_SURFACES]; unsigned int surfaceAllocation[I810_TOTAL_SURFACES];
int numSurfaces; int numSurfaces;
DGAModePtr DGAModes; DGAModePtr DGAModes;
...@@ -295,9 +295,10 @@ extern int I810WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis); ...@@ -295,9 +295,10 @@ extern int I810WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis);
extern void I810Sync(ScrnInfoPtr pScrn); extern void I810Sync(ScrnInfoPtr pScrn);
extern unsigned long I810LocalToPhysical(ScrnInfoPtr pScrn, extern unsigned long I810LocalToPhysical(ScrnInfoPtr pScrn,
unsigned long local); unsigned long local);
extern int I810AllocLow(I810MemRange * result, I810MemRange * pool, int size); extern int I810AllocLow(I810MemRange * result, I810MemRange * pool,
int size);
extern int I810AllocHigh(I810MemRange * result, I810MemRange * pool, extern int I810AllocHigh(I810MemRange * result, I810MemRange * pool,
int size); int size);
extern Bool I810AllocateFront(ScrnInfoPtr pScrn); extern Bool I810AllocateFront(ScrnInfoPtr pScrn);
extern int I810AllocateGARTMemory(ScrnInfoPtr pScrn); extern int I810AllocateGARTMemory(ScrnInfoPtr pScrn);
......
...@@ -290,7 +290,7 @@ I810DRIScreenInit(ScreenPtr pScreen) ...@@ -290,7 +290,7 @@ I810DRIScreenInit(ScreenPtr pScreen)
unsigned long dcacheHandle; unsigned long dcacheHandle;
int sysmem_size = 0; int sysmem_size = 0;
int back_size = 0; int back_size = 0;
int pitch_idx = 0; unsigned int pitch_idx = 0;
int bufs; int bufs;
int width = pScrn->displayWidth * pI810->cpp; int width = pScrn->displayWidth * pI810->cpp;
int i; int i;
......
...@@ -1127,14 +1127,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) ...@@ -1127,14 +1127,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr); xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr);
xf86SetOperatingState(resVgaMem, pI810->pEnt->index, ResDisableOpr); xf86SetOperatingState(resVgaMem, pI810->pEnt->index, ResDisableOpr);
pI810->LpRing = xalloc(sizeof(I810RingBuffer));
if (!pI810->LpRing) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Could not allocate lpring data structure.\n");
I810FreeRec(pScrn);
return FALSE;
}
return TRUE; return TRUE;
} }
...@@ -1162,7 +1154,7 @@ static Bool ...@@ -1162,7 +1154,7 @@ static Bool
I810MapMem(ScrnInfoPtr pScrn) I810MapMem(ScrnInfoPtr pScrn)
{ {
I810Ptr pI810 = I810PTR(pScrn); I810Ptr pI810 = I810PTR(pScrn);
unsigned i; long i;
for (i = 2; i < pI810->FbMapSize; i <<= 1) ; for (i = 2; i < pI810->FbMapSize; i <<= 1) ;
pI810->FbMapSize = i; pI810->FbMapSize = i;
...@@ -2077,6 +2069,13 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ...@@ -2077,6 +2069,13 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pI810 = I810PTR(pScrn); pI810 = I810PTR(pScrn);
hwp = VGAHWPTR(pScrn); hwp = VGAHWPTR(pScrn);
pI810->LpRing = xcalloc(sizeof(I810RingBuffer),1);
if (!pI810->LpRing) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Could not allocate lpring data structure.\n");
return FALSE;
}
miClearVisualTypes(); miClearVisualTypes();
/* Re-implemented Direct Color support, -jens */ /* Re-implemented Direct Color support, -jens */
......
...@@ -55,7 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ...@@ -55,7 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int int
I810AllocLow(I810MemRange * result, I810MemRange * pool, int size) I810AllocLow(I810MemRange * result, I810MemRange * pool, int size)
{ {
if (size > pool->Size) if (size > (long)pool->Size)
return 0; return 0;
pool->Size -= size; pool->Size -= size;
...@@ -69,7 +69,7 @@ I810AllocLow(I810MemRange * result, I810MemRange * pool, int size) ...@@ -69,7 +69,7 @@ I810AllocLow(I810MemRange * result, I810MemRange * pool, int size)
int int
I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size) I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size)
{ {
if (size > pool->Size) if (size > (long)pool->Size)
return 0; return 0;
pool->Size -= size; pool->Size -= size;
......
...@@ -459,11 +459,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ...@@ -459,11 +459,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define I830_HEAD_MASK 0x001FFFFC #define I830_HEAD_MASK 0x001FFFFC
#define RING_START 0x08 #define RING_START 0x08
#define START_ADDR 0x00FFFFF8 #define START_ADDR 0x03FFFFF8
#define I830_RING_START_MASK 0xFFFFF000 #define I830_RING_START_MASK 0xFFFFF000
#define RING_LEN 0x0C #define RING_LEN 0x0C
#define RING_NR_PAGES 0x000FF000 #define RING_NR_PAGES 0x001FF000
#define I830_RING_NR_PAGES 0x001FF000 #define I830_RING_NR_PAGES 0x001FF000
#define RING_REPORT_MASK 0x00000006 #define RING_REPORT_MASK 0x00000006
#define RING_REPORT_64K 0x00000002 #define RING_REPORT_64K 0x00000002
......
...@@ -180,17 +180,17 @@ typedef struct _I830Rec { ...@@ -180,17 +180,17 @@ typedef struct _I830Rec {
int CacheLines; int CacheLines;
/* These are set in PreInit and never changed. */ /* These are set in PreInit and never changed. */
unsigned long FbMapSize; long FbMapSize;
unsigned long TotalVideoRam; long TotalVideoRam;
I830MemRange StolenMemory; /* pre-allocated memory */ I830MemRange StolenMemory; /* pre-allocated memory */
unsigned long BIOSMemorySize; /* min stolen pool size */ long BIOSMemorySize; /* min stolen pool size */
int BIOSMemSizeLoc; int BIOSMemSizeLoc;
/* These change according to what has been allocated. */ /* These change according to what has been allocated. */
long FreeMemory; long FreeMemory;
I830MemRange MemoryAperture; I830MemRange MemoryAperture;
I830MemPool StolenPool; I830MemPool StolenPool;
unsigned long allocatedMemory; long allocatedMemory;
/* Regions allocated either from the above pools, or from agpgart. */ /* Regions allocated either from the above pools, or from agpgart. */
/* for single and dual head configurations */ /* for single and dual head configurations */
...@@ -348,7 +348,7 @@ typedef struct _I830Rec { ...@@ -348,7 +348,7 @@ typedef struct _I830Rec {
int xoffset; int xoffset;
int yoffset; int yoffset;
int SaveGeneration; unsigned int SaveGeneration;
Bool vbeRestoreWorkaround; Bool vbeRestoreWorkaround;
Bool displayInfo; Bool displayInfo;
Bool devicePresence; Bool devicePresence;
...@@ -415,7 +415,7 @@ extern Bool I830FixupOffsets(ScrnInfoPtr pScrn); ...@@ -415,7 +415,7 @@ extern Bool I830FixupOffsets(ScrnInfoPtr pScrn);
extern Bool I830BindGARTMemory(ScrnInfoPtr pScrn); extern Bool I830BindGARTMemory(ScrnInfoPtr pScrn);
extern Bool I830UnbindGARTMemory(ScrnInfoPtr pScrn); extern Bool I830UnbindGARTMemory(ScrnInfoPtr pScrn);
extern unsigned long I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, extern unsigned long I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result,
I830MemPool *pool, unsigned long size, I830MemPool *pool, long size,
unsigned long alignment, int flags); unsigned long alignment, int flags);
extern void I830PrintAllRegisters(I830RegPtr i830Reg); extern void I830PrintAllRegisters(I830RegPtr i830Reg);
......
...@@ -1018,7 +1018,7 @@ static Bool ...@@ -1018,7 +1018,7 @@ static Bool
I830MapMem(ScrnInfoPtr pScrn) I830MapMem(ScrnInfoPtr pScrn)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
unsigned i; long i;
for (i = 2; i < pI830->FbMapSize; i <<= 1) ; for (i = 2; i < pI830->FbMapSize; i <<= 1) ;
pI830->FbMapSize = i; pI830->FbMapSize = i;
...@@ -2898,7 +2898,7 @@ SetRingRegs(ScrnInfoPtr pScrn) ...@@ -2898,7 +2898,7 @@ SetRingRegs(ScrnInfoPtr pScrn)
OUTREG(LP_RING + RING_TAIL, 0); OUTREG(LP_RING + RING_TAIL, 0);
OUTREG(LP_RING + RING_HEAD, 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) { pI830->LpRing->mem.Start) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"I830SetRingRegs: Ring buffer start (%lx) violates its " "I830SetRingRegs: Ring buffer start (%lx) violates its "
...@@ -3441,7 +3441,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) ...@@ -3441,7 +3441,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1);
temp = INREG(stridereg); 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, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe),
(int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth);
...@@ -3459,7 +3459,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) ...@@ -3459,7 +3459,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
sizereg = pI830->pipe ? DSPASIZE : DSPBSIZE; sizereg = pI830->pipe ? DSPASIZE : DSPBSIZE;
temp = INREG(stridereg); 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, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe),
(int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth);
...@@ -3478,7 +3478,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) ...@@ -3478,7 +3478,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2);
temp = INREG(stridereg); 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, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe),
(int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth);
...@@ -3494,7 +3494,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) ...@@ -3494,7 +3494,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
sizereg = !pI830->pipe ? DSPASIZE : DSPBSIZE; sizereg = !pI830->pipe ? DSPASIZE : DSPBSIZE;
temp = INREG(stridereg); 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, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe),
(int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth);
...@@ -3515,7 +3515,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) ...@@ -3515,7 +3515,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
continue; continue;
temp = INREG(stridereg); temp = INREG(stridereg);
if (temp / pI830->cpp != pScrn->displayWidth) { if (temp / pI830->cpp != (CARD32)pScrn->displayWidth) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i), "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i),
(int)(temp / pI830->cpp), pScrn->displayWidth); (int)(temp / pI830->cpp), pScrn->displayWidth);
...@@ -4354,6 +4354,13 @@ I830BIOSLeaveVT(int scrnIndex, int flags) ...@@ -4354,6 +4354,13 @@ I830BIOSLeaveVT(int scrnIndex, int flags)
SaveHWOperatingState(pScrn); SaveHWOperatingState(pScrn);
#endif #endif
ResetState(pScrn, TRUE);
RestoreHWState(pScrn);
RestoreBIOSMemSize(pScrn);
if (IsPrimary(pScrn))
I830UnbindGARTMemory(pScrn);
if (pI830->AccelInfoRec)
pI830->AccelInfoRec->NeedToSync = FALSE;
if (IsPrimary(pScrn)) { if (IsPrimary(pScrn)) {
if (!SetDisplayDevices(pScrn, pI830->savedDevices)) { if (!SetDisplayDevices(pScrn, pI830->savedDevices)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
...@@ -4364,14 +4371,6 @@ I830BIOSLeaveVT(int scrnIndex, int flags) ...@@ -4364,14 +4371,6 @@ I830BIOSLeaveVT(int scrnIndex, int flags)
"Successfully set original devices\n"); "Successfully set original devices\n");
} }
} }
ResetState(pScrn, TRUE);
RestoreHWState(pScrn);
RestoreBIOSMemSize(pScrn);
if (IsPrimary(pScrn))
I830UnbindGARTMemory(pScrn);
if (pI830->AccelInfoRec)
pI830->AccelInfoRec->NeedToSync = FALSE;
} }
/* /*
...@@ -4506,7 +4505,8 @@ I830BIOSSaveScreen(ScreenPtr pScreen, int mode) ...@@ -4506,7 +4505,8 @@ I830BIOSSaveScreen(ScreenPtr pScreen, int mode)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
Bool on = xf86IsUnblank(mode); 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)); DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on));
......
...@@ -63,10 +63,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ...@@ -63,10 +63,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
static unsigned long static unsigned long
AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
unsigned long size, unsigned long alignment, int flags) long size, unsigned long alignment, int flags)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
unsigned long needed, start, end; long needed, start, end;
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
if (!result || !pool || !size) if (!result || !pool || !size)
...@@ -94,7 +94,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, ...@@ -94,7 +94,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
} }
} }
if (needed > pool->Free.Size) { if (needed > pool->Free.Size) {
unsigned long extra; long extra;
/* See if the pool can be grown. */ /* See if the pool can be grown. */
if (pI830->StolenOnly && !dryrun) if (pI830->StolenOnly && !dryrun)
return 0; return 0;
...@@ -107,7 +107,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, ...@@ -107,7 +107,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
return 0; return 0;
} }
if (!dryrun && (extra > pI830->MemoryAperture.Size)) if (!dryrun && ((long)extra > pI830->MemoryAperture.Size))
return 0; return 0;
pool->Free.Size += extra; pool->Free.Size += extra;
...@@ -136,7 +136,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, ...@@ -136,7 +136,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
} }
static unsigned long static unsigned long
AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size, AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, long size,
unsigned long alignment, int flags) unsigned long alignment, int flags)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
...@@ -212,7 +212,7 @@ AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size, ...@@ -212,7 +212,7 @@ AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size,
unsigned long unsigned long
I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool,
unsigned long size, unsigned long alignment, int flags) long size, unsigned long alignment, int flags)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
...@@ -392,7 +392,7 @@ Bool ...@@ -392,7 +392,7 @@ Bool
I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
unsigned long size, alloced; long size, alloced;
Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0);
int verbosity = dryrun ? 4 : 1; int verbosity = dryrun ? 4 : 1;
const char *s = dryrun ? "[dryrun] " : ""; const char *s = dryrun ? "[dryrun] " : "";
...@@ -610,9 +610,9 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) ...@@ -610,9 +610,9 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags)
return FALSE; return FALSE;
} }
} else { } else {
unsigned long lineSize; long lineSize;
unsigned long extra = 0; long extra = 0;
unsigned long maxFb = 0; long maxFb = 0;
/* /*
* XXX Need to "free" up any 3D allocations if the DRI ended up * XXX Need to "free" up any 3D allocations if the DRI ended up
...@@ -857,7 +857,7 @@ long ...@@ -857,7 +857,7 @@ long
I830GetExcessMemoryAllocations(ScrnInfoPtr pScrn) I830GetExcessMemoryAllocations(ScrnInfoPtr pScrn)
{ {
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
unsigned long allocated; long allocated;
allocated = pI830->StolenPool.Total.Size + pI830->allocatedMemory; allocated = pI830->StolenPool.Total.Size + pI830->allocatedMemory;
if (allocated > pI830->TotalVideoRam) if (allocated > pI830->TotalVideoRam)
...@@ -1367,7 +1367,7 @@ MakeTiles(ScrnInfoPtr pScrn, I830MemRange *pMem) ...@@ -1367,7 +1367,7 @@ MakeTiles(ScrnInfoPtr pScrn, I830MemRange *pMem)
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
int pitch, ntiles, i; int pitch, ntiles, i;
static int nextTile = 0; static int nextTile = 0;
static int tileGeneration = -1; static unsigned int tileGeneration = -1;
#if 0 #if 0
/* Hack to "improve" the alignment of the front buffer. /* Hack to "improve" the alignment of the front buffer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment