diff options
author | Alex Deucher <alex@samba.(none)> | 2007-11-29 00:46:23 -0500 |
---|---|---|
committer | Alex Deucher <alex@samba.(none)> | 2007-11-29 00:46:23 -0500 |
commit | 9963b0fe01feb6dd0cb555b874a48f6fa3b255cb (patch) | |
tree | 3aca32c1676b7609c56014e245c3a5825df5784c | |
parent | 6c56e3d7655b17e93e8823aefe34b05291104695 (diff) |
RADEON: fix cursor offset on avivo chips
-rw-r--r-- | src/radeon.h | 6 | ||||
-rw-r--r-- | src/radeon_cursor.c | 13 | ||||
-rw-r--r-- | src/radeon_reg.h | 1 |
3 files changed, 5 insertions, 15 deletions
diff --git a/src/radeon.h b/src/radeon.h index ab6c0b31..ed99be71 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -945,12 +945,6 @@ typedef struct { unsigned long FbFreeStart, FbFreeSize; unsigned char* BIOSCopy; - int cursor_width; - int cursor_height; - int cursor_format; - int cursor_x; - int cursor_y; - Rotation rotation; void (*PointerMoved)(int, int, int); CreateScreenResourcesProcPtr CreateScreenResources; diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index a2cec557..282ffd83 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -102,7 +102,7 @@ avivo_setup_cursor(xf86CrtcPtr crtc, Bool enable) OUTREG(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, info->fbLocation + info->cursor_offset); OUTREG(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset, - ((info->cursor_width -1) << 16) | (info->cursor_height-1)); + ((CURSOR_WIDTH - 1) << 16) | (CURSOR_HEIGHT - 1)); OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset, AVIVO_D1CURSOR_EN | (AVIVO_D1CURSOR_MODE_24BPP << AVIVO_D1CURSOR_MODE_SHIFT)); } @@ -192,17 +192,12 @@ radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) y *= 2; if (IS_AVIVO_VARIANT) { - if (x < 0) - x = 0; - if (y < 0) - y = 0; - /* avivo cursor spans the full fb width */ x += crtc->x; y += crtc->y; - OUTREG(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, (x << 16) | y); - radeon_crtc->cursor_x = x; - radeon_crtc->cursor_y = y; + OUTREG(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset, ((xorigin ? 0 : x) << 16) + | (yorigin ? 0 : y)); + OUTREG(AVIVO_D1CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin); } else { if (crtc_id == 0) { OUTREG(RADEON_CUR_HORZ_VERT_OFF, (RADEON_CUR_LOCK diff --git a/src/radeon_reg.h b/src/radeon_reg.h index d3c4e52a..1860fa44 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -3400,6 +3400,7 @@ #define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 #define AVIVO_D1CUR_SIZE 0x6410 #define AVIVO_D1CUR_POSITION 0x6414 +#define AVIVO_D1CUR_HOT_SPOT 0x6418 #define AVIVO_D1MODE_VIEWPORT_START 0x6580 #define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 |