|
@@ -14729,6 +14729,30 @@ static bool intel_crt_present(struct drm_device *dev)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+void intel_pps_unlock_regs_wa(struct drm_i915_private *dev_priv)
|
|
|
+{
|
|
|
+ int pps_num;
|
|
|
+ int pps_idx;
|
|
|
+
|
|
|
+ if (HAS_DDI(dev_priv))
|
|
|
+ return;
|
|
|
+ /*
|
|
|
+ * This w/a is needed at least on CPT/PPT, but to be sure apply it
|
|
|
+ * everywhere where registers can be write protected.
|
|
|
+ */
|
|
|
+ if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
|
|
|
+ pps_num = 2;
|
|
|
+ else
|
|
|
+ pps_num = 1;
|
|
|
+
|
|
|
+ for (pps_idx = 0; pps_idx < pps_num; pps_idx++) {
|
|
|
+ u32 val = I915_READ(PP_CONTROL(pps_idx));
|
|
|
+
|
|
|
+ val = (val & ~PANEL_UNLOCK_MASK) | PANEL_UNLOCK_REGS;
|
|
|
+ I915_WRITE(PP_CONTROL(pps_idx), val);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void intel_pps_init(struct drm_i915_private *dev_priv)
|
|
|
{
|
|
|
if (HAS_PCH_SPLIT(dev_priv) || IS_BROXTON(dev_priv))
|
|
@@ -14737,6 +14761,8 @@ static void intel_pps_init(struct drm_i915_private *dev_priv)
|
|
|
dev_priv->pps_mmio_base = VLV_PPS_BASE;
|
|
|
else
|
|
|
dev_priv->pps_mmio_base = PPS_BASE;
|
|
|
+
|
|
|
+ intel_pps_unlock_regs_wa(dev_priv);
|
|
|
}
|
|
|
|
|
|
static void intel_setup_outputs(struct drm_device *dev)
|