Commit b3780073 authored by Daniel Vetter's avatar Daniel Vetter Committed by Sasha Levin

Revert "drm/i915/ilk: Don't disable SSC source if it's in use"

[ Upstream commit 8c07eb68 ]

This reverts commit f165d283.

It breaks one of our CI systems. Quoting from Ville:

[   13.100979] [drm:ironlake_init_pch_refclk] has_panel 1 has_lvds 1 has_ck505 0 using_ssc_source 1
[   13.101413] ------------[ cut here ]------------
[   13.101429] kernel BUG at drivers/gpu/drm/i915/intel_display.c:8528!

"which is the 'BUG_ON(val != final)' at the end of ironlake_init_pch_refclk()."

Cc: stable@vger.kernel.org
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lyude <cpaul@redhat.com>
Cc: marius.c.vlad@intel.com
References: https://www.spinics.net/lists/dri-devel/msg109557.htmlAcked-by: default avatarLyude <cpaul@redhat.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 7a85bf9e
...@@ -7129,14 +7129,12 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -7129,14 +7129,12 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_encoder *encoder; struct intel_encoder *encoder;
int i;
u32 val, final; u32 val, final;
bool has_lvds = false; bool has_lvds = false;
bool has_cpu_edp = false; bool has_cpu_edp = false;
bool has_panel = false; bool has_panel = false;
bool has_ck505 = false; bool has_ck505 = false;
bool can_ssc = false; bool can_ssc = false;
bool using_ssc_source = false;
/* We need to take the global config into account */ /* We need to take the global config into account */
for_each_intel_encoder(dev, encoder) { for_each_intel_encoder(dev, encoder) {
...@@ -7163,22 +7161,8 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -7163,22 +7161,8 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
can_ssc = true; can_ssc = true;
} }
/* Check if any DPLLs are using the SSC source */ DRM_DEBUG_KMS("has_panel %d has_lvds %d has_ck505 %d\n",
for (i = 0; i < dev_priv->num_shared_dpll; i++) { has_panel, has_lvds, has_ck505);
u32 temp = I915_READ(PCH_DPLL(i));
if (!(temp & DPLL_VCO_ENABLE))
continue;
if ((temp & PLL_REF_INPUT_MASK) ==
PLLB_REF_INPUT_SPREADSPECTRUMIN) {
using_ssc_source = true;
break;
}
}
DRM_DEBUG_KMS("has_panel %d has_lvds %d has_ck505 %d using_ssc_source %d\n",
has_panel, has_lvds, has_ck505, using_ssc_source);
/* Ironlake: try to setup display ref clock before DPLL /* Ironlake: try to setup display ref clock before DPLL
* enabling. This is only under driver's control after * enabling. This is only under driver's control after
...@@ -7215,9 +7199,9 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -7215,9 +7199,9 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
final |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; final |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD;
} else } else
final |= DREF_CPU_SOURCE_OUTPUT_DISABLE; final |= DREF_CPU_SOURCE_OUTPUT_DISABLE;
} else if (using_ssc_source) { } else {
final |= DREF_SSC_SOURCE_ENABLE; final |= DREF_SSC_SOURCE_DISABLE;
final |= DREF_SSC1_ENABLE; final |= DREF_CPU_SOURCE_OUTPUT_DISABLE;
} }
if (final == val) if (final == val)
...@@ -7263,7 +7247,7 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -7263,7 +7247,7 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
POSTING_READ(PCH_DREF_CONTROL); POSTING_READ(PCH_DREF_CONTROL);
udelay(200); udelay(200);
} else { } else {
DRM_DEBUG_KMS("Disabling CPU source output\n"); DRM_DEBUG_KMS("Disabling SSC entirely\n");
val &= ~DREF_CPU_SOURCE_OUTPUT_MASK; val &= ~DREF_CPU_SOURCE_OUTPUT_MASK;
...@@ -7274,20 +7258,16 @@ static void ironlake_init_pch_refclk(struct drm_device *dev) ...@@ -7274,20 +7258,16 @@ static void ironlake_init_pch_refclk(struct drm_device *dev)
POSTING_READ(PCH_DREF_CONTROL); POSTING_READ(PCH_DREF_CONTROL);
udelay(200); udelay(200);
if (!using_ssc_source) { /* Turn off the SSC source */
DRM_DEBUG_KMS("Disabling SSC source\n"); val &= ~DREF_SSC_SOURCE_MASK;
val |= DREF_SSC_SOURCE_DISABLE;
/* Turn off the SSC source */
val &= ~DREF_SSC_SOURCE_MASK;
val |= DREF_SSC_SOURCE_DISABLE;
/* Turn off SSC1 */ /* Turn off SSC1 */
val &= ~DREF_SSC1_ENABLE; val &= ~DREF_SSC1_ENABLE;
I915_WRITE(PCH_DREF_CONTROL, val); I915_WRITE(PCH_DREF_CONTROL, val);
POSTING_READ(PCH_DREF_CONTROL); POSTING_READ(PCH_DREF_CONTROL);
udelay(200); udelay(200);
}
} }
BUG_ON(val != final); BUG_ON(val != final);
......
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