diff options
author | Dave Airlie <airlied@nx6125b.(none)> | 2007-08-24 15:05:01 +1000 |
---|---|---|
committer | Dave Airlie <airlied@nx6125b.(none)> | 2007-08-24 15:05:01 +1000 |
commit | 91c45fedfd155a153dcd2c3f3e30986bfbd44e6f (patch) | |
tree | 8a267c8dbf8a977fc02d34862ebb800129a6a595 /src/radeon_display.c | |
parent | 056ca6bb5adf974290693b55de6cd6880d2132d1 (diff) |
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.
Diffstat (limited to 'src/radeon_display.c')
-rw-r--r-- | src/radeon_display.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c index c51fb5de..ed204096 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -322,6 +322,7 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) 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 output, BOOL bEnable) 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 output, BOOL bEnable) 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 output, BOOL bEnable) 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 output, BOOL bEnable) 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 output, BOOL bEnable) 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 output, BOOL bEnable) 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 */ |