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_memory.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_memory.c')
-rw-r--r-- | src/i830_memory.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index 990651e1..24cf9575 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -63,10 +63,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ static unsigned long 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); - unsigned long needed, start, end; + long needed, start, end; Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); if (!result || !pool || !size) @@ -94,7 +94,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, } } if (needed > pool->Free.Size) { - unsigned long extra; + long extra; /* See if the pool can be grown. */ if (pI830->StolenOnly && !dryrun) return 0; @@ -107,7 +107,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, return 0; } - if (!dryrun && (extra > pI830->MemoryAperture.Size)) + if (!dryrun && ((long)extra > pI830->MemoryAperture.Size)) return 0; pool->Free.Size += extra; @@ -136,7 +136,7 @@ AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, } static unsigned long -AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size, +AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, long size, unsigned long alignment, int flags) { I830Ptr pI830 = I830PTR(pScrn); @@ -212,7 +212,7 @@ AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size, unsigned long 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); Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); @@ -392,7 +392,7 @@ Bool I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) { I830Ptr pI830 = I830PTR(pScrn); - unsigned long size, alloced; + long size, alloced; Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); int verbosity = dryrun ? 4 : 1; const char *s = dryrun ? "[dryrun] " : ""; @@ -610,9 +610,9 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } } else { - unsigned long lineSize; - unsigned long extra = 0; - unsigned long maxFb = 0; + long lineSize; + long extra = 0; + long maxFb = 0; /* * XXX Need to "free" up any 3D allocations if the DRI ended up @@ -857,7 +857,7 @@ long I830GetExcessMemoryAllocations(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - unsigned long allocated; + long allocated; allocated = pI830->StolenPool.Total.Size + pI830->allocatedMemory; if (allocated > pI830->TotalVideoRam) @@ -1367,7 +1367,7 @@ MakeTiles(ScrnInfoPtr pScrn, I830MemRange *pMem) I830Ptr pI830 = I830PTR(pScrn); int pitch, ntiles, i; static int nextTile = 0; - static int tileGeneration = -1; + static unsigned int tileGeneration = -1; #if 0 /* Hack to "improve" the alignment of the front buffer. |