summaryrefslogtreecommitdiff
path: root/src/i830_lvds.c
diff options
context:
space:
mode:
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);
}
}