diff options
author | Oscar Mateo <oscar.mateo@intel.com> | 2017-10-17 16:25:45 -0400 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2017-10-18 11:12:51 -0400 |
commit | dd00ed9eff1e1819922f91da965f0e57e6a94216 (patch) | |
tree | e3d61a3bc25f0de93365ac92e47c91cd6c412efe | |
parent | ca8d7822054287352c41ff38f656e68fef959732 (diff) |
drm/i915: Use a mask when applying WaProgramL3SqcReg1Default
Otherwise we are blasting other bits in GEN8_L3SQCREG1 that might be important
(although we probably aren't at the moment because 0 seems to be the default
for all the other bits).
v2: Extra parentheses (Michel)
Fixes: 050fc46 ("drm/i915:bxt: implement WaProgramL3SqcReg1DefaultForPerf")
Fixes: 450174f ("drm/i915/chv: Tune L3 SQC credits based on actual latencies")
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1508271945-14961-1-git-send-email-oscar.mateo@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 930a784d02339be437fec07b3bb7213bde0ed53b)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_engine_cs.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 9 |
3 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index ed7cd9ee2c2a..c9bcc6c45012 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -6998,6 +6998,7 @@ enum { | |||
6998 | */ | 6998 | */ |
6999 | #define L3_GENERAL_PRIO_CREDITS(x) (((x) >> 1) << 19) | 6999 | #define L3_GENERAL_PRIO_CREDITS(x) (((x) >> 1) << 19) |
7000 | #define L3_HIGH_PRIO_CREDITS(x) (((x) >> 1) << 14) | 7000 | #define L3_HIGH_PRIO_CREDITS(x) (((x) >> 1) << 14) |
7001 | #define L3_PRIO_CREDITS_MASK ((0x1f << 19) | (0x1f << 14)) | ||
7001 | 7002 | ||
7002 | #define GEN7_L3CNTLREG1 _MMIO(0xB01C) | 7003 | #define GEN7_L3CNTLREG1 _MMIO(0xB01C) |
7003 | #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C47FF8C | 7004 | #define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C47FF8C |
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c index 9ab596941372..3c2d9cf22ed5 100644 --- a/drivers/gpu/drm/i915/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/intel_engine_cs.c | |||
@@ -1048,9 +1048,12 @@ static int bxt_init_workarounds(struct intel_engine_cs *engine) | |||
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | /* WaProgramL3SqcReg1DefaultForPerf:bxt */ | 1050 | /* WaProgramL3SqcReg1DefaultForPerf:bxt */ |
1051 | if (IS_BXT_REVID(dev_priv, BXT_REVID_B0, REVID_FOREVER)) | 1051 | if (IS_BXT_REVID(dev_priv, BXT_REVID_B0, REVID_FOREVER)) { |
1052 | I915_WRITE(GEN8_L3SQCREG1, L3_GENERAL_PRIO_CREDITS(62) | | 1052 | u32 val = I915_READ(GEN8_L3SQCREG1); |
1053 | L3_HIGH_PRIO_CREDITS(2)); | 1053 | val &= ~L3_PRIO_CREDITS_MASK; |
1054 | val |= L3_GENERAL_PRIO_CREDITS(62) | L3_HIGH_PRIO_CREDITS(2); | ||
1055 | I915_WRITE(GEN8_L3SQCREG1, val); | ||
1056 | } | ||
1054 | 1057 | ||
1055 | /* WaToEnableHwFixForPushConstHWBug:bxt */ | 1058 | /* WaToEnableHwFixForPushConstHWBug:bxt */ |
1056 | if (IS_BXT_REVID(dev_priv, BXT_REVID_C0, REVID_FOREVER)) | 1059 | if (IS_BXT_REVID(dev_priv, BXT_REVID_C0, REVID_FOREVER)) |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index ed662937ec3c..0a09f8ff6aff 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -8245,14 +8245,17 @@ static void gen8_set_l3sqc_credits(struct drm_i915_private *dev_priv, | |||
8245 | int high_prio_credits) | 8245 | int high_prio_credits) |
8246 | { | 8246 | { |
8247 | u32 misccpctl; | 8247 | u32 misccpctl; |
8248 | u32 val; | ||
8248 | 8249 | ||
8249 | /* WaTempDisableDOPClkGating:bdw */ | 8250 | /* WaTempDisableDOPClkGating:bdw */ |
8250 | misccpctl = I915_READ(GEN7_MISCCPCTL); | 8251 | misccpctl = I915_READ(GEN7_MISCCPCTL); |
8251 | I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE); | 8252 | I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE); |
8252 | 8253 | ||
8253 | I915_WRITE(GEN8_L3SQCREG1, | 8254 | val = I915_READ(GEN8_L3SQCREG1); |
8254 | L3_GENERAL_PRIO_CREDITS(general_prio_credits) | | 8255 | val &= ~L3_PRIO_CREDITS_MASK; |
8255 | L3_HIGH_PRIO_CREDITS(high_prio_credits)); | 8256 | val |= L3_GENERAL_PRIO_CREDITS(general_prio_credits); |
8257 | val |= L3_HIGH_PRIO_CREDITS(high_prio_credits); | ||
8258 | I915_WRITE(GEN8_L3SQCREG1, val); | ||
8256 | 8259 | ||
8257 | /* | 8260 | /* |
8258 | * Wait at least 100 clocks before re-enabling clock gating. | 8261 | * Wait at least 100 clocks before re-enabling clock gating. |