diff options
author | Alex Deucher <alex@botch2.com> | 2007-08-02 02:11:20 -0400 |
---|---|---|
committer | Alex Deucher <alex@botch2.com> | 2007-08-02 02:11:20 -0400 |
commit | b66a1bc7994b33d349c1519761e431959311c85f (patch) | |
tree | bfaa478bcfc8896d6fe21cf6887f8786b4046dc0 | |
parent | d86592c8d5ce45d81d8a726c263e870e94fbcf11 (diff) |
RADEON: fix tv-out enable/disable
-rw-r--r-- | src/radeon_display.c | 44 | ||||
-rw-r--r-- | src/radeon_driver.c | 4 | ||||
-rw-r--r-- | src/radeon_tv.c | 7 |
3 files changed, 10 insertions, 45 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c index bca0ac1..da2b82f 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -317,9 +317,8 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) RADEONOutputPrivatePtr radeon_output; radeon_output = output->driver_private; - ErrorF("enable montype: %d\n", radeon_output->MonType); - if (bEnable) { + ErrorF("enable montype: %d\n", radeon_output->MonType); if (radeon_output->MonType == MT_CRT) { if (radeon_output->DACType == DAC_PRIMARY) { tmp = INREG(RADEON_CRTC_EXT_CNTL); @@ -362,20 +361,11 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) save->lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS); } else if (radeon_output->MonType == MT_STV || radeon_output->MonType == MT_CTV) { -#if 1 - /* TV_MASTER_CNTL ??? */ - - /* XXX: FIXME: STV vs CTV and DACPD bits */ - tmp = INREG(RADEON_TV_DAC_CNTL); - tmp |= (RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD); - tmp &= ~RADEON_TV_DAC_BGSLEEP; - OUTREG(RADEON_TV_DAC_CNTL, tmp); - save->tv_dac_cntl |= (RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD); - save->tv_dac_cntl &= ~RADEON_TV_DAC_BGSLEEP; -#endif + RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY)); } } else { - if (radeon_output->MonType == MT_CRT || radeon_output->MonType == NONE) { + ErrorF("disable montype: %d\n", radeon_output->MonType); + if (radeon_output->MonType == MT_CRT) { if (radeon_output->DACType == DAC_PRIMARY) { tmp = INREG(RADEON_CRTC_EXT_CNTL); tmp &= ~RADEON_CRTC_CRT_ON; @@ -395,9 +385,7 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) } } RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY)); - } - - if (radeon_output->MonType == MT_DFP || radeon_output->MonType == NONE) { + } else if (radeon_output->MonType == MT_DFP) { if (radeon_output->TMDSType == TMDS_INT) { tmp = INREG(RADEON_FP_GEN_CNTL); tmp &= ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN); @@ -409,10 +397,7 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) OUTREG(RADEON_FP2_GEN_CNTL, tmp); save->fp2_gen_cntl &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN); } - } - - if (radeon_output->MonType == MT_LCD || - (radeon_output->MonType == NONE && radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)) { + } else if (radeon_output->MonType == MT_LCD) { unsigned long tmpPixclksCntl = INPLL(pScrn, RADEON_PIXCLKS_CNTL); if (info->IsMobility || info->IsIGP) { /* Asic bug, when turning off LVDS_ON, we have to make sure @@ -429,21 +414,8 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable) if (info->IsMobility || info->IsIGP) { OUTPLL(pScrn, RADEON_PIXCLKS_CNTL, tmpPixclksCntl); } - } - - if (radeon_output->MonType == MT_STV || - radeon_output->MonType == MT_CTV) { -#if 1 - - /* TV_MASTER_CNTL ??? */ - - tmp = INREG(RADEON_TV_DAC_CNTL); - tmp &= ~(RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD); - tmp |= RADEON_TV_DAC_BGSLEEP; - OUTREG(RADEON_TV_DAC_CNTL, tmp); - save->tv_dac_cntl &= ~(RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD); - save->tv_dac_cntl |= RADEON_TV_DAC_BGSLEEP; -#endif + } else if (radeon_output->MonType == MT_STV || radeon_output->MonType == MT_CTV) { + RADEONDacPowerSet(pScrn, bEnable, (radeon_output->DACType == DAC_PRIMARY)); } } } diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 64abf80..a7f5831 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -4541,7 +4541,6 @@ void RADEONRestoreTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore) RADEONRestoreTVRestarts(pScrn, restore); ErrorF("Restore Timing Tables\n"); - RADEONRestoreTVTimingTables(pScrn, restore); @@ -4554,12 +4553,9 @@ void RADEONRestoreTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore) OUTREG(RADEON_TV_MASTER_CNTL, restore->tv_master_cntl); - /*OUTREG(RADEON_DISP_MERGE_CNTL, restore->disp_merge_cntl);*/ - OUTREG(RADEON_TV_GAIN_LIMIT_SETTINGS, restore->tv_gain_limit_settings); OUTREG(RADEON_TV_LINEAR_GAIN_SETTINGS, restore->tv_linear_gain_settings); - /* XXX: taken care of in EnableDisplay() */ OUTREG(RADEON_TV_DAC_CNTL, restore->tv_dac_cntl); ErrorF("Leaving Restore TV\n"); diff --git a/src/radeon_tv.c b/src/radeon_tv.c index 38fbcd0..b802234 100644 --- a/src/radeon_tv.c +++ b/src/radeon_tv.c @@ -405,17 +405,14 @@ void RADEONInitTVRegisters(xf86OutputPtr output, RADEONSavePtr save, tmp = (tmp << RADEON_UV_OUTPUT_POST_SCALE_SHIFT) | 0x000b0000; save->tv_timing_cntl = tmp; - /* XXX: taken care of in enabledisplay() */ - save->tv_dac_cntl = /*RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD - |*/ (8 << 16) | (6 << 20); + save->tv_dac_cntl = RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD | (8 << 16) | (6 << 20); if (radeon_output->tvStd == TV_STD_NTSC) save->tv_dac_cntl |= RADEON_TV_DAC_STD_NTSC; else save->tv_dac_cntl |= RADEON_TV_DAC_STD_PAL; -#if 1 - /* XXX: taken care of in enabledisplay() */ +#if 0 save->tv_dac_cntl |= (RADEON_TV_DAC_RDACPD | RADEON_TV_DAC_GDACPD | RADEON_TV_DAC_BDACPD); |