Commit 45ac22c8 authored by Li Peng's avatar Li Peng Committed by Eric Anholt

drm/i915: Turn on 945 self-refresh only if single CRTC is active

Enable self-refresh on 945 when just one CRTC is activated.
Otherwise user would get display flicker with dual display.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=27667Signed-off-by: default avatarLi Peng <peng.li@intel.com>
Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent c496fa1f
...@@ -4483,6 +4483,7 @@ static void intel_idle_update(struct work_struct *work) ...@@ -4483,6 +4483,7 @@ static void intel_idle_update(struct work_struct *work)
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct intel_crtc *intel_crtc; struct intel_crtc *intel_crtc;
int enabled = 0;
if (!i915_powersave) if (!i915_powersave)
return; return;
...@@ -4491,21 +4492,22 @@ static void intel_idle_update(struct work_struct *work) ...@@ -4491,21 +4492,22 @@ static void intel_idle_update(struct work_struct *work)
i915_update_gfx_val(dev_priv); i915_update_gfx_val(dev_priv);
if (IS_I945G(dev) || IS_I945GM(dev)) {
DRM_DEBUG_DRIVER("enable memory self refresh on 945\n");
I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN);
}
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
/* Skip inactive CRTCs */ /* Skip inactive CRTCs */
if (!crtc->fb) if (!crtc->fb)
continue; continue;
enabled++;
intel_crtc = to_intel_crtc(crtc); intel_crtc = to_intel_crtc(crtc);
if (!intel_crtc->busy) if (!intel_crtc->busy)
intel_decrease_pllclock(crtc); intel_decrease_pllclock(crtc);
} }
if ((enabled == 1) && (IS_I945G(dev) || IS_I945GM(dev))) {
DRM_DEBUG_DRIVER("enable memory self refresh on 945\n");
I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN);
}
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment