diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-13 04:20:20 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-13 04:20:20 -0200 |
commit | 695a6066cfe7ad0e568edc596b8704bb9bf8754f (patch) | |
tree | 2b71110c23ab5af3aed913e4aa965cecb6c6a633 /src/smi_driver.c | |
parent | 191cbd3f8419cc5b428f262607d7a8594e574f67 (diff) |
Janitor/maintenance patches.
o Define HAVE_XMODES in config.h.
o Correct the LEAVE() macro declaration when SMI_DEBUG is defined.
o Remove prototype for SMI_DGAInit() if HAVE_XMODES is not defined.
o Properly scale value read from sm501 CURRENT_CLOCK register, to
print an appropriate message on startup.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r-- | src/smi_driver.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c index b36fc7f..0f39436 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1215,15 +1215,18 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn) if (IS_MSOC(pSmi)) { clock.value = READ_SCR(pSmi, CURRENT_CLOCK); - if (xf86GetOptValFreq(pSmi->Options, OPTION_MXCLK, OPTUNITS_MHZ, &real)) + if (xf86GetOptValFreq(pSmi->Options, OPTION_MXCLK, + OPTUNITS_MHZ, &real)) { pSmi->MXCLK = (int)(real * 1000.0); - mxclk = pSmi->MXCLK; + mxclk = pSmi->MXCLK; + } } if (pSmi->MCLK == 0) { if (IS_MSOC(pSmi)) - mclk = (clock.f.m_select ? 336 : 288) / - ((clock.f.m_divider ? 3 : 1) << (unsigned)clock.f.m_shift); + mclk = ((clock.f.m_select ? 336 : 288) / + ((clock.f.m_divider ? 3 : 1) << + (unsigned)clock.f.m_shift)) * 1000; else { unsigned char shift, m, n; @@ -1248,10 +1251,10 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MCLK = %1.3f\n", mclk / 1000.0); if (IS_MSOC(pSmi)) { if (pSmi->MXCLK == 0) - mxclk = (clock.f.m1_select ? 336 : 288) / - ((clock.f.m1_divider ? 3 : 1) << (unsigned)clock.f.m1_shift); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MXCLK = %1.3f\n", - mxclk / 1000.0); + mxclk = ((clock.f.m1_select ? 336 : 288) / + ((clock.f.m1_divider ? 3 : 1) << + (unsigned)clock.f.m1_shift)) * 1000; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MXCLK = %1.3f\n", mxclk / 1000.0); } } |