From da0d12bd9f2cbb6d4de0f0c1519c2149523567f6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Nov 2008 18:58:45 +0800 Subject: [PATCH] Set LVDS reference divisor based on current clock --- src/i830_lvds.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 239bc89..88276bd 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -754,12 +754,16 @@ i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, struct i830_lvds_priv *dev_priv = intel_output->dev_priv; ScrnInfoPtr pScrn = output->scrn; I830Ptr pI830 = I830PTR(pScrn); + uint8_t pwr_cycle = INREG(PP_DIVISOR) & 0xff; /* * PFIT must be enabled/disabled while LVDS is on but pipes are still off */ OUTREG(PFIT_PGM_RATIOS, dev_priv->pfit_pgm_ratios); OUTREG(PFIT_CONTROL, dev_priv->pfit_control); + + /* reference divider is (100 * ClkInMhz) / 2 - 1 */ + OUTREG(PP_DIVISOR, ((adjusted_mode->Clock/ 20 - 1) << 8) | pwr_cycle); } /** -- 1.5.3.8