xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Tue Feb 17 16:55:15 PST 2009


 src/atombios_crtc.c |    2 ++
 src/legacy_crtc.c   |    4 +++-
 src/radeon_crtc.c   |    2 ++
 src/radeon_driver.c |   10 ++++++++--
 src/radeon_output.c |   20 ++++++++++++--------
 src/radeon_probe.h  |    1 +
 6 files changed, 28 insertions(+), 11 deletions(-)

New commits:
commit 9a108f0a0b7203458673ce6221e747a166d39617
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Tue Feb 17 19:52:27 2009 -0500

    ATOM: don't unblank uninitialized crtcs
    
    If the crtc timing isn't setup, you might get stuck in a loop
    in the BlankCRTC command table
    
    fixes bug 16781

diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index 432cebe..5c26ef8 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -491,6 +491,8 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
     if (info->DispPriority)
 	RADEONInitDispBandwidth(pScrn);
 
+    radeon_crtc->initialized = TRUE;
+
     if (tilingChanged) {
 	/* need to redraw front buffer, I guess this can be considered a hack ? */
 	/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index cba1b5f..b8c5380 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -1832,7 +1832,9 @@ legacy_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 	radeon_update_tv_routing(pScrn, info->ModeReg);
 
     if (info->DispPriority)
-        RADEONInitDispBandwidth(pScrn);
+	RADEONInitDispBandwidth(pScrn);
+
+    radeon_crtc->initialized = TRUE;
 
     if (tilingChanged) {
 	/* need to redraw front buffer, I guess this can be considered a hack ? */
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index e0875a4..5a7c730 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -609,6 +609,7 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
 	pRADEONEnt->pCrtc[0]->driver_private = pRADEONEnt->Controller[0];
 	pRADEONEnt->Controller[0]->crtc_id = 0;
 	pRADEONEnt->Controller[0]->crtc_offset = 0;
+	pRADEONEnt->Controller[0]->initialized = FALSE;
 	if (info->allowColorTiling)
 	    pRADEONEnt->Controller[0]->can_tile = 1;
 	else
@@ -633,6 +634,7 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
 	pRADEONEnt->pCrtc[1]->driver_private = pRADEONEnt->Controller[1];
 	pRADEONEnt->Controller[1]->crtc_id = 1;
 	pRADEONEnt->Controller[1]->crtc_offset = AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL;
+	pRADEONEnt->Controller[1]->initialized = FALSE;
 	if (info->allowColorTiling)
 	    pRADEONEnt->Controller[1]->can_tile = 1;
 	else
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index d22db58..32608a4 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5601,18 +5601,24 @@ void RADEONLeaveVT(int scrnIndex, int flags)
     }
 #endif
 
-#ifndef HAVE_FREE_SHADOW
+
     for (i = 0; i < config->num_crtc; i++) {
 	xf86CrtcPtr crtc = config->crtc[i];
+	RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
 
+	radeon_crtc->initialized = FALSE;
+
+#ifndef HAVE_FREE_SHADOW
 	if (crtc->rotatedPixmap || crtc->rotatedData) {
 	    crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
 					crtc->rotatedData);
 	    crtc->rotatedPixmap = NULL;
 	    crtc->rotatedData = NULL;
 	}
+#endif
     }
-#else
+
+#ifdef HAVE_FREE_SHADOW
     xf86RotateFreeShadow(pScrn);
 #endif
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index ba4cb7f..2128dab 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -510,10 +510,12 @@ radeon_mode_prepare(xf86OutputPtr output)
 	    xf86CrtcPtr other_crtc = loop_output->crtc;
 	    RADEONCrtcPrivatePtr other_radeon_crtc = other_crtc->driver_private;
 	    if (other_crtc->enabled) {
-		radeon_crtc_dpms(other_crtc, DPMSModeOff);
-		if (IS_AVIVO_VARIANT)
-		    atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 1);
-		radeon_dpms(loop_output, DPMSModeOff);
+		if (other_radeon_crtc->initialized) {
+		    radeon_crtc_dpms(other_crtc, DPMSModeOff);
+		    if (IS_AVIVO_VARIANT)
+			atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 1);
+		    radeon_dpms(loop_output, DPMSModeOff);
+		}
 	    }
 	}
     }
@@ -553,10 +555,12 @@ radeon_mode_commit(xf86OutputPtr output)
 	    xf86CrtcPtr other_crtc = loop_output->crtc;
 	    RADEONCrtcPrivatePtr other_radeon_crtc = other_crtc->driver_private;
 	    if (other_crtc->enabled) {
-		radeon_crtc_dpms(other_crtc, DPMSModeOn);
-		if (IS_AVIVO_VARIANT)
-		    atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 0);
-		radeon_dpms(loop_output, DPMSModeOn);
+		if (other_radeon_crtc->initialized) {
+		    radeon_crtc_dpms(other_crtc, DPMSModeOn);
+		    if (IS_AVIVO_VARIANT)
+			atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 0);
+		    radeon_dpms(loop_output, DPMSModeOn);
+		}
 	    }
 	}
     }
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 1b6ed7b..447ef57 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -157,6 +157,7 @@ typedef struct _RADEONCrtcPrivateRec {
     uint32_t crtc_offset;
     int can_tile;
     Bool enabled;
+    Bool initialized;
 } RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr;
 
 typedef struct _radeon_encoder {


More information about the xorg-commit mailing list