xf86-video-ati: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Thu Aug 23 22:04:41 PDT 2007


 src/radeon.h         |    1 +
 src/radeon_display.c |   24 ++++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

New commits:
diff-tree 91c45fedfd155a153dcd2c3f3e30986bfbd44e6f (from 056ca6bb5adf974290693b55de6cd6880d2132d1)
Author: Dave Airlie <airlied at nx6125b.(none)>
Date:   Fri Aug 24 15:05:01 2007 +1000

    radeon: don't disable dac if either tv or vga is using it
    
    On my rs480 I had to vt switch to get hotplug VGA working due to the tv-out
    code turning off the dac when the vga code was actually using it.

diff --git a/src/radeon.h b/src/radeon.h
index 29e7da4..6f880b8 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -791,6 +791,7 @@ typedef struct {
     int                MaxLines;
 
     CARD32            tv_dac_adj;
+    CARD32            tv_dac_enable_mask;
 
     Bool want_vblank_interrupts;
     RADEONBIOSConnector BiosConnector[RADEON_MAX_BIOS_CONNECTOR];
diff --git a/src/radeon_display.c b/src/radeon_display.c
index c51fb5d..ed20409 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -322,6 +322,7 @@ void RADEONEnableDisplay(xf86OutputPtr o
     unsigned char * RADEONMMIO = info->MMIO;
     unsigned long tmp;
     RADEONOutputPrivatePtr radeon_output;
+    int tv_dac_change = 0;
     radeon_output = output->driver_private;
 
     if (bEnable) {
@@ -332,6 +333,7 @@ void RADEONEnableDisplay(xf86OutputPtr o
                 tmp |= RADEON_CRTC_CRT_ON;                    
                 OUTREG(RADEON_CRTC_EXT_CNTL, tmp);
                 save->crtc_ext_cntl |= RADEON_CRTC_CRT_ON;
+                RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
             } else if (radeon_output->DACType == DAC_TVDAC) {
                 if (info->ChipFamily == CHIP_FAMILY_R200) {
                     tmp = INREG(RADEON_FP2_GEN_CNTL);
@@ -344,8 +346,8 @@ void RADEONEnableDisplay(xf86OutputPtr o
                     OUTREG(RADEON_CRTC2_GEN_CNTL, tmp);
                     save->crtc2_gen_cntl |= RADEON_CRTC2_CRT2_ON;
                 }
+                tv_dac_change = 1;
             }
-	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
         } else if (radeon_output->MonType == MT_DFP) {
             if (radeon_output->TMDSType == TMDS_INT) {
                 tmp = INREG(RADEON_FP_GEN_CNTL);
@@ -371,7 +373,7 @@ void RADEONEnableDisplay(xf86OutputPtr o
 	    tmp = INREG(RADEON_TV_MASTER_CNTL);
 	    tmp |= RADEON_TV_ON;
 	    OUTREG(RADEON_TV_MASTER_CNTL, tmp);
-	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
+            tv_dac_change = 2;
 	}
     } else {
 	ErrorF("disable montype: %d\n", radeon_output->MonType);
@@ -381,6 +383,7 @@ void RADEONEnableDisplay(xf86OutputPtr o
                 tmp &= ~RADEON_CRTC_CRT_ON;
                 OUTREG(RADEON_CRTC_EXT_CNTL, tmp);
                 save->crtc_ext_cntl &= ~RADEON_CRTC_CRT_ON;
+                RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
             } else if (radeon_output->DACType == DAC_TVDAC) {
                 if (info->ChipFamily == CHIP_FAMILY_R200) {
                     tmp = INREG(RADEON_FP2_GEN_CNTL);
@@ -393,8 +396,8 @@ void RADEONEnableDisplay(xf86OutputPtr o
                     OUTREG(RADEON_CRTC2_GEN_CNTL, tmp);
                     save->crtc2_gen_cntl &= ~RADEON_CRTC2_CRT2_ON;
                 }
+                tv_dac_change = 1;
             }
-	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
         } else if (radeon_output->MonType == MT_DFP) {
             if (radeon_output->TMDSType == TMDS_INT) {
                 tmp = INREG(RADEON_FP_GEN_CNTL);
@@ -428,9 +431,22 @@ void RADEONEnableDisplay(xf86OutputPtr o
 	    tmp = INREG(RADEON_TV_MASTER_CNTL);
 	    tmp &= ~RADEON_TV_ON;
 	    OUTREG(RADEON_TV_MASTER_CNTL, tmp);
-	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
+            tv_dac_change = 2;
 	}
     }
+
+    if (tv_dac_change) {
+	if (bEnable)
+		info->tv_dac_enable_mask |= tv_dac_change;
+	else
+		info->tv_dac_enable_mask &= ~tv_dac_change;
+
+	if (bEnable && info->tv_dac_enable_mask)
+	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
+	else if (!bEnable && info->tv_dac_enable_mask == 0)
+	    RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY));
+
+    }
 }
 
 /* Calculate display buffer watermark to prevent buffer underflow */


More information about the xorg-commit mailing list