drm/i915: implement WaDisableDopClockGatingisable on VLV and IVB
authorJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 25 Oct 2012 19:15:42 +0000 (12:15 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 11 Nov 2012 22:51:34 +0000 (23:51 +0100)
v2: use correct register
v3: remove extra hunks, pull in register definitions & offset check directly
v4: add GT1 vs GT2 distinction for IVB portion (Ben)

References: https://bugs.freedesktop.org/show_bug.cgi?id=50233
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Antti Koskipää <antti.koskipaa@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_pm.c

index 4be4841854b058e424683868f1e41a56330ce6c5..ba74df2e2ff1b17d7566e763292a79fa414a4269 100644 (file)
@@ -1132,6 +1132,13 @@ static bool IS_DISPLAYREG(u32 reg)
        if (reg == GEN6_GDRST)
                return false;
 
+       switch (reg) {
+       case GEN7_ROW_CHICKEN2:
+               return false;
+       default:
+               break;
+       }
+
        return true;
 }
 
index 749e2d666fcae0e4039a0a7020acba1953af171d..4bce44ccd03eb9b4fcc8e1aa371d79431190cdf8 100644 (file)
@@ -1125,6 +1125,9 @@ struct drm_i915_file_private {
 #define IS_IRONLAKE_D(dev)     ((dev)->pci_device == 0x0042)
 #define IS_IRONLAKE_M(dev)     ((dev)->pci_device == 0x0046)
 #define IS_IVYBRIDGE(dev)      (INTEL_INFO(dev)->is_ivybridge)
+#define IS_IVB_GT1(dev)                ((dev)->pci_device == 0x0156 || \
+                                (dev)->pci_device == 0x0152 || \
+                                (dev)->pci_device == 0x015a)
 #define IS_VALLEYVIEW(dev)     (INTEL_INFO(dev)->is_valleyview)
 #define IS_HASWELL(dev)        (INTEL_INFO(dev)->is_haswell)
 #define IS_MOBILE(dev)         (INTEL_INFO(dev)->is_mobile)
index b0bb1a5985546b3df30025a64fb445d227e77919..5a1a984d74c9d3522a6d130ef5ade61388040d37 100644 (file)
 #define GEN7_L3LOG_BASE                        0xB070
 #define GEN7_L3LOG_SIZE                        0x80
 
+#define GEN7_ROW_CHICKEN2              0xe4f4
+#define GEN7_ROW_CHICKEN2_GT2          0xf4f4
+#define   DOP_CLOCK_GATING_DISABLE     (1<<0)
+
 #define G4X_AUD_VID_DID                        0x62020
 #define INTEL_AUDIO_DEVCL              0x808629FB
 #define INTEL_AUDIO_DEVBLC             0x80862801
index a9e2c546de9a1896559c8551d3bc73f6036f6ebe..aef23641fbcccab4e7f28bb3c112a7956f963bcd 100644 (file)
@@ -3600,7 +3600,14 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
        I915_WRITE(GEN7_L3CNTLREG1,
                        GEN7_WA_FOR_GEN7_L3_CONTROL);
        I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
-                       GEN7_WA_L3_CHICKEN_MODE);
+                  GEN7_WA_L3_CHICKEN_MODE);
+       if (IS_IVB_GT1(dev))
+               I915_WRITE(GEN7_ROW_CHICKEN2,
+                          _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
+       else
+               I915_WRITE(GEN7_ROW_CHICKEN2_GT2,
+                          _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
+
 
        /* WaForceL3Serialization */
        I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
@@ -3684,6 +3691,10 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
        I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
                   ~L3SQ_URB_READ_CAM_MATCH_DISABLE);
 
+       /* WaDisableDopClockGating */
+       I915_WRITE(GEN7_ROW_CHICKEN2,
+                  _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
+
        /* This is required by WaCatErrorRejectionIssue */
        I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
                   I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |