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_cursor.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_cursor.c')
-rw-r--r-- | src/i830_cursor.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/i830_cursor.c b/src/i830_cursor.c index 70a8d52b..0cfd2292 100644 --- a/src/i830_cursor.c +++ b/src/i830_cursor.c @@ -88,20 +88,20 @@ I830SetPipeCursorBase (xf86CrtcPtr crtc) I830Ptr pI830 = I830PTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int cursor_base = (pipe == 0 ? CURSOR_A_BASE : CURSOR_B_BASE); - I830MemRange *cursor_mem; + i830_memory *cursor_mem; if (pipe >= xf86_config->num_crtc) FatalError("Bad pipe number for cursor base setting\n"); if (pI830->CursorIsARGB) - cursor_mem = &intel_crtc->cursor_mem_argb; + cursor_mem = intel_crtc->cursor_mem_argb; else - cursor_mem = &intel_crtc->cursor_mem; + cursor_mem = intel_crtc->cursor_mem; if (pI830->CursorNeedsPhysical) { - OUTREG(cursor_base, cursor_mem->Physical); + OUTREG(cursor_base, cursor_mem->bus_addr); } else { - OUTREG(cursor_base, cursor_mem->Start); + OUTREG(cursor_base, cursor_mem->offset); } } @@ -281,7 +281,7 @@ I830CRTCLoadCursorImage(xf86CrtcPtr crtc, unsigned char *src) ScrnInfoPtr pScrn = crtc->scrn; I830Ptr pI830 = I830PTR(pScrn); I830CrtcPrivatePtr intel_crtc = crtc->driver_private; - CARD8 *pcurs = (CARD8 *) (pI830->FbBase + intel_crtc->cursor_mem.Start); + CARD8 *pcurs = (CARD8 *) (pI830->FbBase + intel_crtc->cursor_mem->offset); int x, y; DPRINTF(PFX, "I830LoadCursorImage\n"); @@ -372,7 +372,7 @@ static Bool I830UseHWCursorARGB (ScreenPtr pScreen, CursorPtr pCurs) for (i = 0; i < xf86_config->num_crtc; i++) { I830CrtcPrivatePtr intel_crtc = xf86_config->crtc[i]->driver_private; - if (!intel_crtc->cursor_mem_argb.Start) + if (!intel_crtc->cursor_mem_argb->offset) return FALSE; } @@ -389,7 +389,8 @@ static void I830CRTCLoadCursorARGB (xf86CrtcPtr crtc, CursorPtr pCurs) { I830Ptr pI830 = I830PTR(crtc->scrn); I830CrtcPrivatePtr intel_crtc = crtc->driver_private; - CARD32 *dst = (CARD32 *) (pI830->FbBase + intel_crtc->cursor_mem_argb.Start); + CARD32 *dst = (CARD32 *) (pI830->FbBase + + intel_crtc->cursor_mem_argb->offset); CARD32 *image = (CARD32 *)pCurs->bits->argb; int x, y, w, h; |