diff options
author | Alex Deucher <alex@samba.(none)> | 2007-12-13 18:45:09 -0500 |
---|---|---|
committer | Alex Deucher <alex@samba.(none)> | 2007-12-13 18:45:09 -0500 |
commit | 814c6c48aebba2e45ce257289b922cd7e92caf2a (patch) | |
tree | b6421082b5c6fe80591ce208f9c8feaf4313616e /src/radeon_bios.c | |
parent | f5ac34983411e4c4f41ab1817dce582830f398fd (diff) |
RADEON: rework PLL calculation
- Take into account the limits from the bios tables
- Unify the PLL calculation between legacy and avivo chips
Diffstat (limited to 'src/radeon_bios.c')
-rw-r--r-- | src/radeon_bios.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c index 7b4eafb4..97301194 100644 --- a/src/radeon_bios.c +++ b/src/radeon_bios.c @@ -611,8 +611,19 @@ Bool RADEONGetClockInfoFromBIOS (ScrnInfoPtr pScrn) or use a new algorithm to calculate from min_input and max_input */ - pll->min_pll_freq = RADEON_BIOS16 (pll_info_block + 78); - pll->max_pll_freq = RADEON_BIOS32 (pll_info_block + 32); + pll->pll_out_min = RADEON_BIOS16 (pll_info_block + 78); + pll->pll_out_max = RADEON_BIOS32 (pll_info_block + 32); + + if (pll->pll_out_min == 0) { + if (IS_AVIVO_VARIANT) + pll->pll_out_min = 64800; + else + pll->pll_out_min = 20000; + } + + pll->pll_in_min = RADEON_BIOS16 (pll_info_block + 74); + pll->pll_in_max = RADEON_BIOS16 (pll_info_block + 76); + pll->xclk = RADEON_BIOS16 (pll_info_block + 72); info->sclk = RADEON_BIOS32(pll_info_block + 8) / 100.0; @@ -622,8 +633,13 @@ Bool RADEONGetClockInfoFromBIOS (ScrnInfoPtr pScrn) pll->reference_freq = RADEON_BIOS16 (pll_info_block + 0x0e); pll->reference_div = RADEON_BIOS16 (pll_info_block + 0x10); - pll->min_pll_freq = RADEON_BIOS32 (pll_info_block + 0x12); - pll->max_pll_freq = RADEON_BIOS32 (pll_info_block + 0x16); + pll->pll_out_min = RADEON_BIOS32 (pll_info_block + 0x12); + pll->pll_out_max = RADEON_BIOS32 (pll_info_block + 0x16); + + /* not available in the bios */ + pll->pll_in_min = 40; + pll->pll_in_max = 100; + pll->xclk = RADEON_BIOS16 (pll_info_block + 0x08); info->sclk = RADEON_BIOS16(pll_info_block + 8) / 100.0; @@ -636,8 +652,8 @@ Bool RADEONGetClockInfoFromBIOS (ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ref_freq: %d, min_pll: %u, " "max_pll: %u, xclk: %d, sclk: %f, mclk: %f\n", - pll->reference_freq, (unsigned)pll->min_pll_freq, - (unsigned)pll->max_pll_freq, pll->xclk, info->sclk, + pll->reference_freq, (unsigned)pll->pll_out_min, + (unsigned)pll->pll_out_max, pll->xclk, info->sclk, info->mclk); return TRUE; |