summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jesse.barnes@intel.com>2008-01-11 10:28:59 -0800
committerJesse Barnes <jesse.barnes@intel.com>2008-01-11 10:28:59 -0800
commit4fec18e07f2b23306e885d63c74661ae0e4b04d9 (patch)
treec330df8dbeda9436de31ad4233c9384de433eec0
parentb5cf8faf8102e6313c23de87a680cc327ac95478 (diff)
downloadxorg-driver-xf86-video-intel-4fec18e07f2b23306e885d63c74661ae0e4b04d9.tar.gz
Turn on backlight when LVDS panel is powered up
In some configurations, the LVDS may be off at startup along with the backlight. So when turning the LVDS on for the first time, we may also need to set the backlight to a non-zero value. So try to use the saved value if possible, but if it's zero, make the backlight full brightness when turning on the LVDS. Note that this is slightly sub-optimal for configurations where zero is a valid backlight brightness. Fixes fdo bz #13958.
-rw-r--r--src/i830_lvds.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 50ecb606..ef8fa4a9 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -372,6 +372,17 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on)
CARD32 pp_status;
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.
+ */
+ if (!(INREG(PP_CONTROL) & POWER_TARGET_ON) &&
+ dev_priv->backlight_duty_cycle == 0)
+ dev_priv->backlight_duty_cycle = dev_priv->backlight_max;
+
OUTREG(PP_CONTROL, INREG(PP_CONTROL) | POWER_TARGET_ON);
do {
pp_status = INREG(PP_STATUS);