diff options
author | Alex Deucher <alex@t41p.(none)> | 2006-10-15 16:40:08 -0400 |
---|---|---|
committer | Alex Deucher <alex@t41p.(none)> | 2006-10-15 16:40:08 -0400 |
commit | 457178f418983041ea59df703a17513a47d17044 (patch) | |
tree | daab89713728c0868b686caee6a1936aabd0bd29 | |
parent | 3fb3f410931a13542fdd4c51c4c9ecada7b37d76 (diff) |
Disable all ouputs on initial mode set. The ones we want will get
enabled by RADEONEnableDisplay().
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_display.c | 53 | ||||
-rw-r--r-- | src/radeon_driver.c | 6 |
3 files changed, 60 insertions, 0 deletions
diff --git a/src/radeon.h b/src/radeon.h index 705c2101..7ff86f98 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -891,6 +891,7 @@ extern Bool RADEONI2cInit(ScrnInfoPtr pScrn); extern void RADEONSetSyncRangeFromEdid(ScrnInfoPtr pScrn, int flag); extern Bool RADEONMapControllers(ScrnInfoPtr pScrn); extern void RADEONEnableDisplay(ScrnInfoPtr pScrn, RADEONController* pCRTC, BOOL bEnable); +extern void RADEONDisableDisplays(ScrnInfoPtr pScrn); extern void RADEONGetPanelInfo(ScrnInfoPtr pScrn); extern void RADEONGetTVDacAdjInfo(ScrnInfoPtr pScrn); extern void RADEONUnblank(ScrnInfoPtr pScrn); diff --git a/src/radeon_display.c b/src/radeon_display.c index de44b389..58282ef5 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -1434,6 +1434,59 @@ static void RADEONDacPowerSet(ScrnInfoPtr pScrn, Bool IsOn, Bool IsPrimaryDAC) } } +/* disable all ouputs before enabling the ones we want */ +void RADEONDisableDisplays(ScrnInfoPtr pScrn) { + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char * RADEONMMIO = info->MMIO; + unsigned long tmp, tmpPixclksCntl; + + + /* primary DAC */ + tmp = INREG(RADEON_CRTC_EXT_CNTL); + tmp &= ~RADEON_CRTC_CRT_ON; + OUTREG(RADEON_CRTC_EXT_CNTL, tmp); + RADEONDacPowerSet(pScrn, FALSE, TRUE); + + /* Secondary DAC */ + if (info->ChipFamily == CHIP_FAMILY_R200) { + tmp = INREG(RADEON_FP2_GEN_CNTL); + tmp &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN); + OUTREG(RADEON_FP2_GEN_CNTL, tmp); + } else { + tmp = INREG(RADEON_CRTC2_GEN_CNTL); + tmp &= ~RADEON_CRTC2_CRT2_ON; + OUTREG(RADEON_CRTC2_GEN_CNTL, tmp); + } + RADEONDacPowerSet(pScrn, FALSE, FALSE); + + /* FP 1 */ + tmp = INREG(RADEON_FP_GEN_CNTL); + tmp &= ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN); + OUTREG(RADEON_FP_GEN_CNTL, tmp); + + /* FP 2 */ + tmp = INREG(RADEON_FP2_GEN_CNTL); + tmp &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN); + OUTREG(RADEON_FP2_GEN_CNTL, tmp); + + /* LVDS */ + tmpPixclksCntl = INPLL(pScrn, RADEON_PIXCLKS_CNTL); + if (info->IsMobility || info->IsIGP) { + /* Asic bug, when turning off LVDS_ON, we have to make sure + RADEON_PIXCLK_LVDS_ALWAYS_ON bit is off + */ + OUTPLLP(pScrn, RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); + } + tmp = INREG(RADEON_LVDS_GEN_CNTL); + tmp |= (RADEON_LVDS_ON | RADEON_LVDS_DISPLAY_DIS); + tmp &= ~(RADEON_LVDS_BLON); + OUTREG(RADEON_LVDS_GEN_CNTL, tmp); + if (info->IsMobility || info->IsIGP) { + OUTPLL(pScrn, RADEON_PIXCLKS_CNTL, tmpPixclksCntl); + } + +} + /* This is to be used enable/disable displays dynamically */ void RADEONEnableDisplay(ScrnInfoPtr pScrn, RADEONController* pCRTC, BOOL bEnable) { diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 97370ca3..28a16723 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -5760,6 +5760,12 @@ static void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore) return; } + /* Disable all outputs at initial mode set. the ones we want will + get set by RADEONEnableDisplay() + */ + if (!info->IsSwitching && !info->IsSecondary) + RADEONDisableDisplays(pScrn); + /* When changing mode with Dual-head card, care must be taken for * the special order in setting registers. CRTC2 has to be set * before changing CRTC_EXT register. In the dual-head setup, X |