From 02c4275215deb4154e39c2fcffee15d928f839b0 Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Thu, 8 Sep 2011 22:00:13 +0100 Subject: backlight control buglet From kettenis@: Make sure we read the right register here, otherwise we'll think the backlight level is 0 and set it back to max when turning dpms back on. --- src/i830_lvds.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 3d3208e4..03f8a321 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -183,9 +183,14 @@ i830_lvds_get_backlight_native(xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; intel_screen_private *intel = intel_get_screen_private(scrn); - uint32_t blc_pwm_ctl; + uint32_t blc_pwm_ctl, reg; - blc_pwm_ctl = INREG(BLC_PWM_CTL); + if (IS_IGDNG(intel)) + reg = BLC_PWM_CPU_CTL; + else + reg = BLC_PWM_CTL; + + blc_pwm_ctl = INREG(reg); blc_pwm_ctl &= BACKLIGHT_DUTY_CYCLE_MASK; return blc_pwm_ctl; } -- cgit v1.2.3