drm/i915: Change IVB WIZ hashing mode to 16x4
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 4 Feb 2014 19:59:19 +0000 (21:59 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Mar 2014 14:39:05 +0000 (15:39 +0100)
BSpec recommends using 8x4 hashing mode when MSAA is used. But in
practice 16x4 seems to have a slight edge in performance (on IVB and
HSW at least). So just use 16x4.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Antti Koskipää <antti.koskipaa@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_pm.c

index 071c17d408c85ca8a5cf255d1a64677d2bd53fe5..5e832b1fd9d62b7612d2c3ef3b120bc174be2971 100644 (file)
 # define ASYNC_FLIP_PERF_DISABLE                       (1 << 14)
 
 #define GEN6_GT_MODE   0x20d0
+#define GEN7_GT_MODE   0x7008
 #define   GEN6_WIZ_HASHING(hi, lo)                     (((hi) << 9) | ((lo) << 7))
 #define   GEN6_WIZ_HASHING_8x8                         GEN6_WIZ_HASHING(0, 0)
 #define   GEN6_WIZ_HASHING_8x4                         GEN6_WIZ_HASHING(0, 1)
index 08c1a756cdadb5e77811204a22840e86e2e56054..57101f2321fd8c7eabb43546da7577648516a22f 100644 (file)
@@ -4954,6 +4954,13 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
        I915_WRITE(CACHE_MODE_1,
                   _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
 
+       /*
+        * BSpec recommends 8x4 when MSAA is used,
+        * however in practice 16x4 seems fastest.
+        */
+       I915_WRITE(GEN7_GT_MODE,
+                  GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4);
+
        snpcr = I915_READ(GEN6_MBCUNIT_SNPCR);
        snpcr &= ~GEN6_MBC_SNPCR_MASK;
        snpcr |= GEN6_MBC_SNPCR_MED;