xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Wed Apr 29 09:44:17 PDT 2009


 src/atombios_crtc.c |    4 ++--
 src/legacy_crtc.c   |   48 ++++++++++++++++++------------------------------
 src/radeon_crtc.c   |    8 ++++++++
 3 files changed, 28 insertions(+), 32 deletions(-)

New commits:
commit 7d9f643ae3d07e51e644a5979ca90bc2c102bc89
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Apr 29 12:38:15 2009 -0400

    radeon: fix several dpms issues
    
    - atom dpms was unblanking for standby/suspend
    - return if r600+ in radeon_crtc_modeset_ioctl()
    - remove seprate standby/suspend handling in legacy
      crtc dpms.  we turn the outputs off, so turn the
      crtcs off too.
    - disable the crtcs in legacy crtc dpms
    - move radeon_crtc_modeset_ioctl() calls to radeon_crtc_dpms()
      so they will get called for both atom and legacy paths
    
    Should fix bug 21321

diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index 01266b6..54c4578 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -167,13 +167,13 @@ atombios_crtc_dpms(xf86CrtcPtr crtc, int mode)
     RADEONInfoPtr  info = RADEONPTR(crtc->scrn);
     switch (mode) {
     case DPMSModeOn:
-    case DPMSModeStandby:
-    case DPMSModeSuspend:
 	if (IS_DCE3_VARIANT)
 	    atombios_enable_crtc_memreq(info->atomBIOS, radeon_crtc->crtc_id, 1);
 	atombios_enable_crtc(info->atomBIOS, radeon_crtc->crtc_id, 1);
 	atombios_blank_crtc(info->atomBIOS, radeon_crtc->crtc_id, 0);
 	break;
+    case DPMSModeStandby:
+    case DPMSModeSuspend:
     case DPMSModeOff:
 	atombios_blank_crtc(info->atomBIOS, radeon_crtc->crtc_id, 1);
 	atombios_enable_crtc(info->atomBIOS, radeon_crtc->crtc_id, 0);
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index 7a3a920..b57ba5f 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -649,6 +649,9 @@ radeon_crtc_modeset_ioctl(xf86CrtcPtr crtc, Bool post)
     if (!info->directRenderingEnabled)
 	return;
 
+    if (info->ChipFamily >= CHIP_FAMILY_R600)
+	return;
+
     modeset.crtc = radeon_crtc->crtc_id;
     modeset.cmd = post ? _DRM_POST_MODESET : _DRM_PRE_MODESET;
 
@@ -661,55 +664,42 @@ radeon_crtc_modeset_ioctl(xf86CrtcPtr crtc, Bool post)
 void
 legacy_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
-    int mask;
+    uint32_t mask;
     RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
     unsigned char *RADEONMMIO = pRADEONEnt->MMIO;
 
-    mask = radeon_crtc->crtc_id ? (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS | RADEON_CRTC2_DISP_REQ_EN_B) : (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS);
-
-    if (mode == DPMSModeOff)
-	radeon_crtc_modeset_ioctl(crtc, FALSE);
+    if (radeon_crtc->crtc_id)
+	mask = (RADEON_CRTC2_EN |
+		RADEON_CRTC2_DISP_DIS |
+		RADEON_CRTC2_VSYNC_DIS |
+		RADEON_CRTC2_HSYNC_DIS |
+		RADEON_CRTC2_DISP_REQ_EN_B);
+    else
+	mask = (RADEON_CRTC_DISPLAY_DIS |
+		RADEON_CRTC_HSYNC_DIS |
+		RADEON_CRTC_VSYNC_DIS);
 
     switch(mode) {
     case DPMSModeOn:
 	if (radeon_crtc->crtc_id) {
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~mask);
+	    OUTREGP(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_EN, ~mask);
 	} else {
-	    OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_DISP_REQ_EN_B);
+	    OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_EN, ~(RADEON_CRTC_EN | RADEON_CRTC_DISP_REQ_EN_B));
 	    OUTREGP(RADEON_CRTC_EXT_CNTL, 0, ~mask);
 	}
 	break;
     case DPMSModeStandby:
-	if (radeon_crtc->crtc_id) {
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS), ~mask);
-	} else {
-	    OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_DISP_REQ_EN_B);
-	    OUTREGP(RADEON_CRTC_EXT_CNTL, (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS), ~mask);
-	}
-	break;
     case DPMSModeSuspend:
-	if (radeon_crtc->crtc_id) {
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS), ~mask);
-	} else {
-	    OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_DISP_REQ_EN_B);
-	    OUTREGP(RADEON_CRTC_EXT_CNTL, (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS), ~mask);
-	}
-	break;
     case DPMSModeOff:
 	if (radeon_crtc->crtc_id) {
 	    OUTREGP(RADEON_CRTC2_GEN_CNTL, mask, ~mask);
 	} else {
-	    OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~RADEON_CRTC_DISP_REQ_EN_B);
+	    OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~(RADEON_CRTC_EN | RADEON_CRTC_DISP_REQ_EN_B));
 	    OUTREGP(RADEON_CRTC_EXT_CNTL, mask, ~mask);
 	}
 	break;
     }
-  
-    if (mode != DPMSModeOff) {
-	radeon_crtc_modeset_ioctl(crtc, TRUE);
-	radeon_crtc_load_lut(crtc);
-    }
 }
 
 
@@ -912,7 +902,6 @@ RADEONInitCrtcRegisters(xf86CrtcPtr crtc, RADEONSavePtr save,
 
     /*save->bios_4_scratch = info->SavedReg->bios_4_scratch;*/
     save->crtc_gen_cntl = (RADEON_CRTC_EXT_DISP_EN
-			   | RADEON_CRTC_EN
 			   | (format << 8)
 			   | ((mode->Flags & V_DBLSCAN)
 			      ? RADEON_CRTC_DBL_SCAN_EN
@@ -1160,8 +1149,7 @@ RADEONInitCrtc2Registers(xf86CrtcPtr crtc, RADEONSavePtr save,
     else
 	save->crtc2_gen_cntl = 0;
 
-    save->crtc2_gen_cntl |= (RADEON_CRTC2_EN
-			     | (format << 8)
+    save->crtc2_gen_cntl |= ((format << 8)
 			     | RADEON_CRTC2_VSYNC_DIS
 			     | RADEON_CRTC2_HSYNC_DIS
 			     | RADEON_CRTC2_DISP_DIS
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 4b68770..c78ac43 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -77,6 +77,9 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
     if ((mode == DPMSModeOn) && radeon_crtc->enabled)
 	return;
 
+    if (mode == DPMSModeOff)
+	radeon_crtc_modeset_ioctl(crtc, FALSE);
+
     if (IS_AVIVO_VARIANT || info->r4xx_atom) {
 	atombios_crtc_dpms(crtc, mode);
     } else {
@@ -97,6 +100,11 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
 	}
     }
 
+    if (mode != DPMSModeOff) {
+	radeon_crtc_modeset_ioctl(crtc, TRUE);
+	radeon_crtc_load_lut(crtc);
+    }
+
     if (mode == DPMSModeOn)
 	radeon_crtc->enabled = TRUE;
     else


More information about the xorg-commit mailing list