aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-03-05 14:19:52 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-17 17:30:16 -0400
commitfc1ac8dee1fe3d3155e8622e4d8e9130d88bc65b (patch)
treeac6a2222a0de9d68401ce2ec7fa2d53f3e64949b
parentcfb41411fce52a8e8b6c1f0bd253d4ca7bfcbd0d (diff)
drm/i915: Disable DDR DVFS on CHV
DDR DVFS introduces massive memory latencies which can't be handled by the PND deadline stuff. Instead the watermarks will need to be programmed to compensate for the latency and the deadlines will need to be programmed to tight fixed values. That means DDR DVFS can only be enabled if the display FIFOs are large enough, and that pretty much means we have to manually repartition them to suit the needs of the moment. That's a lot of change, so in the meantime let's just disable DDR DVFS to get the display(s) to be stable. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h5
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c34
2 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index b43de97f12da..495b22b4ec78 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -644,6 +644,11 @@ enum skl_disp_power_wells {
644#define FB_GFX_FMIN_AT_VMIN_FUSE 0x137 644#define FB_GFX_FMIN_AT_VMIN_FUSE 0x137
645#define FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT 8 645#define FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT 8
646 646
647#define PUNIT_REG_DDR_SETUP2 0x139
648#define FORCE_DDR_FREQ_REQ_ACK (1 << 8)
649#define FORCE_DDR_LOW_FREQ (1 << 1)
650#define FORCE_DDR_HIGH_FREQ (1 << 0)
651
647#define PUNIT_GPU_STATUS_REG 0xdb 652#define PUNIT_GPU_STATUS_REG 0xdb
648#define PUNIT_GPU_STATUS_MAX_FREQ_SHIFT 16 653#define PUNIT_GPU_STATUS_MAX_FREQ_SHIFT 16
649#define PUNIT_GPU_STATUS_MAX_FREQ_MASK 0xff 654#define PUNIT_GPU_STATUS_MAX_FREQ_MASK 0xff
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index e90ec21dd9b2..0e84558c053a 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -263,6 +263,28 @@ static const struct cxsr_latency *intel_get_cxsr_latency(int is_desktop,
263 return NULL; 263 return NULL;
264} 264}
265 265
266static void chv_set_memory_dvfs(struct drm_i915_private *dev_priv, bool enable)
267{
268 u32 val;
269
270 mutex_lock(&dev_priv->rps.hw_lock);
271
272 val = vlv_punit_read(dev_priv, PUNIT_REG_DDR_SETUP2);
273 if (enable)
274 val &= ~FORCE_DDR_HIGH_FREQ;
275 else
276 val |= FORCE_DDR_HIGH_FREQ;
277 val &= ~FORCE_DDR_LOW_FREQ;
278 val |= FORCE_DDR_FREQ_REQ_ACK;
279 vlv_punit_write(dev_priv, PUNIT_REG_DDR_SETUP2, val);
280
281 if (wait_for((vlv_punit_read(dev_priv, PUNIT_REG_DDR_SETUP2) &
282 FORCE_DDR_FREQ_REQ_ACK) == 0, 3))
283 DRM_ERROR("timed out waiting for Punit DDR DVFS request\n");
284
285 mutex_unlock(&dev_priv->rps.hw_lock);
286}
287
266static void chv_set_memory_pm5(struct drm_i915_private *dev_priv, bool enable) 288static void chv_set_memory_pm5(struct drm_i915_private *dev_priv, bool enable)
267{ 289{
268 u32 val; 290 u32 val;
@@ -310,6 +332,7 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable)
310 enable ? "enabled" : "disabled"); 332 enable ? "enabled" : "disabled");
311} 333}
312 334
335
313/* 336/*
314 * Latency for FIFO fetches is dependent on several factors: 337 * Latency for FIFO fetches is dependent on several factors:
315 * - memory configuration (speed, channels) 338 * - memory configuration (speed, channels)
@@ -1020,6 +1043,17 @@ static void valleyview_update_wm(struct drm_crtc *crtc)
1020 wm.pipe[pipe].primary, wm.pipe[pipe].cursor, 1043 wm.pipe[pipe].primary, wm.pipe[pipe].cursor,
1021 wm.sr.plane, wm.sr.cursor); 1044 wm.sr.plane, wm.sr.cursor);
1022 1045
1046 /*
1047 * FIXME DDR DVFS introduces massive memory latencies which
1048 * are not known to system agent so any deadline specified
1049 * by the display may not be respected. To support DDR DVFS
1050 * the watermark code needs to be rewritten to essentially
1051 * bypass deadline mechanism and rely solely on the
1052 * watermarks. For now disable DDR DVFS.
1053 */
1054 if (IS_CHERRYVIEW(dev_priv))
1055 chv_set_memory_dvfs(dev_priv, false);
1056
1023 if (!cxsr_enabled) 1057 if (!cxsr_enabled)
1024 intel_set_memory_cxsr(dev_priv, false); 1058 intel_set_memory_cxsr(dev_priv, false);
1025 1059