xf86-video-intel: src/i830_lvds.c

Jesse Barnes jbarnes at kemper.freedesktop.org
Wed Dec 5 08:10:22 PST 2007


 src/i830_lvds.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 6f92200db39a790c95c1fac64baf0bd41a70e481
Author: Jesse Barnes <jbarnes at hobbes.virtuousgeek.org>
Date:   Wed Dec 5 08:10:17 2007 -0800

    Fix backlight setting save/restore
    
    We need to save the current backlight value at LVDS init time, as well as when
    we change the DPMS setting.  Also, since 0 is a valid backlight value, don't
    set the backlight value to maximum at startup if the value happens to be zero.
    
    These fixes should make the backlight user experience much more consistent and
    hopefully less frustrating.

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 602a55d..c58a7e0 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -363,6 +363,12 @@ i830SetLVDSPanelPower(xf86OutputPtr output, Bool on)
 
 	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(PP_CONTROL) & POWER_TARGET_ON)
+	    dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output);
 	dev_priv->set_backlight(output, 0);
 
 	OUTREG(PP_CONTROL, INREG(PP_CONTROL) & ~POWER_TARGET_ON);
@@ -399,12 +405,6 @@ i830_lvds_save (xf86OutputPtr output)
     pI830->savePP_CYCLE = INREG(PP_CYCLE);
     pI830->saveBLC_PWM_CTL = INREG(BLC_PWM_CTL);
     dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output);
-
-    /*
-     * If the light is off at server startup, just make it full brightness
-     */
-    if (dev_priv->backlight_duty_cycle == 0)
-	dev_priv->backlight_duty_cycle = dev_priv->backlight_max;
 }
 
 static void
@@ -1015,7 +1015,7 @@ i830_lvds_init(ScrnInfoPtr pScrn)
 	break;
     }
 
-    dev_priv->backlight_duty_cycle = dev_priv->backlight_max;
+    dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output);
 
     return;
 


More information about the xorg-commit mailing list