summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-04-29 01:55:10 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-05-08 12:08:46 -0400
commitfbb04716e4c28347c9e627f3cc78b4420e9abfa0 (patch)
tree8328101b2f5a0cd597819dd9ee9eacf5531e482c
parent666b0ff9f7fd216f7c31315b284c4bf389a51007 (diff)
AVIVO: better fix for cursor flickering/corruption issues
Should prevent ghost cursor from being left on screen.
-rw-r--r--src/radeon_cursor.c46
-rw-r--r--src/radeon_probe.h1
2 files changed, 28 insertions, 19 deletions
diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index ba2d6aec..96df1d73 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -138,25 +138,9 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc)
unsigned char *RADEONMMIO = info->MMIO;
if (IS_AVIVO_VARIANT) {
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
-
- /* both cursors should be enabled when dualhead is active
- * or you may get corruption bands
- */
- if (pRADEONEnt->Controller[0]->enabled &&
- pRADEONEnt->Controller[1]->enabled) {
- avivo_lock_cursor(pRADEONEnt->pCrtc[0], TRUE);
- avivo_setup_cursor(pRADEONEnt->pCrtc[0], TRUE);
- avivo_lock_cursor(pRADEONEnt->pCrtc[0], FALSE);
-
- avivo_lock_cursor(pRADEONEnt->pCrtc[1], TRUE);
- avivo_setup_cursor(pRADEONEnt->pCrtc[1], TRUE);
- avivo_lock_cursor(pRADEONEnt->pCrtc[1], FALSE);
- } else {
- avivo_lock_cursor(crtc, TRUE);
- avivo_setup_cursor(crtc, TRUE);
- avivo_lock_cursor(crtc, FALSE);
- }
+ avivo_lock_cursor(crtc, TRUE);
+ avivo_setup_cursor(crtc, TRUE);
+ avivo_lock_cursor(crtc, FALSE);
} else {
switch (crtc_id) {
case 0:
@@ -172,6 +156,7 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc)
OUTREGP(RADEON_MM_DATA, RADEON_CRTC_CUR_EN | 2 << 20,
~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
}
+ radeon_crtc->cursor_enabled = TRUE;
}
void
@@ -185,6 +170,12 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
if (IS_AVIVO_VARIANT) {
avivo_lock_cursor(crtc, TRUE);
+ /* set size to zero as proper size will get set in
+ * set_cursor_postion(). This will prevent the cursor
+ * from showing up even if it's enabled to work-around
+ * corruption issues.
+ */
+ OUTREG(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset, 0);
avivo_setup_cursor(crtc, FALSE);
avivo_lock_cursor(crtc, FALSE);
} else {
@@ -201,6 +192,7 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
OUTREGP(RADEON_MM_DATA, 0, ~RADEON_CRTC_CUR_EN);
}
+ radeon_crtc->cursor_enabled = FALSE;
}
void
@@ -255,6 +247,22 @@ radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
}
if (w <= 0)
w = 1;
+
+ /* both cursors should be enabled when dualhead is active
+ * or you may get corruption bands
+ */
+ if (!pRADEONEnt->Controller[0]->cursor_enabled) {
+ avivo_lock_cursor(pRADEONEnt->pCrtc[0], TRUE);
+ avivo_setup_cursor(pRADEONEnt->pCrtc[0], TRUE);
+ avivo_lock_cursor(pRADEONEnt->pCrtc[0], FALSE);
+ pRADEONEnt->Controller[0]->cursor_enabled = TRUE;
+ }
+ if (!pRADEONEnt->Controller[1]->cursor_enabled) {
+ avivo_lock_cursor(pRADEONEnt->pCrtc[1], TRUE);
+ avivo_setup_cursor(pRADEONEnt->pCrtc[1], TRUE);
+ avivo_lock_cursor(pRADEONEnt->pCrtc[1], FALSE);
+ pRADEONEnt->Controller[1]->cursor_enabled = TRUE;
+ }
}
avivo_lock_cursor(crtc, TRUE);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 3e4f47c3..dbccd857 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -159,6 +159,7 @@ typedef struct _RADEONCrtcPrivateRec {
int can_tile;
Bool enabled;
Bool initialized;
+ Bool cursor_enabled;
} RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr;
typedef struct _radeon_encoder {