diff options
author | Owain G. Ainsworth <oga@openbsd.org> | 2011-09-08 22:00:13 +0100 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2011-09-08 22:00:13 +0100 |
commit | 02c4275215deb4154e39c2fcffee15d928f839b0 (patch) | |
tree | 3d2e77e56d620206c2086d81cc0b0e2b187719c4 /src/i830_lvds.c | |
parent | 88f08fab7f19077a17c78dad5cf9ea924874755a (diff) |
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.
Diffstat (limited to 'src/i830_lvds.c')
-rw-r--r-- | src/i830_lvds.c | 9 |
1 files 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; } |