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.c41
1 files changed, 11 insertions, 30 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 34b3cbce..8f7044d9 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -510,68 +510,49 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on)
struct i830_lvds_priv *dev_priv = intel_output->dev_priv;
ScrnInfoPtr scrn = output->scrn;
intel_screen_private *intel = intel_get_screen_private(scrn);
- uint32_t pp_status, ctl_reg, status_reg;
+ uint32_t pp_status, ctl_reg, status_reg, lvds_reg;
if (IS_IGDNG(intel)) {
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(intel)) {
- 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 on->on, be aware to current level. */
- if ((INREG(ctl_reg) & POWER_TARGET_ON) && !dev_priv->dpmsoff)
- dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output);
+ OUTREG(lvds_reg, INREG(lvds_reg) | LVDS_PORT_EN);
+ INREG(lvds_reg);
- /*
- * 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.
- */
if (!(INREG(ctl_reg) & POWER_TARGET_ON) &&
dev_priv->backlight_duty_cycle == 0 &&
intel->backlight_control_method < BCM_KERNEL)
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);
dev_priv->dpmsoff = FALSE;
} else {
- /*
- * Only save the current backlight value if we're going from
- * on to off.
- */
if ((INREG(ctl_reg) & POWER_TARGET_ON) && !dev_priv->dpmsoff)
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);
dev_priv->dpmsoff = TRUE;
}
}