From: deraadt Date: Tue, 3 Aug 2010 11:59:47 +0000 (+0000) Subject: Save/restore BLC_HIST_CTL as well at suspend/resume time; which allows X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0a97510cc4cd405bd5082119809c72a75e370579;p=openbsd Save/restore BLC_HIST_CTL as well at suspend/resume time; which allows 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 --- diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 3bc7222a443..ea88e97fa89 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -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); diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h index 36b3e4d442e..2063f969788 100644 --- a/sys/dev/pci/drm/i915_drv.h +++ b/sys/dev/pci/drm/i915_drv.h @@ -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 */