xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Mon May 4 13:05:19 PDT 2009


 src/radeon_cursor.c |   34 ++++------------------------------
 src/radeon_probe.h  |    1 -
 2 files changed, 4 insertions(+), 31 deletions(-)

New commits:
commit da58e351b6398fa18b1d9c1a57a6e49b285f610f
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Mon May 4 16:03:53 2009 -0400

    AVIVO: fix cursoe corruption bands for real
    
    Don't have to leave both cursors enabled, just have to use
    the same mode for both cursors whether or not they are enabled.

diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index 2feb0d7..59df132 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -100,7 +100,10 @@ avivo_setup_cursor(xf86CrtcPtr crtc, Bool enable)
     RADEONInfoPtr  info = RADEONPTR(crtc->scrn);
     unsigned char     *RADEONMMIO = info->MMIO;
 
-    OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset, 0);
+    /* always use the same cursor mode even if the cursor is disabled,
+     * otherwise you may end up with cursor curruption bands
+     */
+    OUTREG(AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset, (AVIVO_D1CURSOR_MODE_24BPP << AVIVO_D1CURSOR_MODE_SHIFT));
 
     if (enable) {
 	OUTREG(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset,
@@ -156,7 +159,6 @@ 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
@@ -169,18 +171,7 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
     unsigned char     *RADEONMMIO = info->MMIO;
 
     if (IS_AVIVO_VARIANT) {
-	DisplayModePtr mode = &crtc->mode;
-
 	avivo_lock_cursor(crtc, TRUE);
-	/* Set position offscreen.  This will prevent the cursor
-	 * from showing up even if it's enabled to work-around
-	 * corruption issues.
-	 */
-	if (mode) {
-	    OUTREG(AVIVO_D1CUR_POSITION + radeon_crtc->crtc_offset,
-		   ((crtc->x + mode->CrtcHDisplay) << 16) | (crtc->y + mode->CrtcVDisplay));
-	    OUTREG(AVIVO_D1CUR_HOT_SPOT + radeon_crtc->crtc_offset, 0);
-	}
 	avivo_setup_cursor(crtc, FALSE);
 	avivo_lock_cursor(crtc, FALSE);
     } else {
@@ -197,7 +188,6 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
 
         OUTREGP(RADEON_MM_DATA, 0, ~RADEON_CRTC_CUR_EN);
    }
-    radeon_crtc->cursor_enabled = FALSE;
 }
 
 void
@@ -244,22 +234,6 @@ 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 8e902e3..31709e8 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -159,7 +159,6 @@ typedef struct _RADEONCrtcPrivateRec {
     int can_tile;
     Bool enabled;
     Bool initialized;
-    Bool cursor_enabled;
     Bool scaler_enabled;
     float vsc;
     float hsc;


More information about the xorg-commit mailing list