drm/i915/bdw: Don't use forcewake needlessly
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 13 Dec 2013 11:26:20 +0000 (13:26 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 13 Dec 2013 16:48:28 +0000 (17:48 +0100)
Not all registers need forcewake even if they're not shadowed.
Add the missing check to gen8_writeX() to avoid needless forcewake
usage when writing eg. display registers.

v2: Use straight up <0x40000 check instead of NEEDS_FORCE_WAKE()

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_uncore.c

index 32527a74dc469fed7b8e03eced4c0e22415a9de3..2c8143c37de350b153572242b0586838432e0e6c 100644 (file)
@@ -634,7 +634,7 @@ static bool is_gen8_shadowed(struct drm_i915_private *dev_priv, u32 reg)
 #define __gen8_write(x) \
 static void \
 gen8_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \
-       bool __needs_put = !is_gen8_shadowed(dev_priv, reg); \
+       bool __needs_put = reg < 0x40000 && !is_gen8_shadowed(dev_priv, reg); \
        REG_WRITE_HEADER; \
        if (__needs_put) { \
                dev_priv->uncore.funcs.force_wake_get(dev_priv, \