summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-07-11 19:32:06 -0400
committerAlex Deucher <alexdeucher@gmail.com>2008-08-25 10:06:07 -0400
commit6cebfe257f7ddad855ee743e4eb899bd6fac7f46 (patch)
tree876e6d2560a1a116d74944379ad3cb810bc952db /src/radeon_exa.c
parent4dff54a3c8d7c9f2d6ec50354ff0b92f1b7fcbdf (diff)
Switch EXA path back to static cursor allocation
pre-AVIVO cards have address limits for the cursor offset
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c22
1 files changed, 22 insertions, 0 deletions
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) {