From 6cebfe257f7ddad855ee743e4eb899bd6fac7f46 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 11 Jul 2008 19:32:06 -0400 Subject: Switch EXA path back to static cursor allocation pre-AVIVO cards have address limits for the cursor offset --- src/radeon_exa.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/radeon_exa.c') diff --git a/src/radeon_exa.c b/src/radeon_exa.c index a1b93b52..39453000 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -386,6 +386,7 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; RADEONInfoPtr info = RADEONPTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int cpp = info->CurrentLayout.pixel_bytes; int screen_size; int byteStride = pScrn->displayWidth * cpp; @@ -413,6 +414,27 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocating from a screen of %ld kb\n", info->accel_state->exa->memorySize / 1024); + /* Reserve static area for hardware cursor */ + if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { + int cursor_size = 64 * 4 * 64; + int align = IS_AVIVO_VARIANT ? 4096 : 256; + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; + + radeon_crtc->cursor_offset = + RADEON_ALIGN(info->accel_state->exa->offScreenBase, align); + info->accel_state->exa->offScreenBase = radeon_crtc->cursor_offset + cursor_size; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Will use %d kb for hardware cursor %d at offset 0x%08x\n", + (cursor_size * xf86_config->num_crtc) / 1024, + c, + (unsigned int)radeon_crtc->cursor_offset); + } + } #if defined(XF86DRI) if (info->directRenderingEnabled) { -- cgit v1.2.3