summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@gmail.com>2008-12-27 00:52:05 +0100
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-29 13:52:26 -0200
commit46741589529809c17aa1e9719492a4b623de6ddf (patch)
treea86bf8f79f0d83935e31534cb1eec3317ff3a29d /src/smi_driver.c
parent439adf4455c651926040eeeec52a092f14f3196b (diff)
Some more quirks for the SM712.
* Program the MCLK to 157MHz on startup. * Adjust the requested pixel clock if it's near one of the known stable frequencies. * Prefer the clock alternative with post scalar turned on when the denominator is even.
Diffstat (limited to 'src/smi_driver.c')
-rw-r--r--src/smi_driver.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 79d8a0c..12b618f 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1222,14 +1222,24 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn)
int mclk, mxclk;
SMIPtr pSmi = SMIPTR(pScrn);
- pSmi->MCLK = pSmi->MXCLK = 0;
+ /* MCLK defaults */
+ if (pSmi->Chipset == SMI_LYNXEMplus){
+ /* The SM712 can be safely clocked up to 157MHz, according to
+ Silicon Motion engineers. */
+ pSmi->MCLK = 157000;
+ }else
+ pSmi->MCLK = 0;
+
+ pSmi->MXCLK = 0;
+
+ /* MCLK from user settings */
if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) {
- pSmi->MCLK = (int)(real * 1000.0);
- if (!IS_MSOC(pSmi) && pSmi->MCLK > 120000) {
+ if (IS_MSOC(pSmi) || (int)real <= 120) {
+ pSmi->MCLK = (int)(real * 1000.0);
+ } else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Memory Clock %1.3f MHz larger than limit of 120 MHz\n",
real);
- pSmi->MCLK = 0;
}
}
mclk = pSmi->MCLK;
@@ -1243,6 +1253,7 @@ SMI_DetectMCLK(ScrnInfoPtr pScrn)
}
}
+ /* Already programmed MCLK */
if (pSmi->MCLK == 0) {
if (IS_MSOC(pSmi))
mclk = ((clock.f.m_select ? 336 : 288) /