Skip to contentSkip to conversation

Recent BDW workarounds

PATCH New Michel Thierry 1 participant 9 messages Jul 15, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Recent BDW workarounds

These workarounds are mainly for D/E/F steppings.
I didn't squash them, because we can eventually get rid of some of them.

Michel Thierry (8):
drm/i915: Add WaDisableFenceDestinationToSLM:bdw drm/i915: Add WaProgramL3SqcReg1Default:bdw drm/i915: Add WaDisableFfDopClockGating:bdw drm/i915: Add WaFlushCoherentL3CacheLinesAtContextSwitch:bdw drm/i915: Add WaHdcDisableFetchWhenMasked:bdw drm/i915: Add WaIncreaseTagClockTimer:bdw drm/i915: Add WaDisableInstructionShootdown:bdw drm/i915: Add WaDisableLSQCROPERFforOCL:bdw

 drivers/gpu/drm/i915/i915_reg.h | 16 ++++++++++++++++
 drivers/gpu/drm/i915/intel_pm.c | 30 +++++++++++++++++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.0
#1 lore raw

PATCH 1/8 drm/i915: Add WaDisableFenceDestinationToSLM:bdw

HDC_CHICKEN0 bit 14 (Fence Destination To SLM Disable) must be programmed by software to 1h (Disable) to work around a LSLM unit issue.

WaDisableFenceDestinationToSLM is only needed for BDW E,F step.

---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index ce70aa4..b8308cf 100644
@@ -4701,6 +4701,7 @@ enum punit_power_well {
 
 /* GEN8 chicken */
 #define HDC_CHICKEN0				0x7300
+#define  HDC_FENCE_DESTINATION_TO_SLM_DISABLE	(1<<14)
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
 
 /* WaCatErrorRejectionIssue */
drivers/gpu/drm/i915/intel_pm.c +2 -0
index 6e03851..2c3087f 100644
@@ -5449,9 +5449,11 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	/* Use Force Non-Coherent whenever executing a 3D context. This is a
 	 * workaround for for a possible hang in the unlikely event a TLB
 	 * invalidation occurs during a PSD flush.
+	 * WaDisableFenceDestinationToSLM:bdw
 	 */
 	I915_WRITE(HDC_CHICKEN0,
 		   I915_READ(HDC_CHICKEN0) |
+		   _MASKED_BIT_ENABLE(HDC_FENCE_DESTINATION_TO_SLM_DISABLE) |
 		   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT));
 
 	/* WaVSRefCountFullforceMissDisable:bdw */
Signature · 1 line
1.9.0
#2 lore raw

PATCH 2/8 drm/i915: Add WaProgramL3SqcReg1Default:bdw

In reply to Michel Thierry

For performance, program the default initial value of L3SqcReg1 on BDW to 0x784000:

L3SQ High Priority Credit Initialization = 2 (00001b). L3SQ General Priority Credit Initialization = 30 (01111b).

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++++
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index b8308cf..e813033 100644
@@ -4704,6 +4704,10 @@ enum punit_power_well {
 #define  HDC_FENCE_DESTINATION_TO_SLM_DISABLE	(1<<14)
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
 
+/* WaProgramL3SqcReg1Default */
+#define GEN8_L3SQCREG1				0xb100
+#define  GEN8_L3SQCREG1_DEFAULT_VALUE	0x784000
+
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
 #define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1<<11)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 2c3087f..8b9abf4 100644
@@ -5483,6 +5483,9 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	/* Wa4x4STCOptimizationDisable:bdw */
 	I915_WRITE(CACHE_MODE_1,
 		   _MASKED_BIT_ENABLE(GEN8_4x4_STC_OPTIMIZATION_DISABLE));
+
+	/* WaProgramL3SqcReg1Default:bdw */
+	I915_WRITE(GEN8_L3SQCREG1, GEN8_L3SQCREG1_DEFAULT_VALUE);
 }
 
 static void haswell_init_clock_gating(struct drm_device *dev)
Signature · 1 line
1.9.0
#3 lore raw

PATCH 3/8 drm/i915: Add WaDisableFfDopClockGating:bdw

In reply to Michel Thierry

Disable FF DOP clock gating.

---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 2 files changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index e813033..44e7f34 100644
@@ -5600,6 +5600,7 @@ enum punit_power_well {
 #define   GEN6_RC7			4
 
 #define GEN7_MISCCPCTL			(0x9424)
+#define   GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE	(1<<2)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
 /* IVYBRIDGE DPF */
drivers/gpu/drm/i915/intel_pm.c +4 -0
index 8b9abf4..6815680 100644
@@ -5486,6 +5486,10 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 
 	/* WaProgramL3SqcReg1Default:bdw */
 	I915_WRITE(GEN8_L3SQCREG1, GEN8_L3SQCREG1_DEFAULT_VALUE);
+
+	/* WaDisableFfDopClockGating:bdw */
+	I915_WRITE(GEN7_MISCCPCTL, I915_READ(GEN7_MISCCPCTL) &
+			~GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE);
 }
 
 static void haswell_init_clock_gating(struct drm_device *dev)
Signature · 1 line
1.9.0
#4 lore raw

PATCH 4/8 drm/i915: Add WaFlushCoherentL3CacheLinesAtContextSwitch:bdw

In reply to Michel Thierry

Coherent L3 cache lines are not getting flushed during context switch which is causing issues.

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 44e7f34..aaadf4a 100644
@@ -4708,6 +4708,9 @@ enum punit_power_well {
 #define GEN8_L3SQCREG1				0xb100
 #define  GEN8_L3SQCREG1_DEFAULT_VALUE	0x784000
 
+#define GEN8_L3SQCREG4				0xb118
+#define  GEN8_PIPELINE_FLUSH_COHERENT_LINES	(1<<21)
+
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
 #define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB	(1<<11)
drivers/gpu/drm/i915/intel_pm.c +4 -0
index 6815680..8bde0aa 100644
@@ -5490,6 +5490,10 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	/* WaDisableFfDopClockGating:bdw */
 	I915_WRITE(GEN7_MISCCPCTL, I915_READ(GEN7_MISCCPCTL) &
 			~GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE);
+
+	/* WaFlushCoherentL3CacheLinesAtContextSwitch:bdw */
+	I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
+			GEN8_PIPELINE_FLUSH_COHERENT_LINES);
 }
 
 static void haswell_init_clock_gating(struct drm_device *dev)
Signature · 1 line
1.9.0
#5 lore raw

PATCH 5/8 drm/i915: Add WaHdcDisableFetchWhenMasked:bdw

In reply to Michel Thierry

Set desired default value for HDCCHICKEN register for BDW platform.

---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index aaadf4a..55ea3bf 100644
@@ -4702,6 +4702,7 @@ enum punit_power_well {
 /* GEN8 chicken */
 #define HDC_CHICKEN0				0x7300
 #define  HDC_FENCE_DESTINATION_TO_SLM_DISABLE	(1<<14)
+#define  HDC_DONOT_FETCH_MEM_WHEN_MASKED		(1<<11)
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
 
 /* WaProgramL3SqcReg1Default */
drivers/gpu/drm/i915/intel_pm.c +2 -0
index 8bde0aa..b60fbd2 100644
@@ -5450,10 +5450,12 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	 * workaround for for a possible hang in the unlikely event a TLB
 	 * invalidation occurs during a PSD flush.
 	 * WaDisableFenceDestinationToSLM:bdw
+	 * WaHdcDisableFetchWhenMasked:bdw
 	 */
 	I915_WRITE(HDC_CHICKEN0,
 		   I915_READ(HDC_CHICKEN0) |
 		   _MASKED_BIT_ENABLE(HDC_FENCE_DESTINATION_TO_SLM_DISABLE) |
+		   _MASKED_BIT_ENABLE(HDC_DONOT_FETCH_MEM_WHEN_MASKED) |
 		   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT));
 
 	/* WaVSRefCountFullforceMissDisable:bdw */
Signature · 1 line
1.9.0
#6 lore raw

PATCH 6/8 drm/i915: Add WaIncreaseTagClockTimer:bdw

In reply to Michel Thierry

Workaround requires programing L3 tag clock timing register.

---
 drivers/gpu/drm/i915/i915_reg.h | 4 ++++
 drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
 2 files changed, 13 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index 55ea3bf..ff1acbe 100644
@@ -4709,6 +4709,10 @@ enum punit_power_well {
 #define GEN8_L3SQCREG1				0xb100
 #define  GEN8_L3SQCREG1_DEFAULT_VALUE	0x784000
 
+#define GEN8_L3CNTLREG1				0xb10c
+#define  GEN8_TAG_CLK_OFFTIME			(1<<23)
+#define  GEN8_TAG_CLK_OFFTIME_MASK		(~((1<<23) | (1<<22) | (1<<21) | (1<<20)))
+
 #define GEN8_L3SQCREG4				0xb118
 #define  GEN8_PIPELINE_FLUSH_COHERENT_LINES	(1<<21)
 
drivers/gpu/drm/i915/intel_pm.c +9 -0
index b60fbd2..64e3245 100644
@@ -5496,6 +5496,15 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	/* WaFlushCoherentL3CacheLinesAtContextSwitch:bdw */
 	I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
 			GEN8_PIPELINE_FLUSH_COHERENT_LINES);
+
+	/*
+	 * WaIncreaseTagClockTimer:bdw
+	 * This register is not masked and the default value is not all zero.
+	 * Use the mask with and to clear out bits 23:20.
+	 */
+	I915_WRITE(GEN8_L3CNTLREG1, (I915_READ(GEN8_L3CNTLREG1) &
+			GEN8_TAG_CLK_OFFTIME_MASK) |
+			GEN8_TAG_CLK_OFFTIME);
 }
 
 static void haswell_init_clock_gating(struct drm_device *dev)
Signature · 1 line
1.9.0
#7 lore raw

PATCH 7/8 drm/i915: Add WaDisableInstructionShootdown:bdw

In reply to Michel Thierry

Instruction Shootdown in ROW_CHICKEN must be disabled.

---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index ff1acbe..2f0c759 100644
@@ -5637,6 +5637,7 @@ enum punit_power_well {
 #define   GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE	(1<<3)
 
 #define GEN8_ROW_CHICKEN		0xe4f0
+#define   INSTRUCTION_SHOOTDOWN_DISABLE	(1<<9)
 #define   PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE	(1<<8)
 #define   STALL_DOP_GATING_DISABLE		(1<<5)
 
drivers/gpu/drm/i915/intel_pm.c +3 -1
index 64e3245..c16dcb3 100644
@@ -5405,8 +5405,10 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 		   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE));
 
 	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableInstructionShootdown:bdw */
+	/* FIXME: Unclear whether we really need these on production bdw. */
 	I915_WRITE(GEN8_ROW_CHICKEN,
+		   _MASKED_BIT_ENABLE(INSTRUCTION_SHOOTDOWN_DISABLE) |
 		   _MASKED_BIT_ENABLE(STALL_DOP_GATING_DISABLE));
 
 	/*
Signature · 1 line
1.9.0
#8 lore raw

PATCH 8/8 drm/i915: Add WaDisableLSQCROPERFforOCL:bdw

In reply to Michel Thierry

L3SQCREG4 LQSC RO PERF DIS must be programmed by software to 1h (Disable) to work around a Gsync Issue in HDC.

---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 2f0c759..9058ae4 100644
@@ -4714,6 +4714,7 @@ enum punit_power_well {
 #define  GEN8_TAG_CLK_OFFTIME_MASK		(~((1<<23) | (1<<22) | (1<<21) | (1<<20)))
 
 #define GEN8_L3SQCREG4				0xb118
+#define  GEN8_L3SQCREG4_LQSC_RO_PERF_DISABLE	(1<<27)
 #define  GEN8_PIPELINE_FLUSH_COHERENT_LINES	(1<<21)
 
 /* WaCatErrorRejectionIssue */
drivers/gpu/drm/i915/intel_pm.c +2 -0
index c16dcb3..41a438e 100644
@@ -5495,8 +5495,10 @@ static void gen8_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_MISCCPCTL, I915_READ(GEN7_MISCCPCTL) &
 			~GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE);
 
+	/* WaDisableLSQCROPERFforOCL:bdw */
 	/* WaFlushCoherentL3CacheLinesAtContextSwitch:bdw */
 	I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
+			GEN8_L3SQCREG4_LQSC_RO_PERF_DISABLE |
 			GEN8_PIPELINE_FLUSH_COHERENT_LINES);
 
 	/*
Signature · 1 line
1.9.0