summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r--src/smi_driver.c19
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);
}
}