summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@t41p.hsd1.va.comcast.net>2007-06-29 00:38:50 -0400
committerAlex Deucher <alex@t41p.hsd1.va.comcast.net>2007-06-29 00:38:50 -0400
commit21be0d3a1f4700572c6425800596785d6850626f (patch)
treec6b116924594179de3c539bcfe9e5d27cf3067e4
parentd9bf28b55d98fea2d285c9c46362aaf2175d0a46 (diff)
RADEON: simplify console restore
- still need to track crtcs for blank/unblank when restoring text console
-rw-r--r--src/radeon.h2
-rw-r--r--src/radeon_driver.c53
-rw-r--r--src/radeon_output.c2
3 files changed, 11 insertions, 46 deletions
diff --git a/src/radeon.h b/src/radeon.h
index a3aa0746..c8b18b08 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -238,7 +238,7 @@ typedef struct {
/* CRTC2 registers */
CARD32 crtc2_gen_cntl;
-
+ CARD32 dac_macro_cntl;
CARD32 dac2_cntl;
CARD32 disp_output_cntl;
CARD32 disp_tv_out_cntl;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 655e8ee6..c5558693 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4118,6 +4118,8 @@ void RADEONRestoreDACRegisters(ScrnInfoPtr pScrn,
OUTREG(RADEON_DISP_HW_DEBUG, restore->disp_hw_debug);
}
+ OUTREG(RADEON_DAC_MACRO_CNTL, restore->dac_macro_cntl);
+
/* R200 DAC connected via DVO */
if (info->ChipFamily == CHIP_FAMILY_R200)
OUTREG(RADEON_FP2_GEN_CNTL, restore->fp2_gen_cntl);
@@ -4678,23 +4680,6 @@ void RADEONChangeSurfaces(ScrnInfoPtr pScrn)
RADEONSaveSurfaces(pScrn, &info->ModeReg);
}
-void
-RADEONEnableOutputs(ScrnInfoPtr pScrn, int crtc_num)
-{
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- xf86CrtcPtr crtc = pRADEONEnt->pCrtc[crtc_num];
- int i;
-
- /* get the output connected to this CRTC */
- for (i = 0; i < xf86_config->num_output; i++) {
- xf86OutputPtr output = xf86_config->output[i];
- if (output->crtc == crtc) {
- RADEONEnableDisplay(output, TRUE);
- }
- }
-}
-
/* Write out state to define a new video mode */
void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
{
@@ -4703,25 +4688,6 @@ void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONRestoreMode(%p)\n", restore);
- /* For Non-dual head card, we don't have private field in the Entity */
- if (!pRADEONEnt->HasCRTC2) {
- RADEONRestoreMemMapRegisters(pScrn, restore);
- RADEONRestoreCommonRegisters(pScrn, restore);
- RADEONRestoreCrtcRegisters(pScrn, restore);
- RADEONRestoreRMXRegisters(pScrn, restore);
- RADEONRestoreFPRegisters(pScrn, restore);
- RADEONRestoreFP2Registers(pScrn, restore);
- RADEONRestoreLVDSRegisters(pScrn, restore);
- RADEONRestoreDACRegisters(pScrn, restore);
- RADEONRestorePLLRegisters(pScrn, restore);
- return;
- }
-
- /* Disable all outputs at initial mode set. the ones we want will
- get set by RADEONEnableDisplay()
- */
- 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
@@ -4736,8 +4702,11 @@ void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
*/
RADEONRestoreMemMapRegisters(pScrn, restore);
RADEONRestoreCommonRegisters(pScrn, restore);
- RADEONRestoreCrtc2Registers(pScrn, restore);
- RADEONRestorePLL2Registers(pScrn, restore);
+
+ if (pRADEONEnt->HasCRTC2) {
+ RADEONRestoreCrtc2Registers(pScrn, restore);
+ RADEONRestorePLL2Registers(pScrn, restore);
+ }
RADEONRestoreCrtcRegisters(pScrn, restore);
RADEONRestorePLLRegisters(pScrn, restore);
@@ -4747,9 +4716,6 @@ void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
RADEONRestoreLVDSRegisters(pScrn, restore);
RADEONRestoreDACRegisters(pScrn, restore);
- RADEONEnableOutputs(pScrn, 0);
- RADEONEnableOutputs(pScrn, 1);
-
#if 0
RADEONRestorePalette(pScrn, &info->SavedReg);
#endif
@@ -4860,7 +4826,7 @@ static void RADEONSaveDACRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
save->disp_output_cntl = INREG(RADEON_DISP_OUTPUT_CNTL);
save->disp_tv_out_cntl = INREG(RADEON_DISP_TV_OUT_CNTL);
save->disp_hw_debug = INREG(RADEON_DISP_HW_DEBUG);
-
+ save->dac_macro_cntl = INREG(RADEON_DAC_MACRO_CNTL);
}
/* Read flat panel registers */
@@ -4881,9 +4847,6 @@ static void RADEONSaveFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
save->bios_5_scratch = INREG(RADEON_BIOS_5_SCRATCH);
save->bios_6_scratch = INREG(RADEON_BIOS_6_SCRATCH);
- save->lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS;
- save->lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON);
-
if (info->ChipFamily == CHIP_FAMILY_RV280) {
/* bit 22 of TMDS_PLL_CNTL is read-back inverted */
save->tmds_pll_cntl ^= (1 << 22);
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 55853456..e431bf5b 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -857,6 +857,8 @@ static void RADEONInitDACRegisters(xf86OutputPtr output, RADEONSavePtr save,
save->dac_cntl = (RADEON_DAC_MASK_ALL
| RADEON_DAC_VGA_ADR_EN
| (info->dac6bits ? 0 : RADEON_DAC_8BIT_EN));
+
+ save->dac_macro_cntl = info->SavedReg.dac_macro_cntl;
}
/* XXX: fix me */