summaryrefslogtreecommitdiff
path: root/src/i830_lvds.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-05-27 14:51:36 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-05-27 14:53:15 +1000
commit00e824b7cd59000e118dad55f563823b65148e01 (patch)
tree1b4d3b5a44a8524a79c8e13723869699c265c70c /src/i830_lvds.c
parentbe4d641a889a1bb49ac66b8a95bbd6ff0872f22d (diff)
port over ironlake fdi/dpms code from 2.6.34 kernelHEADrhel5master
Diffstat (limited to 'src/i830_lvds.c')
-rw-r--r--src/i830_lvds.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 4d9cb6be..ce6910fd 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -404,61 +404,47 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on)
struct i830_lvds_priv *dev_priv = intel_output->dev_priv;
ScrnInfoPtr pScrn = output->scrn;
I830Ptr pI830 = I830PTR(pScrn);
- CARD32 pp_status, ctl_reg, status_reg;
+ CARD32 pp_status, ctl_reg, status_reg, lvds_reg;
if (IS_IGDNG(pI830)) {
ctl_reg = PCH_PP_CONTROL;
status_reg = PCH_PP_STATUS;
+ lvds_reg = PCH_LVDS;
} else {
ctl_reg = PP_CONTROL;
status_reg = PP_STATUS;
- }
-
- if (IS_IGDNG(pI830)) {
- CARD32 temp;
- if (on) {
- temp = INREG(PCH_LVDS);
- OUTREG(PCH_LVDS, temp | PORT_ENABLE);
- temp = INREG(PCH_LVDS);
- } else {
- temp = INREG(PCH_LVDS);
- OUTREG(PCH_LVDS, temp & ~PORT_ENABLE);
- temp = INREG(PCH_LVDS);
- }
- usleep(100);
+ lvds_reg = LVDS;
}
if (on) {
- /*
- * If we're going from off->on we may need to turn on the backlight.
- * We should use the saved value whenever possible, but on some
- * machines 0 is a valid backlight value (due to an external backlight
- * controller for example), so on them, when turning LVDS back on,
- * they'll always re-maximize the brightness.
- */
+ OUTREG(lvds_reg, INREG(lvds_reg) | LVDS_PORT_EN);
+ INREG(lvds_reg);
+
if (!(INREG(ctl_reg) & POWER_TARGET_ON) &&
dev_priv->backlight_duty_cycle == 0)
dev_priv->backlight_duty_cycle = dev_priv->backlight_max;
OUTREG(ctl_reg, INREG(ctl_reg) | POWER_TARGET_ON);
+ INREG(ctl_reg);
do {
pp_status = INREG(status_reg);
} while ((pp_status & PP_ON) == 0);
+ /* set backlight */
dev_priv->set_backlight(output, dev_priv->backlight_duty_cycle);
} else {
- /*
- * Only save the current backlight value if we're going from
- * on to off.
- */
if (INREG(ctl_reg) & POWER_TARGET_ON)
dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output);
dev_priv->set_backlight(output, 0);
OUTREG(ctl_reg, INREG(ctl_reg) & ~POWER_TARGET_ON);
+ INREG(ctl_reg);
do {
pp_status = INREG(status_reg);
} while (pp_status & PP_ON);
+
+ OUTREG(lvds_reg, INREG(lvds_reg) & ~LVDS_PORT_EN);
+ INREG(lvds_reg);
}
}