diff options
author | Eric Anholt <eric@anholt.net> | 2007-02-22 10:41:09 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-02-23 12:50:49 -0800 |
commit | d3ac440e127c8a7716062852cd3b5e7943e289e4 (patch) | |
tree | 10b80c3905e06ecd885957ea2f333d9d8d705c56 /src/i830_accel.c | |
parent | a61a6b1db610a07060d0dcca54b66a4b2b3686cc (diff) |
Rework the video memory allocation.
The previous allocator worked in multiple passes, with (at least) one of
setting up allocations, another to attempt to adjust those for tiling, and
then a pass to set up the offsets and fix them in memory.
The new allocator is simpler, allocating memory immediately if possible,
setting up tiling up front, and choosing offsets immediately. AGP memory
is only allocated to back actual memory used, saving some memory that would
have been allocated for padding previous. It will also allow dynamic freeing
and reallocation of memory, which will be useful for framebuffer resizing.
Diffstat (limited to 'src/i830_accel.c')
-rw-r--r-- | src/i830_accel.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/i830_accel.c b/src/i830_accel.c index db3168a8..49a9c134 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -117,7 +117,7 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis) ring->space = ring->head - (ring->tail + 8); if (ring->space < 0) - ring->space += ring->mem.Size; + ring->space += ring->mem->size; iters++; now = GetTimeInMillis(); @@ -195,9 +195,9 @@ I830Sync(ScrnInfoPtr pScrn) ADVANCE_LP_RING(); } - I830WaitLpRing(pScrn, pI830->LpRing->mem.Size - 8, 0); + I830WaitLpRing(pScrn, pI830->LpRing->mem->size - 8, 0); - pI830->LpRing->space = pI830->LpRing->mem.Size - 8; + pI830->LpRing->space = pI830->LpRing->mem->size - 8; pI830->nextColorExpandBuf = 0; } @@ -226,10 +226,10 @@ I830SelectBuffer(ScrnInfoPtr pScrn, int buffer) switch (buffer) { #ifdef XF86DRI case I830_SELECT_BACK: - pI830->bufferOffset = pI830->BackBuffer.Start; + pI830->bufferOffset = pI830->back_buffer->offset; break; case I830_SELECT_DEPTH: - pI830->bufferOffset = pI830->DepthBuffer.Start; + pI830->bufferOffset = pI830->depth_buffer->offset; break; #endif default: @@ -252,7 +252,7 @@ I830RefreshRing(ScrnInfoPtr pScrn) pI830->LpRing->tail = INREG(LP_RING + RING_TAIL); pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8); if (pI830->LpRing->space < 0) - pI830->LpRing->space += pI830->LpRing->mem.Size; + pI830->LpRing->space += pI830->LpRing->mem->size; i830MarkSync(pScrn); } |