summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWolke Liu <wolke.liu@amd.com>2009-02-02 17:01:34 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-02 17:01:34 -0500
commitc88c3ef6f3db266c1aacba5297b8dfc8b66bf00e (patch)
treee5ee7856150e4fe1e475ef8343385bd10a3291e1 /src
parent6fac3cefd1f46161c1e276ba40e72da2823aa9f6 (diff)
AVIVO: Save/restore vga pll registers
This fixes some VT switch issues on some chips
Diffstat (limited to 'src')
-rw-r--r--src/radeon_driver.c43
-rw-r--r--src/radeon_probe.h4
-rw-r--r--src/radeon_reg.h19
3 files changed, 66 insertions, 0 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index eda7b774..b0817b0a 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4232,6 +4232,27 @@ avivo_save(ScrnInfoPtr pScrn, RADEONSavePtr save)
state->pll2.pll_cntl = INREG(AVIVO_P2PLL_CNTL);
state->pll2.int_ss_cntl = INREG(AVIVO_P2PLL_INT_SS_CNTL);
+ state->vga25_ppll.ref_div_src = INREG(AVIVO_VGA25_PPLL_REF_DIV_SRC);
+ state->vga25_ppll.ref_div = INREG(AVIVO_VGA25_PPLL_REF_DIV);
+ state->vga25_ppll.fb_div = INREG(AVIVO_VGA25_PPLL_FB_DIV);
+ state->vga25_ppll.post_div_src = INREG(AVIVO_VGA25_PPLL_POST_DIV_SRC);
+ state->vga25_ppll.post_div = INREG(AVIVO_VGA25_PPLL_POST_DIV);
+ state->vga25_ppll.pll_cntl = INREG(AVIVO_VGA25_PPLL_CNTL);
+
+ state->vga28_ppll.ref_div_src = INREG(AVIVO_VGA28_PPLL_REF_DIV_SRC);
+ state->vga28_ppll.ref_div = INREG(AVIVO_VGA28_PPLL_REF_DIV);
+ state->vga28_ppll.fb_div = INREG(AVIVO_VGA28_PPLL_FB_DIV);
+ state->vga28_ppll.post_div_src = INREG(AVIVO_VGA28_PPLL_POST_DIV_SRC);
+ state->vga28_ppll.post_div = INREG(AVIVO_VGA28_PPLL_POST_DIV);
+ state->vga28_ppll.pll_cntl = INREG(AVIVO_VGA28_PPLL_CNTL);
+
+ state->vga41_ppll.ref_div_src = INREG(AVIVO_VGA41_PPLL_REF_DIV_SRC);
+ state->vga41_ppll.ref_div = INREG(AVIVO_VGA41_PPLL_REF_DIV);
+ state->vga41_ppll.fb_div = INREG(AVIVO_VGA41_PPLL_FB_DIV);
+ state->vga41_ppll.post_div_src = INREG(AVIVO_VGA41_PPLL_POST_DIV_SRC);
+ state->vga41_ppll.post_div = INREG(AVIVO_VGA41_PPLL_POST_DIV);
+ state->vga41_ppll.pll_cntl = INREG(AVIVO_VGA41_PPLL_CNTL);
+
state->crtc1.pll_source = INREG(AVIVO_PCLK_CRTC1_CNTL);
state->crtc1.h_total = INREG(AVIVO_D1CRTC_H_TOTAL);
@@ -4602,6 +4623,28 @@ avivo_restore(ScrnInfoPtr pScrn, RADEONSavePtr restore)
OUTREG(AVIVO_PCLK_CRTC1_CNTL, state->crtc1.pll_source);
OUTREG(AVIVO_PCLK_CRTC2_CNTL, state->crtc2.pll_source);
+ /* Set the vga PLL */
+ OUTREG(AVIVO_VGA25_PPLL_REF_DIV_SRC, state->vga25_ppll.ref_div_src);
+ OUTREG(AVIVO_VGA25_PPLL_REF_DIV, state->vga25_ppll.ref_div);
+ OUTREG(AVIVO_VGA25_PPLL_FB_DIV, state->vga25_ppll.fb_div);
+ OUTREG(AVIVO_VGA25_PPLL_POST_DIV_SRC, state->vga25_ppll.post_div_src);
+ OUTREG(AVIVO_VGA25_PPLL_POST_DIV, state->vga25_ppll.post_div);
+ OUTREG(AVIVO_VGA25_PPLL_CNTL, state->vga25_ppll.pll_cntl);
+
+ OUTREG(AVIVO_VGA28_PPLL_REF_DIV_SRC, state->vga28_ppll.ref_div_src);
+ OUTREG(AVIVO_VGA28_PPLL_REF_DIV, state->vga28_ppll.ref_div);
+ OUTREG(AVIVO_VGA28_PPLL_FB_DIV, state->vga28_ppll.fb_div);
+ OUTREG(AVIVO_VGA28_PPLL_POST_DIV_SRC, state->vga28_ppll.post_div_src);
+ OUTREG(AVIVO_VGA28_PPLL_POST_DIV, state->vga28_ppll.post_div);
+ OUTREG(AVIVO_VGA28_PPLL_CNTL, state->vga28_ppll.pll_cntl);
+
+ OUTREG(AVIVO_VGA41_PPLL_REF_DIV_SRC, state->vga41_ppll.ref_div_src);
+ OUTREG(AVIVO_VGA41_PPLL_REF_DIV, state->vga41_ppll.ref_div);
+ OUTREG(AVIVO_VGA41_PPLL_FB_DIV, state->vga41_ppll.fb_div);
+ OUTREG(AVIVO_VGA41_PPLL_POST_DIV_SRC, state->vga41_ppll.post_div_src);
+ OUTREG(AVIVO_VGA41_PPLL_POST_DIV, state->vga41_ppll.post_div);
+ OUTREG(AVIVO_VGA41_PPLL_CNTL, state->vga41_ppll.pll_cntl);
+
/* Set the CRTC */
OUTREG(AVIVO_D1CRTC_H_TOTAL, state->crtc1.h_total);
OUTREG(AVIVO_D1CRTC_H_BLANK_START_END, state->crtc1.h_blank_start_end);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 28df6962..a1b261f9 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -341,6 +341,10 @@ struct avivo_state
struct avivo_pll_state pll1;
struct avivo_pll_state pll2;
+ struct avivo_pll_state vga25_ppll;
+ struct avivo_pll_state vga28_ppll;
+ struct avivo_pll_state vga41_ppll;
+
struct avivo_crtc_state crtc1;
struct avivo_crtc_state crtc2;
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index 1987d61d..7b8840bf 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -3495,6 +3495,25 @@
# define AVIVO_DVGA_CONTROL_ROTATE (1<<24)
#define AVIVO_D2VGA_CONTROL 0x0338
+#define AVIVO_VGA25_PPLL_REF_DIV_SRC 0x0360
+#define AVIVO_VGA25_PPLL_REF_DIV 0x0364
+#define AVIVO_VGA28_PPLL_REF_DIV_SRC 0x0368
+#define AVIVO_VGA28_PPLL_REF_DIV 0x036c
+#define AVIVO_VGA41_PPLL_REF_DIV_SRC 0x0370
+#define AVIVO_VGA41_PPLL_REF_DIV 0x0374
+#define AVIVO_VGA25_PPLL_FB_DIV 0x0378
+#define AVIVO_VGA28_PPLL_FB_DIV 0x037c
+#define AVIVO_VGA41_PPLL_FB_DIV 0x0380
+#define AVIVO_VGA25_PPLL_POST_DIV_SRC 0x0384
+#define AVIVO_VGA25_PPLL_POST_DIV 0x0388
+#define AVIVO_VGA28_PPLL_POST_DIV_SRC 0x038c
+#define AVIVO_VGA28_PPLL_POST_DIV 0x0390
+#define AVIVO_VGA41_PPLL_POST_DIV_SRC 0x0394
+#define AVIVO_VGA41_PPLL_POST_DIV 0x0398
+#define AVIVO_VGA25_PPLL_CNTL 0x039c
+#define AVIVO_VGA28_PPLL_CNTL 0x03a0
+#define AVIVO_VGA41_PPLL_CNTL 0x03a4
+
#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400
#define AVIVO_EXT1_PPLL_REF_DIV 0x404
#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408