Save/restore BLC_HIST_CTL as well at suspend/resume time; which allows
authorderaadt <deraadt@openbsd.org>
Tue, 3 Aug 2010 11:59:47 +0000 (11:59 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 3 Aug 2010 11:59:47 +0000 (11:59 +0000)
the x40 LCD to light up after unsuspend.
https://bugzilla.kernel.org/attachment.cgi?id=23409
https://bugzilla.kernel.org/show_bug.cgi?id=10985
ok oga

sys/dev/pci/drm/i915_drv.c
sys/dev/pci/drm/i915_drv.h

index 3bc7222..ea88e97 100644 (file)
@@ -5477,6 +5477,7 @@ inteldrm_save_display(struct inteldrm_softc *dev_priv)
                dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
                dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
                dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
+               dev_priv->saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL);
                if (IS_I965G(dev_priv))
                        dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
                if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
@@ -5571,6 +5572,7 @@ inteldrm_restore_display(struct inteldrm_softc *dev_priv)
        } else { 
                I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS);
                I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
+               I915_WRITE(BLC_HIST_CTL, dev_priv->saveBLC_HIST_CTL);
                I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
                I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
                I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
index 36b3e4d..2063f96 100644 (file)
@@ -1536,6 +1536,8 @@ read64(struct inteldrm_softc *dev_priv, bus_size_t off)
 #define   BACKLIGHT_DUTY_CYCLE_SHIFT           (0)
 #define   BACKLIGHT_DUTY_CYCLE_MASK            (0xffff)
 
+#define BLC_HIST_CTL           0x61260
+
 /* TV port control */
 #define TV_CTL                 0x68000
 /** Enables the TV encoder */