aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_runtime_pm.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-05-13 16:41:30 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-05-23 14:11:14 -0400
commit70c2c184065e642642b563ae36ff3db682a5eee0 (patch)
tree62a9692ae22dd45759cd18555040f0e66c4448b7 /drivers/gpu/drm/i915/intel_runtime_pm.c
parent9f7eb31af2968a194b29f67ec10776685a81afc9 (diff)
drm/i915: Move SKL+ DBUF enable/disable to display core init/uninit
SKL and BXT have the same snippets of code for enabling disabling the DBUF. Extract those into helpers and move the calls from init/unit_cdclk() to the display core init/init since this stuff isn't really about cdclk. Also doing the enable twice shouldn't hurt since you're just setting the request bit again when it was already set. We can also toss in a few WARNs about the register values into skl_get_dpll0_vco() now that we know that things should always be sane there. Flatten skl_init_cdclk() while at it. v2: s/skl/gen9/ in function names (Imre) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1463172100-24715-12-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index fefe22c3c163..dc74f38d945f 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2176,6 +2176,28 @@ static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
2176 mutex_unlock(&power_domains->lock); 2176 mutex_unlock(&power_domains->lock);
2177} 2177}
2178 2178
2179static void gen9_dbuf_enable(struct drm_i915_private *dev_priv)
2180{
2181 I915_WRITE(DBUF_CTL, I915_READ(DBUF_CTL) | DBUF_POWER_REQUEST);
2182 POSTING_READ(DBUF_CTL);
2183
2184 udelay(10);
2185
2186 if (!(I915_READ(DBUF_CTL) & DBUF_POWER_STATE))
2187 DRM_ERROR("DBuf power enable timeout\n");
2188}
2189
2190static void gen9_dbuf_disable(struct drm_i915_private *dev_priv)
2191{
2192 I915_WRITE(DBUF_CTL, I915_READ(DBUF_CTL) & ~DBUF_POWER_REQUEST);
2193 POSTING_READ(DBUF_CTL);
2194
2195 udelay(10);
2196
2197 if (I915_READ(DBUF_CTL) & DBUF_POWER_STATE)
2198 DRM_ERROR("DBuf power disable timeout!\n");
2199}
2200
2179static void skl_display_core_init(struct drm_i915_private *dev_priv, 2201static void skl_display_core_init(struct drm_i915_private *dev_priv,
2180 bool resume) 2202 bool resume)
2181{ 2203{
@@ -2202,6 +2224,8 @@ static void skl_display_core_init(struct drm_i915_private *dev_priv,
2202 2224
2203 skl_init_cdclk(dev_priv); 2225 skl_init_cdclk(dev_priv);
2204 2226
2227 gen9_dbuf_enable(dev_priv);
2228
2205 if (resume && dev_priv->csr.dmc_payload) 2229 if (resume && dev_priv->csr.dmc_payload)
2206 intel_csr_load_program(dev_priv); 2230 intel_csr_load_program(dev_priv);
2207} 2231}
@@ -2213,6 +2237,8 @@ static void skl_display_core_uninit(struct drm_i915_private *dev_priv)
2213 2237
2214 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE); 2238 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
2215 2239
2240 gen9_dbuf_disable(dev_priv);
2241
2216 skl_uninit_cdclk(dev_priv); 2242 skl_uninit_cdclk(dev_priv);
2217 2243
2218 /* The spec doesn't call for removing the reset handshake flag */ 2244 /* The spec doesn't call for removing the reset handshake flag */
@@ -2257,6 +2283,9 @@ void bxt_display_core_init(struct drm_i915_private *dev_priv,
2257 mutex_unlock(&power_domains->lock); 2283 mutex_unlock(&power_domains->lock);
2258 2284
2259 broxton_init_cdclk(dev_priv); 2285 broxton_init_cdclk(dev_priv);
2286
2287 gen9_dbuf_enable(dev_priv);
2288
2260 broxton_ddi_phy_init(dev_priv); 2289 broxton_ddi_phy_init(dev_priv);
2261 2290
2262 broxton_cdclk_verify_state(dev_priv); 2291 broxton_cdclk_verify_state(dev_priv);
@@ -2274,6 +2303,9 @@ void bxt_display_core_uninit(struct drm_i915_private *dev_priv)
2274 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE); 2303 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
2275 2304
2276 broxton_ddi_phy_uninit(dev_priv); 2305 broxton_ddi_phy_uninit(dev_priv);
2306
2307 gen9_dbuf_disable(dev_priv);
2308
2277 broxton_uninit_cdclk(dev_priv); 2309 broxton_uninit_cdclk(dev_priv);
2278 2310
2279 /* The spec doesn't call for removing the reset handshake flag */ 2311 /* The spec doesn't call for removing the reset handshake flag */