aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-12-09 14:33:00 -0500
committerKeith Packard <keithp@keithp.com>2012-01-03 12:09:45 -0500
commitc7dffff7cc8de748edf0e9f6571cdabecb198705 (patch)
treee897b2a9c0f5313ad1b8bc494e4b19abca6c5314 /drivers
parent4d85529d584856d077895a2daa703224d3aee7e1 (diff)
drm/i915: Clean up multi-threaded forcewake patch
We learned that the ECOBUS register was inside the GT power well, and so *did* need force wake to be read, so it gets removed from the list of 'doesn't need force wake' registers. That means the code reading ECOBUS after forcing the mt_force_wake function to be called needs to use I915_READ_NOTRACE; it doesn't need to do more force wake fun as it's already done it manually. This also adds a comment explaining why the MT forcewake testing code only needs to call mt_forcewake_get/put and not disable RC6 manually -- the ECOBUS read will return 0 if the device is in RC6 and isn't using MT forcewake, causing the test to work correctly. Signed-off-by: Keith Packard <keithp@keithp.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c7
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/intel_display.c8
3 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 22c8ab70db2..8f7187915b0 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -923,13 +923,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
923MODULE_DESCRIPTION(DRIVER_DESC); 923MODULE_DESCRIPTION(DRIVER_DESC);
924MODULE_LICENSE("GPL and additional rights"); 924MODULE_LICENSE("GPL and additional rights");
925 925
926/* We give fast paths for the really cool registers */
927#define NEEDS_FORCE_WAKE(dev_priv, reg) \
928 (((dev_priv)->info->gen >= 6) && \
929 ((reg) < 0x40000) && \
930 ((reg) != FORCEWAKE) && \
931 ((reg) != ECOBUS))
932
933#define __i915_read(x, y) \ 926#define __i915_read(x, y) \
934u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ 927u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \
935 u##x val = 0; \ 928 u##x val = 0; \
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 505af3f64a0..621840c05f0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1364,8 +1364,7 @@ void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv);
1364#define NEEDS_FORCE_WAKE(dev_priv, reg) \ 1364#define NEEDS_FORCE_WAKE(dev_priv, reg) \
1365 (((dev_priv)->info->gen >= 6) && \ 1365 (((dev_priv)->info->gen >= 6) && \
1366 ((reg) < 0x40000) && \ 1366 ((reg) < 0x40000) && \
1367 ((reg) != FORCEWAKE) && \ 1367 ((reg) != FORCEWAKE))
1368 ((reg) != ECOBUS))
1369 1368
1370#define __i915_read(x, y) \ 1369#define __i915_read(x, y) \
1371 u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg); 1370 u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index cb21d5bbecc..ff99fa267bf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8591,9 +8591,15 @@ static void intel_init_display(struct drm_device *dev)
8591 if (IS_IVYBRIDGE(dev)) { 8591 if (IS_IVYBRIDGE(dev)) {
8592 u32 ecobus; 8592 u32 ecobus;
8593 8593
8594 /* A small trick here - if the bios hasn't configured MT forcewake,
8595 * and if the device is in RC6, then force_wake_mt_get will not wake
8596 * the device and the ECOBUS read will return zero. Which will be
8597 * (correctly) interpreted by the test below as MT forcewake being
8598 * disabled.
8599 */
8594 mutex_lock(&dev->struct_mutex); 8600 mutex_lock(&dev->struct_mutex);
8595 __gen6_gt_force_wake_mt_get(dev_priv); 8601 __gen6_gt_force_wake_mt_get(dev_priv);
8596 ecobus = I915_READ(ECOBUS); 8602 ecobus = I915_READ_NOTRACE(ECOBUS);
8597 __gen6_gt_force_wake_mt_put(dev_priv); 8603 __gen6_gt_force_wake_mt_put(dev_priv);
8598 mutex_unlock(&dev->struct_mutex); 8604 mutex_unlock(&dev->struct_mutex);
8599 8605