Skip to contentSkip to conversation

drm/i915: Lots of workaround changes

PATCH In review [email protected] 4 participants 37 messages Jul 5, 2013 – Aug 1, 2013

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

cover drm/i915: Lots of workaround changes

I was going over the workaround database with VLV mainly in mind, but I ended up stumbling on quite a few others as well.

This series adds the workarounds names in a bunch of places where we missed them, adds a few workarounds we seem to have missed, drops some that were never supposed to be there, and drops quite a few pre-production workarounds.

I'm not sure we want to drop some of the VLV workarounds quite yet. I know Jani will hate me when he comes back from vacation since his current machine would be affected.

I've run these on my VLV and IVB machines, and didn't spot any problems. The SNB and HSW ones I've not actually tested.

#1 lore raw

PATCH 1/30 drm/i915: We implement WaDisableL3Bank2xClockGate:vlv

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/intel_pm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +1 -0
index f675215..15c9c3b 100644
@@ -4887,6 +4887,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
 
+	/* WaDisableL3Bank2xClockGate:vlv */
 	I915_WRITE(GEN7_UCGCTL4, GEN7_L3BANK2X_CLOCK_GATE_DISABLE);
 
 	I915_WRITE(MI_ARB_VLV, MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/30 drm/i915: We implement WaGsvBringDownFreqInRc6:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaGsvBringDownFreqInRc6:vlv tells us to switch to RPe from a timer. Which is what we do.

There's another workaround by the name of WaGsvBringDownFreqBeforeRenderRC6:vlv which instructs us to keep render always awake, and then drop the freq to 200MHz and allow RC6 just before entering D3. That doesn't sound as nice, especially since we don't have runtime PM yet.

---
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +2 -0
index 15c9c3b..a160b4c 100644
@@ -3451,6 +3451,8 @@ static void vlv_rps_timer_work(struct work_struct *work)
 	 * Vmin we were shooting for.  That should give us better
 	 * perf when we come back out of RC6 than if we used the
 	 * min freq available.
+	 *
+	 * WaGsvBringDownFreqInRc6:vlv
 	 */
 	mutex_lock(&dev_priv->rps.hw_lock);
 	if (dev_priv->rps.cur_delay > dev_priv->rps.rpe_delay)
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/30 drm/i915: We implement WaEnableVGAAccessThroughIOPort:ctg, elk, ilk, snb, ivb, vlv, hsw

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 76796b1..fc2af13 100644
@@ -9624,6 +9624,7 @@ static void i915_disable_vga(struct drm_device *dev)
 	u8 sr1;
 	u32 vga_reg = i915_vgacntrl_reg(dev);
 
+	/* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
 	vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO);
 	outb(SR01, VGA_SR_INDEX);
 	sr1 = inb(VGA_SR_DATA);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH 4/30 drm/i915: WaPsdDispatchEnable seems to be another name for WaDisablePSDDualDispatchEnable

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

The w/a database lists both WaPsdDispatchEnable and WaDisablePSDDualDispatchEnable for VLV. They appear to be the same thing, so list both names.

---
 drivers/gpu/drm/i915/intel_pm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +1 -0
index a160b4c..9a562aa 100644
@@ -4835,6 +4835,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
 		   CHICKEN3_DGMG_DONE_FIX_DISABLE);
 
+	/* WaPsdDispatchEnable:vlv */
 	/* WaDisablePSDDualDispatchEnable:vlv */
 	I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
 		   _MASKED_BIT_ENABLE(GEN7_MAX_PS_THREAD_DEP |
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 5/30 drm/i915: We implement WaDisableL3CacheAging:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/intel_pm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +2 -1
index 9a562aa..2884a32 100644
@@ -4845,8 +4845,9 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
 		   GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
 
-	/* WaApplyL3ControlAndL3ChickenMode:vlv */
+	/* WaDisableL3CacheAging:vlv */
 	I915_WRITE(GEN7_L3CNTLREG1, I915_READ(GEN7_L3CNTLREG1) | GEN7_L3AGDIS);
+	/* WaApplyL3ControlAndL3ChickenMode:vlv */
 	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, GEN7_WA_L3_CHICKEN_MODE);
 
 	/* WaForceL3Serialization:vlv */
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 6/30 drm/i915: We implement WaDisableDopClockGating:ivb

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +2 -0
index 2884a32..69d4693 100644
@@ -4762,6 +4762,8 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 			GEN7_WA_FOR_GEN7_L3_CONTROL);
 	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
 		   GEN7_WA_L3_CHICKEN_MODE);
+
+	/* WaDisableDopClockGating:ivb */
 	if (IS_IVB_GT1(dev))
 		I915_WRITE(GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 7/30 drm/i915: We implement WaDisableRCCUnitClockGating:snb

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/intel_pm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +1 -0
index 69d4693..b6d8d81 100644
@@ -4581,6 +4581,7 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	 * but we didn't debug actual testcases to find it out.
 	 *
 	 * Also apply WaDisableVDSUnitClockGating:snb and
+	 * WaDisableRCCUnitClockGating:snb and
 	 * WaDisableRCPBUnitClockGating:snb.
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 8/30 drm/i915: We implement WaMiSetContext_Hang

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaMiSetContext_Hang tells us that a MI_NOOP must follow MI_SET_CONTEXT.

The other thing WaMiSetContext_Hang seems to say is that URB_FENCE isn't allowed to straddle two cachelines. But we don't issue those from the kernel so we don't care.

---
 drivers/gpu/drm/i915/i915_gem_context.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_context.c +4 -1
index 51b7a21..8ba2e2b 100644
@@ -382,7 +382,10 @@ mi_set_context(struct intel_ring_buffer *ring,
 			MI_SAVE_EXT_STATE_EN |
 			MI_RESTORE_EXT_STATE_EN |
 			hw_flags);
-	/* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */
+	/*
+	 * w/a: MI_SET_CONTEXT must always be followed by MI_NOOP
+	 * WaMiSetContext_Hang:snb,ivb,vlv
+	 */
 	intel_ring_emit(ring, MI_NOOP);
 
 	if (IS_GEN7(ring->dev))
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 08/30] drm/i915: We implement WaMiSetContext_Hang

Quoted 7 lines · On Fri, Jul 05, 2013 at 04:48:26PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

WaMiSetContext_Hang tells us that a MI_NOOP must follow MI_SET_CONTEXT.

The other thing WaMiSetContext_Hang seems to say is that URB_FENCE isn't allowed to straddle two cachelines. But we don't issue those from the kernel so we don't care.

URB_FENCE: Could be a cut'n'paste error from an earlier gen4 erratum? I don't recall that being documented after the erratum was fixed in later gen.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#10 lore raw

PATCH 9/30 drm/i915: Rename GEN7_MISCCPCTL to GEN6_MISCCPCTL

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

This register exists already on SNB.

---
 drivers/gpu/drm/i915/i915_gem.c   | 8 ++++----
 drivers/gpu/drm/i915/i915_irq.c   | 8 ++++----
 drivers/gpu/drm/i915/i915_reg.h   | 4 ++--
 drivers/gpu/drm/i915/i915_sysfs.c | 6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +4 -4
index 4200c32..83eebfa 100644
@@ -4039,9 +4039,9 @@ void i915_gem_l3_remap(struct drm_device *dev)
 	if (!dev_priv->l3_parity.remap_info)
 		return;
 
-	misccpctl = I915_READ(GEN7_MISCCPCTL);
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE);
-	POSTING_READ(GEN7_MISCCPCTL);
+	misccpctl = I915_READ(GEN6_MISCCPCTL);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl & ~GEN6_DOP_CLOCK_GATE_ENABLE);
+	POSTING_READ(GEN6_MISCCPCTL);
 
 	for (i = 0; i < GEN7_L3LOG_SIZE; i += 4) {
 		u32 remap = I915_READ(GEN7_L3LOG_BASE + i);
@@ -4056,7 +4056,7 @@ void i915_gem_l3_remap(struct drm_device *dev)
 	/* Make sure all the writes land before disabling dop clock gating */
 	POSTING_READ(GEN7_L3LOG_BASE);
 
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl);
 }
 
 void i915_gem_init_swizzling(struct drm_device *dev)
drivers/gpu/drm/i915/i915_irq.c +4 -4
index 4c1b1e3..08a1c4c 100644
@@ -765,9 +765,9 @@ static void ivybridge_parity_work(struct work_struct *work)
 	 */
 	mutex_lock(&dev_priv->dev->struct_mutex);
 
-	misccpctl = I915_READ(GEN7_MISCCPCTL);
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE);
-	POSTING_READ(GEN7_MISCCPCTL);
+	misccpctl = I915_READ(GEN6_MISCCPCTL);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl & ~GEN6_DOP_CLOCK_GATE_ENABLE);
+	POSTING_READ(GEN6_MISCCPCTL);
 
 	error_status = I915_READ(GEN7_L3CDERRST1);
 	row = GEN7_PARITY_ERROR_ROW(error_status);
@@ -778,7 +778,7 @@ static void ivybridge_parity_work(struct work_struct *work)
 				    GEN7_L3CDERRST1_ENABLE);
 	POSTING_READ(GEN7_L3CDERRST1);
 
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl);
 
 	spin_lock_irqsave(&dev_priv->irq_lock, flags);
 	dev_priv->gt_irq_mask &= ~GT_RENDER_L3_PARITY_ERROR_INTERRUPT;
drivers/gpu/drm/i915/i915_reg.h +2 -2
index af8b0eb..035ae03 100644
@@ -4593,8 +4593,8 @@
 #define   GEN6_RC6			3
 #define   GEN6_RC7			4
 
-#define GEN7_MISCCPCTL			(0x9424)
-#define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
+#define GEN6_MISCCPCTL			(0x9424)
+#define   GEN6_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
drivers/gpu/drm/i915/i915_sysfs.c +3 -3
index a777e7f..036fb26 100644
@@ -129,13 +129,13 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
 	if (ret)
 		return ret;
 
-	misccpctl = I915_READ(GEN7_MISCCPCTL);
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl & ~GEN7_DOP_CLOCK_GATE_ENABLE);
+	misccpctl = I915_READ(GEN6_MISCCPCTL);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl & ~GEN6_DOP_CLOCK_GATE_ENABLE);
 
 	for (i = offset; count >= 4 && i < GEN7_L3LOG_SIZE; i += 4, count -= 4)
 		*((uint32_t *)(&buf[i])) = I915_READ(GEN7_L3LOG_BASE + i);
 
-	I915_WRITE(GEN7_MISCCPCTL, misccpctl);
+	I915_WRITE(GEN6_MISCCPCTL, misccpctl);
 
 	mutex_unlock(&drm_dev->struct_mutex);
 
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH 10/30 drm/i915: Implement WaDisableDopClockGating:snb

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Certain SNB steppings need to disable DOP clock gating, and the only way to do that is to use the MISCCPCTL register.

Just disable it for every SNB, and then I suppose we may not have to worry about WaRevertDopClockGateFix2.

There's also another seemingly related workaround called WaForTogglingDopClkGatingBit, but there are no details to explain what needs to be done.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +4 -0
index b6d8d81..d18fb39 100644
@@ -4565,6 +4565,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(CACHE_MODE_0,
 		   _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
 
+	/* WaDisableDopClockGating:snb */
+	I915_WRITE(GEN6_MISCCPCTL, I915_READ(GEN6_MISCCPCTL) &
+		   ~GEN6_DOP_CLOCK_GATE_ENABLE);
+
 	I915_WRITE(GEN6_UCGCTL1,
 		   I915_READ(GEN6_UCGCTL1) |
 		   GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH 10/30] drm/i915: Implement WaDisableDopClockGating:snb

Quoted 7 lines · On Fri, Jul 05, 2013 at 04:48:28PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

Certain SNB steppings need to disable DOP clock gating, and the only way to do that is to use the MISCCPCTL register.

Just disable it for every SNB, and then I suppose we may not have to worry about WaRevertDopClockGateFix2.

Damien needs to refine the script to allow it to express when one wa excludes another :D

Quoted 32 lines

There's also another seemingly related workaround called WaForTogglingDopClkGatingBit, but there are no details to explain what needs to be done.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +4 -0
index b6d8d81..d18fb39 100644
@@ -4565,6 +4565,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(CACHE_MODE_0,
 		   _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
 
+	/* WaDisableDopClockGating:snb */
+	I915_WRITE(GEN6_MISCCPCTL, I915_READ(GEN6_MISCCPCTL) &
+		   ~GEN6_DOP_CLOCK_GATE_ENABLE);
+
 	I915_WRITE(GEN6_UCGCTL1,
 		   I915_READ(GEN6_UCGCTL1) |
 		   GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

Re: [PATCH 10/30] drm/i915: Implement WaDisableDopClockGating:snb

In reply to [email protected]
Quoted 4 lines · On Fri, Jul 05, 2013 at 04:48:28PM +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

Certain SNB steppings need to disable DOP clock gating, and the only way to do that is to use the MISCCPCTL register.

Based on some more research it appears we don't need this after all. It should only affect pre-production hardware.

Quoted 6 lines

Just disable it for every SNB, and then I suppose we may not have to worry about WaRevertDopClockGateFix2.

There's also another seemingly related workaround called WaForTogglingDopClkGatingBit, but there are no details to explain what needs to be done.

Which could mean we need to look into these two...

Quoted 23 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +4 -0
index b6d8d81..d18fb39 100644
@@ -4565,6 +4565,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(CACHE_MODE_0,
 		   _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
 
+	/* WaDisableDopClockGating:snb */
+	I915_WRITE(GEN6_MISCCPCTL, I915_READ(GEN6_MISCCPCTL) &
+		   ~GEN6_DOP_CLOCK_GATE_ENABLE);
+
 	I915_WRITE(GEN6_UCGCTL1,
 		   I915_READ(GEN6_UCGCTL1) |
 		   GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
Signature · 1 line
1.8.1.5
Signature · 2 lines
Ville Syrjälä
Intel OTC
#14 lore raw

PATCH 11/30 drm/i915: Fix IVB GT2 WaDisableDopClockGating and WaDisablePSDDualDispatchEnable

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

IVB GT2 has two registers for these things, and both must be written.

To add a bit more confusion both Bspec and the W/A database state that WaDisablePSDDualDispatchEnable is only needed for IVB GT1, but the W/A database also says to write even the second GT2 only register. So I don't really know what the right thing here is.

---
 drivers/gpu/drm/i915/intel_pm.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -3
index d18fb39..530eb6b 100644
@@ -4754,9 +4754,13 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	if (IS_IVB_GT1(dev))
 		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
 			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
-	else
+	else {
+		/* must write both registers */
+		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
+			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
 		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1_GT2,
 			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
+	}
 
 	/* Apply the WaDisableRHWOOptimizationForRenderHang:ivb workaround. */
 	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
@@ -4772,10 +4776,13 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	if (IS_IVB_GT1(dev))
 		I915_WRITE(GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
-	else
+	else {
+		/* must write both registers */
+		I915_WRITE(GEN7_ROW_CHICKEN2,
+			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 		I915_WRITE(GEN7_ROW_CHICKEN2_GT2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
-
+	}
 
 	/* WaForceL3Serialization:ivb */
 	I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

PATCH 12/30 drm/i915: Drop WaDisablePSDDualDispatchEnable:ivb for IVB GT2

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Both Bspec and the W/A database state that WaDisablePSDDualDispatchEnable is only needed for IVB GT1.

The only real confusion here is that the the W/A database also says to write to the GT2 only register as well, which is strange if the W/A is only for GT1.

---
 drivers/gpu/drm/i915/intel_pm.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -7
index 530eb6b..fe7f147 100644
@@ -4754,13 +4754,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	if (IS_IVB_GT1(dev))
 		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
 			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
-	else {
-		/* must write both registers */
-		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1,
-			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
-		I915_WRITE(GEN7_HALF_SLICE_CHICKEN1_GT2,
-			   _MASKED_BIT_ENABLE(GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
-	}
 
 	/* Apply the WaDisableRHWOOptimizationForRenderHang:ivb workaround. */
 	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#16 lore raw

PATCH 13/30 drm/i915: Implement WaIncreaseL3CreditsForVLVB0:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 035ae03..29172fb 100644
@@ -3775,6 +3775,9 @@
 #define GEN7_COMMON_SLICE_CHICKEN1		0x7010
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 
+#define GEN7_L3SQCREG1				0xB010
+#define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
+
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C4FFF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_pm.c +6 -0
index fe7f147..4483c25 100644
@@ -4907,6 +4907,12 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
 
 	/*
+	 * WaIncreaseL3CreditsForVLVB0:vlv
+	 * This is the hardware default actually.
+	 */
+	I915_WRITE(GEN7_L3SQCREG1, VLV_B0_WA_L3SQCREG1_VALUE);
+
+	/*
 	 * WaDisableVLVClockGating_VBIIssue:vlv
 	 * Disable clock gating on th GCFG unit to prevent a delay
 	 * in the reporting of vblank events.
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH 14/30 drm/i915: WaDisableVDSUnitClockGating isn't applicable to SNB

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Can't find any mention of WaDisableVDSUnitClockGating ever being relevant for SNB. Remove it.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -4
index 4483c25..b24a4c2 100644
@@ -4584,12 +4584,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	 * According to the spec, bit 11 (RCCUNIT) must also be set,
 	 * but we didn't debug actual testcases to find it out.
 	 *
-	 * Also apply WaDisableVDSUnitClockGating:snb and
-	 * WaDisableRCCUnitClockGating:snb and
-	 * WaDisableRCPBUnitClockGating:snb.
+	 * WaDisableRCCUnitClockGating:snb
+	 * WaDisableRCPBUnitClockGating:snb
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
-		   GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
 
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#18 lore raw

PATCH 15/30 drm/i915: WaDisableRCCUnitClockGating isn't applicable to IVB

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisableRCCUnitClockGating is only relevant for SNB.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +1 -5
index b24a4c2..576f648 100644
@@ -4786,15 +4786,11 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	 * Sanctuary and Tropics, and apparently anything else with
 	 * alpha test or pixel discard.
 	 *
-	 * According to the spec, bit 11 (RCCUNIT) must also be set,
-	 * but we didn't debug actual testcases to find it out.
-	 *
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
 	 * This implements the WaDisableRCZUnitClockGating:ivb workaround.
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
-		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
-		   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
+		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
 
 	/* This is required by WaCatErrorRejectionIssue:ivb */
 	I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw

PATCH 16/30 drm/i915: WaDisableRCCUnitClockGating isn't applicaple to VLV

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisableRCCUnitClockGating is only relevant for SNB.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +1 -5
index 576f648..82665d5 100644
@@ -4876,9 +4876,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	 * Sanctuary and Tropics, and apparently anything else with
 	 * alpha test or pixel discard.
 	 *
-	 * According to the spec, bit 11 (RCCUNIT) must also be set,
-	 * but we didn't debug actual testcases to find it out.
-	 *
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
 	 * This implements the WaDisableRCZUnitClockGating:vlv workaround.
 	 *
@@ -4889,8 +4886,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
 		   GEN7_TDLUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
-		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
-		   GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
+		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
 
 	/* WaDisableL3Bank2xClockGate:vlv */
 	I915_WRITE(GEN7_UCGCTL4, GEN7_L3BANK2X_CLOCK_GATE_DISABLE);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

PATCH 17/30 drm/i915: WaDisableRHWOOptimizationForRenderHang isn't applicable to HSW

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Can't find WaDisableRHWOOptimizationForRenderHang listed for HSW.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -4
index 82665d5..22f1053 100644
@@ -4690,10 +4690,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 	 */
 	I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
 
-	/* Apply the WaDisableRHWOOptimizationForRenderHang:hsw workaround. */
-	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
-		   GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
-
 	/* WaApplyL3ControlAndL3ChickenMode:hsw */
 	I915_WRITE(GEN7_L3CNTLREG1,
 			GEN7_WA_FOR_GEN7_L3_CONTROL);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#21 lore raw

PATCH 18/30 drm/i915: WaDisableRHWOOptimizationForRenderHang isn't applicable to VLV

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Can't find WaDisableRHWOOptimizationForRenderHang listed for VLV.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -4
index 22f1053..40393ef 100644
@@ -4838,10 +4838,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   _MASKED_BIT_ENABLE(GEN7_MAX_PS_THREAD_DEP |
 				      GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE));
 
-	/* Apply the WaDisableRHWOOptimizationForRenderHang:vlv workaround. */
-	I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
-		   GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
-
 	/* WaDisableL3CacheAging:vlv */
 	I915_WRITE(GEN7_L3CNTLREG1, I915_READ(GEN7_L3CNTLREG1) | GEN7_L3AGDIS);
 	/* WaApplyL3ControlAndL3ChickenMode:vlv */
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw

PATCH 19/30 drm/i915: WaApplyL3ControlAndL3ChickenMode isn't applicable for VLV

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaApplyL3ControlAndL3ChickenMode is only listed for IVB and HSW in W/A database and BSpec.

---
 drivers/gpu/drm/i915/intel_pm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -2
index 40393ef..6303041 100644
@@ -4840,8 +4840,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 
 	/* WaDisableL3CacheAging:vlv */
 	I915_WRITE(GEN7_L3CNTLREG1, I915_READ(GEN7_L3CNTLREG1) | GEN7_L3AGDIS);
-	/* WaApplyL3ControlAndL3ChickenMode:vlv */
-	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER, GEN7_WA_L3_CHICKEN_MODE);
 
 	/* WaForceL3Serialization:vlv */
 	I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

PATCH 20/30 drm/i915: Drop bogus comment about RCPB unit clock gating on IVB

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Someone copy pasted the comment from the SNB code w/o reading it. We never actually implemented the workaround to disable RCPB unit clock gating on IVB. It would have been needed for early steppings, but we don't care about those anymore, so just remove the stale comment.

---
 drivers/gpu/drm/i915/intel_pm.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +1 -7
index 6303041..d8f60e2 100644
@@ -4775,13 +4775,7 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
 		   ~L3SQ_URB_READ_CAM_MATCH_DISABLE);
 
-	/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
-	 * gating disable must be set.  Failure to set it results in
-	 * flickering pixels due to Z write ordering failures after
-	 * some amount of runtime in the Mesa "fire" demo, and Unigine
-	 * Sanctuary and Tropics, and apparently anything else with
-	 * alpha test or pixel discard.
-	 *
+	/*
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
 	 * This implements the WaDisableRCZUnitClockGating:ivb workaround.
 	 */
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw

PATCH 21/30 drm/i915: Drop WaDisableRCZUnitClockGating:hsw

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisableRCZUnitClockGating was needed with early HSW steppings only.

---
 drivers/gpu/drm/i915/intel_pm.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -5
index d8f60e2..8b6d3b3 100644
@@ -4685,11 +4685,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
-	 * This implements the WaDisableRCZUnitClockGating:hsw workaround.
-	 */
-	I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
-
 	/* WaApplyL3ControlAndL3ChickenMode:hsw */
 	I915_WRITE(GEN7_L3CNTLREG1,
 			GEN7_WA_FOR_GEN7_L3_CONTROL);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#25 lore raw

PATCH 22/30 drm/i915: Drop WaApplyL3ControlAndL3ChickenMode:hsw

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaApplyL3ControlAndL3ChickenMode is only relevant to early HSW steppings..

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -6
index 8b6d3b3..9cf09c6 100644
@@ -4685,12 +4685,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* WaApplyL3ControlAndL3ChickenMode:hsw */
-	I915_WRITE(GEN7_L3CNTLREG1,
-			GEN7_WA_FOR_GEN7_L3_CONTROL);
-	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
-			GEN7_WA_L3_CHICKEN_MODE);
-
 	/* This is required by WaCatErrorRejectionIssue:hsw */
 	I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
 			I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#26 lore raw

PATCH 23/30 drm/i915: Drop WaDisableRCPBUnitClockGating:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Only early VLV steppings needed thist. Should no longer be relevant.

---
 drivers/gpu/drm/i915/intel_pm.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +3 -11
index 9cf09c6..b11bb70 100644
@@ -4842,24 +4842,16 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 		   GEN6_MBCTL_ENABLE_BOOT_FETCH);
 
 
-	/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
-	 * gating disable must be set.  Failure to set it results in
-	 * flickering pixels due to Z write ordering failures after
-	 * some amount of runtime in the Mesa "fire" demo, and Unigine
-	 * Sanctuary and Tropics, and apparently anything else with
-	 * alpha test or pixel discard.
-	 *
+	/*
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
 	 * This implements the WaDisableRCZUnitClockGating:vlv workaround.
 	 *
-	 * Also apply WaDisableVDSUnitClockGating:vlv and
-	 * WaDisableRCPBUnitClockGating:vlv.
+	 * Also apply WaDisableVDSUnitClockGating:vlv.
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
 		   GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
 		   GEN7_TDLUNIT_CLOCK_GATE_DISABLE |
-		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE |
-		   GEN6_RCPBUNIT_CLOCK_GATE_DISABLE);
+		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
 
 	/* WaDisableL3Bank2xClockGate:vlv */
 	I915_WRITE(GEN7_UCGCTL4, GEN7_L3BANK2X_CLOCK_GATE_DISABLE);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#27 lore raw

PATCH 24/30 drm/i915: Drop WaDisableVDSUtnitClockGating:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisableVDSUtnitClockGating was only relevant for early steepings of VLV.

---
 drivers/gpu/drm/i915/intel_pm.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -3
index b11bb70..9153e6d 100644
@@ -4845,11 +4845,8 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	/*
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
 	 * This implements the WaDisableRCZUnitClockGating:vlv workaround.
-	 *
-	 * Also apply WaDisableVDSUnitClockGating:vlv.
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
-		   GEN7_VDSUNIT_CLOCK_GATE_DISABLE |
 		   GEN7_TDLUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
 
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#28 lore raw

PATCH 25/30 drm/i915: Drop WaDisableTDLUnitClockGating:vlv

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisableTDLUnitClockGating is only relevant for early steppings of VLV.

---
 drivers/gpu/drm/i915/intel_pm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +0 -1
index 9153e6d..847f6dc 100644
@@ -4847,7 +4847,6 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	 * This implements the WaDisableRCZUnitClockGating:vlv workaround.
 	 */
 	I915_WRITE(GEN6_UCGCTL2,
-		   GEN7_TDLUNIT_CLOCK_GATE_DISABLE |
 		   GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
 
 	/* WaDisableL3Bank2xClockGate:vlv */
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#29 lore raw

PATCH 26/30 drm/i915: gen7_setup_fixed_func_scheduler() actually implements WaVSThreadDispatchOverride

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

The current comments indicate that this function implements WaVSRefCountFullforceMissDisable, which is only true for HSW. The original purpose of the function is to implement WaVSThreadDispatchOverride (and a bit more). Fix up the comments to match reality.

---
 drivers/gpu/drm/i915/intel_pm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +7 -2
index 847f6dc..4ab8aeb 100644
@@ -4635,11 +4635,18 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
 {
 	uint32_t reg = I915_READ(GEN7_FF_THREAD_MODE);
 
+	/*
+	 * WaVSThreadDispatchOverride:ivb,hsw
+	 *
+	 * This actually overrides the dispatch
+	 * mode for all thread types.
+	 */
 	reg &= ~GEN7_FF_SCHED_MASK;
 	reg |= GEN7_FF_TS_SCHED_HW;
 	reg |= GEN7_FF_VS_SCHED_HW;
 	reg |= GEN7_FF_DS_SCHED_HW;
 
+	/* WaVSRefCountFullforceMissDisable:hsw */
 	if (IS_HASWELL(dev_priv->dev))
 		reg &= ~GEN7_FF_VS_REF_CNT_FFME;
 
@@ -4692,7 +4699,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 
 	g4x_disable_trickle_feed(dev);
 
-	/* WaVSRefCountFullforceMissDisable:hsw */
 	gen7_setup_fixed_func_scheduler(dev_priv);
 
 	/* WaDisable4x2SubspanOptimization:hsw */
@@ -4782,7 +4788,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
 		   GEN6_MBCTL_ENABLE_BOOT_FETCH);
 
-	/* WaVSRefCountFullforceMissDisable:ivb */
 	gen7_setup_fixed_func_scheduler(dev_priv);
 
 	/* WaDisable4x2SubspanOptimization:ivb */
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#30 lore raw

PATCH 27/30 drm/i915: Don't apply WaVSThreadDispatchOverride on HSW

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

BSpec states that the thread override values set by gen7_setup_fixed_func_scheduler() are invalid for HSW. So let's not muck around with them.

Since gen7_setup_fixed_func_scheduler() now has two totally independent parts, one for IVB and one for HSW, move the HSW part directly into haswell_init_clock_gating().

Note tht there's another workaround by the name of WaHSWVSRefCountFullforceMissDisable which basically claims that later steppings don't need the fix, but since WaVSRefCountFullforceMissDisable is listed to be needed for all steppings play it safe and keep applying the workaround.

---
 drivers/gpu/drm/i915/intel_pm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +4 -6
index 4ab8aeb..22cbe68 100644
@@ -4636,7 +4636,7 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
 	uint32_t reg = I915_READ(GEN7_FF_THREAD_MODE);
 
 	/*
-	 * WaVSThreadDispatchOverride:ivb,hsw
+	 * WaVSThreadDispatchOverride:ivb
 	 *
 	 * This actually overrides the dispatch
 	 * mode for all thread types.
@@ -4646,10 +4646,6 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
 	reg |= GEN7_FF_VS_SCHED_HW;
 	reg |= GEN7_FF_DS_SCHED_HW;
 
-	/* WaVSRefCountFullforceMissDisable:hsw */
-	if (IS_HASWELL(dev_priv->dev))
-		reg &= ~GEN7_FF_VS_REF_CNT_FFME;
-
 	I915_WRITE(GEN7_FF_THREAD_MODE, reg);
 }
 
@@ -4699,7 +4695,9 @@ static void haswell_init_clock_gating(struct drm_device *dev)
 
 	g4x_disable_trickle_feed(dev);
 
-	gen7_setup_fixed_func_scheduler(dev_priv);
+	/* WaVSRefCountFullforceMissDisable:hsw */
+	I915_WRITE(GEN7_FF_THREAD_MODE,
+		   I915_READ(GEN7_FF_THREAD_MODE) & ~GEN7_FF_VS_REF_CNT_FFME);
 
 	/* WaDisable4x2SubspanOptimization:hsw */
 	I915_WRITE(CACHE_MODE_1,
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#31 lore raw

PATCH 28/30 drm/i915: VLV wants WaVSThreadDispatchOverride too

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Call gen7_setup_fixed_func_scheduler() on VLV as well.

---
 drivers/gpu/drm/i915/intel_pm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +2 -1
index 22cbe68..49e4e0a 100644
@@ -4636,7 +4636,7 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv)
 	uint32_t reg = I915_READ(GEN7_FF_THREAD_MODE);
 
 	/*
-	 * WaVSThreadDispatchOverride:ivb
+	 * WaVSThreadDispatchOverride:ivb,vlv
 	 *
 	 * This actually overrides the dispatch
 	 * mode for all thread types.
@@ -4844,6 +4844,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
 		   GEN6_MBCTL_ENABLE_BOOT_FETCH);
 
+	gen7_setup_fixed_func_scheduler(dev_priv);
 
 	/*
 	 * According to the spec, bit 13 (RCZUNIT) must be set on IVB.
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#32 lore raw

PATCH 29/30 drm/i915: WaDisableDopClockGating isn't applicable to IVB

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

I can't see WaDisableDopClockGating listed for IVB in W/A database.

Also I'm not quite sure we were even disabling the right thing. Register 0x9424 has one DOP clock gating disable bit, amd 0xe4f4/0xf4f4 appears to have another one, but I don't actually know which is the one were suposed to frob. This question is more relevant for VLV where this workaround is still being applied via register 0xe4f4. Maybe it should actually use 0x9424 instead.

---
 drivers/gpu/drm/i915/intel_pm.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -12
index 49e4e0a..ce78928 100644
@@ -4752,18 +4752,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
 		   GEN7_WA_L3_CHICKEN_MODE);
 
-	/* WaDisableDopClockGating:ivb */
-	if (IS_IVB_GT1(dev))
-		I915_WRITE(GEN7_ROW_CHICKEN2,
-			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
-	else {
-		/* must write both registers */
-		I915_WRITE(GEN7_ROW_CHICKEN2,
-			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
-		I915_WRITE(GEN7_ROW_CHICKEN2_GT2,
-			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
-	}
-
 	/* WaForceL3Serialization:ivb */
 	I915_WRITE(GEN7_L3SQCREG4, I915_READ(GEN7_L3SQCREG4) &
 		   ~L3SQ_URB_READ_CAM_MATCH_DISABLE);
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#33 lore raw

PATCH 30/30 drm/i915: Clarify WaDisable4x2SubspanOptimization situation for VLV

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

WaDisable4x2SubspanOptimization isn't listed for VLV in the workaround database, but BSpec says that the relevant bit must be set. Add a comment to remind people of this.

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +4 -0
index ce78928..f1ff216 100644
@@ -4846,6 +4846,10 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
 
 	I915_WRITE(MI_ARB_VLV, MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
 
+	/*
+	 * BSpec says this must be set, even though
+	 * WaDisable4x2SubspanOptimization isn't listed for VLV.
+	 */
 	I915_WRITE(CACHE_MODE_1,
 		   _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));
 
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#34 lore raw
In reply to [email protected]
Quoted 8 lines · On Fri, Jul 05, 2013 at 04:48:18PM +0300, [email protected] wrote:

I was going over the workaround database with VLV mainly in mind, but I ended up stumbling on quite a few others as well.

This series adds the workarounds names in a bunch of places where we missed them, adds a few workarounds we seem to have missed, drops some that were never supposed to be there, and drops quite a few pre-production workarounds.

Quoted 6 lines

I'm not sure we want to drop some of the VLV workarounds quite yet. I know Jani will hate me when he comes back from vacation since his current machine would be affected.

I've run these on my VLV and IVB machines, and didn't spot any problems. The SNB and HSW ones I've not actually tested.

I have a sneaking suspicion at least a few of these will blow up once their in the wild. You're trusting the docs an awful lot. At least the patches seem quite bisectable though, so that's a saving grace.

One thing which might be interesting/compelling is some performance data (especially around places where you've removed unneeded workarounds).

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#35 lore raw
Quoted 13 lines · Ben Widawsky
Quoted 12 lines · On Fri, Jul 05, 2013 at 04:48:18PM +0300, [email protected] wrote:

I was going over the workaround database with VLV mainly in mind, but I ended up stumbling on quite a few others as well.

This series adds the workarounds names in a bunch of places where we missed them, adds a few workarounds we seem to have missed, drops some that were never supposed to be there, and drops quite a few pre-production workarounds.

I'm not sure we want to drop some of the VLV workarounds quite yet. I know Jani will hate me when he comes back from vacation since his current machine would be affected.

Quoted 6 lines
Quoted 2 lines

I've run these on my VLV and IVB machines, and didn't spot any problems. The SNB and HSW ones I've not actually tested.

I have a sneaking suspicion at least a few of these will blow up once their in the wild. You're trusting the docs an awful lot. At least the patches seem quite bisectable though, so that's a saving grace.

Yeah I wanted to keep them as isolated as possible just for that reason.

Quoted 2 lines

One thing which might be interesting/compelling is some performance data (especially around places where you've removed unneeded workarounds).

Some power consumption numbers migth be nice, since quite a few are clock gating related.

There are plenty of options to deal with the risk:
- Throw the patches away and pretend they never existed
- Merge them all and watch out for fireworks
- Drop a few of them into every kernel release to avoid too many regressions at once. I guess it'll take a few years get through the list this way.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#36 lore raw
Quoted 29 lines · Ville Syrjälä
Quoted 13 lines · Ben Widawsky
Quoted 12 lines · On Fri, Jul 05, 2013 at 04:48:18PM +0300, [email protected] wrote:

I was going over the workaround database with VLV mainly in mind, but I ended up stumbling on quite a few others as well.

This series adds the workarounds names in a bunch of places where we missed them, adds a few workarounds we seem to have missed, drops some that were never supposed to be there, and drops quite a few pre-production workarounds.

I'm not sure we want to drop some of the VLV workarounds quite yet. I know Jani will hate me when he comes back from vacation since his current machine would be affected.

Quoted 6 lines
Quoted 2 lines

I've run these on my VLV and IVB machines, and didn't spot any problems. The SNB and HSW ones I've not actually tested.

I have a sneaking suspicion at least a few of these will blow up once their in the wild. You're trusting the docs an awful lot. At least the patches seem quite bisectable though, so that's a saving grace.

Yeah I wanted to keep them as isolated as possible just for that reason.

Quoted 2 lines

One thing which might be interesting/compelling is some performance data (especially around places where you've removed unneeded workarounds).

Some power consumption numbers migth be nice, since quite a few are clock gating related.

Quoted 6 lines

There are plenty of options to deal with the risk:
- Throw the patches away and pretend they never existed
- Merge them all and watch out for fireworks
- Drop a few of them into every kernel release to avoid too many regressions at once. I guess it'll take a few years get through the list this way.

Imo review them again, drop them into dinq, see what happens. If they blow up we can yell at the Bsepc or w/a guys ;-)
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch