xf86-video-ati: Branch 'master' - 2 commits

Alex Deucher agd5f at kemper.freedesktop.org
Tue Apr 28 22:56:10 PDT 2009


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

New commits:
commit 35183ef528411eb0122cf48550d93f921d291d12
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Apr 29 01:55:10 2009 -0400

    AVIVO: better fix for cursor flickering/corruption issues
    
    Should prevent ghost cursor from being left on screen.

diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index 4b14aec..1336e2a 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
@@ -247,6 +239,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 3e4f47c..dbccd85 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 {
commit 53e75cbd0ba8f39799d7b776cdc59d60aa2a6916
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Apr 29 01:05:31 2009 -0400

    R6xx/r7xx: fix CURSOR_SWAPPING_* macros
    
    r6xx/r7xx have different swapper regs

diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index 1f06b17..4b14aec 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -73,14 +73,17 @@
 #define CURSOR_SWAPPING_DECL_MMIO   unsigned char *RADEONMMIO = info->MMIO;
 #define CURSOR_SWAPPING_START() \
   do { \
+  if (info->ChipFamily < CHIP_FAMILY_R600) \
     OUTREG(RADEON_SURFACE_CNTL, \
 	   (info->ModeReg->surface_cntl | \
 	     RADEON_NONSURF_AP0_SWP_32BPP | RADEON_NONSURF_AP1_SWP_32BPP) & \
 	   ~(RADEON_NONSURF_AP0_SWP_16BPP | RADEON_NONSURF_AP1_SWP_16BPP)); \
   } while (0)
-#define CURSOR_SWAPPING_END()	(OUTREG(RADEON_SURFACE_CNTL, \
-					info->ModeReg->surface_cntl))
-
+#define CURSOR_SWAPPING_END()	\
+  do { \
+  if (info->ChipFamily < CHIP_FAMILY_R600) \
+      OUTREG(RADEON_SURFACE_CNTL, info->ModeReg->surface_cntl); \
+  } while (0)
 #else
 
 #define CURSOR_SWAPPING_DECL_MMIO


More information about the xorg-commit mailing list