Skip to contentSkip to conversation

Add SKL Workarounds

PATCH Applied Arun Siluvery 5 participants 14 messages Aug 3, 2015 – Nov 18, 2015

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

cover Add SKL Workarounds

The following WA are helping in resolving GPU hang observed with gem_ringfill and fbo-depth-array tests.

Arun Siluvery (2):
drm/i915:skl: Add WaEnableGapsTsvCreditFix drm/i915:gen9: Add disable gather at set shader w/a

 drivers/gpu/drm/i915/i915_reg.h         |  6 ++++++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_pm.c         |  6 ++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++++++
 4 files changed, 36 insertions(+)
Signature · 6 lines
1.9.1

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

PATCH 1/2 drm/i915:skl: Add WaEnableGapsTsvCreditFix

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
 #define GEN7_MISCCPCTL			(0x9424)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
 #define HSW_L3CDERRST11			0xB208 /* L3CD Error Status register 1 slice 1 */
drivers/gpu/drm/i915/intel_pm.c +6 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct drm_device *dev)
 		/* WaDisableLSQCROPERFforOCL:skl */
 		I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
 			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) {
+		I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) |
+					   GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
 }
 
 static void bxt_init_clock_gating(struct drm_device *dev)
Signature · 6 lines
1.9.1

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

Re: [PATCH v1 1/2] drm/i915:skl: Add WaEnableGapsTsvCreditFix

Quoted 29 lines · Arun Siluvery
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
 #define GEN7_MISCCPCTL			(0x9424)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
 #define HSW_L3CDERRST11			0xB208 /* L3CD Error Status register 1 slice 1 */
drivers/gpu/drm/i915/intel_pm.c +0 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct drm_device *dev)
 		/* WaDisableLSQCROPERFforOCL:skl */
 		I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |

drivers/gpu/drm/i915/intel_pm.c static void skl_init_clock_gating(struct drm_device *dev) · line 117

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
 			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) {
+		I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) |
+					   GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
 }
 
 static void bxt_init_clock_gating(struct drm_device *dev)

FWIW, the docs make it sound like BIOS should be doing this. Did you verify we actually don't have the bit set with more recent BKC?

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

Re: [PATCH v1 1/2] drm/i915:skl: Add WaEnableGapsTsvCreditFix

Quoted 39 lines · Ben Widawsky
Quoted 38 lines · Arun Siluvery
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
 #define GEN7_MISCCPCTL			(0x9424)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
 #define HSW_L3CDERRST11			0xB208 /* L3CD Error Status register 1 slice 1 */
drivers/gpu/drm/i915/intel_pm.c +6 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct drm_device *dev)
 		/* WaDisableLSQCROPERFforOCL:skl */
 		I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
 			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) {
+		I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) |
+					   GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
 }
 
Quoted 5 lines

drivers/gpu/drm/i915/intel_pm.c static void skl_init_clock_gating(struct drm_device *dev) · line 117

Quoted 1 line
drivers/gpu/drm/i915/intel_pm.c +0 -0
 static void bxt_init_clock_gating(struct drm_device *dev)

FWIW, the docs make it sound like BIOS should be doing this. Did you verify we actually don't have the bit set with more recent BKC?

I have pretty recent BIOS and the bit was not set.

Quoted 3 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90854

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

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

#4 lore raw

Re: [PATCH v1 1/2] drm/i915:skl: Add WaEnableGapsTsvCreditFix

Quoted 41 lines · Mika Kuoppala
Quoted 39 lines · Ben Widawsky
Quoted 38 lines · Arun Siluvery
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
  #define GEN7_MISCCPCTL			(0x9424)
  #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
  /* IVYBRIDGE DPF */
  #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
  #define HSW_L3CDERRST11			0xB208 /* L3CD Error Status register 1 slice 1 */
drivers/gpu/drm/i915/intel_pm.c +6 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct drm_device *dev)
  		/* WaDisableLSQCROPERFforOCL:skl */
  		I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
  			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) {
+		I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) |
+					   GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
  }
 
Quoted 7 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_pm.c static void skl_init_clock_gating(struct drm_device *dev) · line 117

Quoted 1 line
drivers/gpu/drm/i915/intel_pm.c +0 -0
  static void bxt_init_clock_gating(struct drm_device *dev)

FWIW, the docs make it sound like BIOS should be doing this. Did you verify we actually don't have the bit set with more recent BKC?

I have pretty recent BIOS and the bit was not set.

I checked about this, it should be done in driver.

regards
Arun

Quoted 15 lines
Quoted 4 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90854

Quoted 6 lines

--
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

#5 lore raw

Re: [PATCH v1 1/2] drm/i915:skl: Add WaEnableGapsTsvCreditFix

Quoted 48 lines · Arun
Quoted 47 lines · Mika Kuoppala
Quoted 44 lines · Ben Widawsky
Quoted 29 lines · Arun Siluvery
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
 #define GEN7_MISCCPCTL			(0x9424)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* L3CD Error Status 1 */
 #define HSW_L3CDERRST11			0xB208 /* L3CD Error Status register 1 slice 1 */
drivers/gpu/drm/i915/intel_pm.c +0 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct drm_device *dev)
 		/* WaDisableLSQCROPERFforOCL:skl */
 		I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |

drivers/gpu/drm/i915/intel_pm.c static void skl_init_clock_gating(struct drm_device *dev) · line 117

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
 			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) {
+		I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) |
+					   GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
 }
 
 static void bxt_init_clock_gating(struct drm_device *dev)

FWIW, the docs make it sound like BIOS should be doing this. Did you verify we actually don't have the bit set with more recent BKC?

Quoted 14 lines
Quoted 1 line

I have pretty recent BIOS and the bit was not set.

I checked about this, it should be done in driver.

regards
Arun

Quoted 7 lines
Quoted 4 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90854

Queued for -next, thanks for the patch.
-Daniel

Quoted 13 lines
Quoted 8 lines
Quoted 7 lines

--
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#6 lore raw

Re: [PATCH v1 1/2] drm/i915:skl: Add WaEnableGapsTsvCreditFix

Hi,

Just applying this patch is enough to make gem_ringfill --r render work on my SKL 2+2 DT GT2 system I have at Espoo. I do not need the second patch which seems to be required for Arun's SKL.

Also working with just that patch on one SKL Y system here at Egham office. It's some months older than Arun's SKL U.

Regards, Joonas

Quoted 71 lines · Daniel Vetter
Quoted 70 lines · Arun
Quoted 50 lines · Mika Kuoppala
Quoted 48 lines · Ben Widawsky
Quoted 47 lines · Arun Siluvery
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[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 77967ca..8991cd5 100644
@@ -6849,6 +6849,9 @@ enum skl_disp_power_wells {
 #define GEN7_MISCCPCTL			(0x9424)
 #define   GEN7_DOP_CLOCK_GATE_ENABLE	(1<<0)
 
+#define GEN8_GARBCNTL                   0xB004
+#define   GEN9_GAPS_TSV_CREDIT_DISABLE  (1<<7)
+
 /* IVYBRIDGE DPF */
 #define GEN7_L3CDERRST1			0xB008 /* 

L3CD Error Status 1 */
#define HSW_L3CDERRST11 0xB208 /*
L3CD Error Status register 1 slice 1 */

drivers/gpu/drm/i915/intel_pm.c +0 -0
index c23cab6..9152113 100644
@@ -106,6 +106,12 @@ static void skl_init_clock_gating(struct 
 drm_device *dev)
 		/* WaDisableLSQCROPERFforOCL:skl */
 		I915_WRITE(GEN8_L3SQCREG4, 

I915_READ(GEN8_L3SQCREG4) |

drivers/gpu/drm/i915/intel_pm.c +3 -0
 			   GEN8_LQSC_RO_PERF_DIS);
+
+	/* WaEnableGapsTsvCreditFix:skl */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= 

SKL_REVID_C0)) {

drivers/gpu/drm/i915/intel_pm.c +1 -0
+		I915_WRITE(GEN8_GARBCNTL, 

(I915_READ(GEN8_GARBCNTL) |

drivers/gpu/drm/i915/intel_pm.c +2 -0
+					  
 GEN9_GAPS_TSV_CREDIT_DISABLE));
+	}
 }
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

static void bxt_init_clock_gating(struct drm_device *dev)

FWIW, the docs make it sound like BIOS should be doing this. Did you verify we
actually don't have the bit set with more recent BKC?

I have pretty recent BIOS and the bit was not set.

I checked about this, it should be done in driver.

regards
Arun

Quoted 5 lines
Quoted 4 lines
Quoted 20 lines
Quoted 2 lines
Quoted 2 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90854

Queued for -next, thanks for the patch.
-Daniel

Quoted 13 lines
Quoted 8 lines
Quoted 7 lines

--
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

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

#7 lore raw

PATCH 2/2 drm/i915:gen9: Add disable gather at set shader w/a

In reply to Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h         |  3 +++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++++++
 3 files changed, 27 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 8991cd5..24b8bb9 100644
@@ -1720,7 +1720,9 @@ enum skl_disp_power_wells {
 #define   MEM_DISPLAY_A_TRICKLE_FEED_DISABLE (1<<2) /* 830/845 only */
 #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
 #define FW_BLC		0x020d8
+#define   GEN9_DISABLE_GATHER_AT_SET_SHADER    (1<<7)
 #define FW_BLC2		0x020dc
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)
 #define FW_BLC_SELF	0x020e0 /* 915+ only */
 #define   FW_BLC_SELF_EN_MASK      (1<<31)
 #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5838,7 @@ enum skl_disp_power_wells {
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
 #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
 # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
 #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +8 -0
index 9faad82..d3a03f3 100644
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
 	struct drm_device *dev = ring->dev;
 	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */
+	if (IS_SKYLAKE(dev)) {
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+
 	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
 	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
 	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +16 -0
index dcd1b8f..4fc4b5e 100644
@@ -985,6 +985,15 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
 		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
 	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(FW_BLC, GEN9_DISABLE_GATHER_AT_SET_SHADER);
+		WA_SET_BIT_MASKED(FW_BLC2, GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
 	return 0;
 }
 
@@ -1068,6 +1077,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
 				  HDC_FENCE_DEST_SLM_DISABLE |
 				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
 	return skl_tune_iz_hashing(ring);
 }
 
Signature · 6 lines
1.9.1

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

Re: [PATCH v1 2/2] drm/i915:gen9: Add disable gather at set shader w/a

Quoted 18 lines · Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h         |  3 +++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++++++
 3 files changed, 27 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 8991cd5..24b8bb9 100644

drivers/gpu/drm/i915/i915_reg.h enum skl_disp_power_wells { · line 1725

Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -1720,7 +1720,9 @@ enum skl_disp_power_wells {
 #define   MEM_DISPLAY_A_TRICKLE_FEED_DISABLE (1<<2) /* 830/845 only */
 #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
 #define FW_BLC		0x020d8
+#define   GEN9_DISABLE_GATHER_AT_SET_SHADER    (1<<7)
 #define FW_BLC2		0x020dc
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)

Neither of these belong here. BLC is for backlight. Create a new define if we don't have one.

#define RS_CHICKEN 0x20dc

Quoted 17 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
 #define FW_BLC_SELF	0x020e0 /* 915+ only */
 #define   FW_BLC_SELF_EN_MASK      (1<<31)
 #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5838,7 @@ enum skl_disp_power_wells {
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
 #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
 # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
 #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 9faad82..d3a03f3 100644
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
 	struct drm_device *dev = ring->dev;

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1302

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +8 -0
 	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */
+	if (IS_SKYLAKE(dev)) {
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+

Shouldn't this be for BXT as well? Also, why bother with the revid check below and not here?

Quoted 27 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
 	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
 	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
 	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +9 -0
index dcd1b8f..4fc4b5e 100644
@@ -985,6 +985,15 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
 		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
 	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(FW_BLC, GEN9_DISABLE_GATHER_AT_SET_SHADER);
+		WA_SET_BIT_MASKED(FW_BLC2, GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
 	return 0;
 }
 
@@ -1068,6 +1077,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
 				  HDC_FENCE_DEST_SLM_DISABLE |
 				  HDC_BARRIER_PERFORMANCE_DISABLE);
 

drivers/gpu/drm/i915/intel_ringbuffer.c static int skl_init_workarounds(struct intel_engine_cs *ring) · line 1089

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -0
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
 	return skl_tune_iz_hashing(ring);
 }
 

I wouldn't set both 20dc, and 20d8, I am not sure what implication it has. Instead, set or read bit 15 of 0x20e0 and then just set one. To me, it seems like the best way to do this is to set 1<<15 of 0x20e0, and then use bit 2 of 0x20dc for the workaround. We don't need per context controls of something we have to disable always anyway.

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

Re: [PATCH v1 2/2] drm/i915:gen9: Add disable gather at set shader w/a

Quoted 29 lines · Ben Widawsky
Quoted 18 lines · Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h         |  3 +++
  drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
  drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++++++
  3 files changed, 27 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 8991cd5..24b8bb9 100644

drivers/gpu/drm/i915/i915_reg.h enum skl_disp_power_wells { · line 1725

Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -1720,7 +1720,9 @@ enum skl_disp_power_wells {
  #define   MEM_DISPLAY_A_TRICKLE_FEED_DISABLE (1<<2) /* 830/845 only */
  #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
  #define FW_BLC		0x020d8
+#define   GEN9_DISABLE_GATHER_AT_SET_SHADER    (1<<7)
  #define FW_BLC2		0x020dc
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)

Neither of these belong here. BLC is for backlight. Create a new define if we don't have one.

Quoted 1 line

#define RS_CHICKEN 0x20dc

I thought of reusing existing define but created a new one as you suggested.

Quoted 20 lines
Quoted 20 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
  #define FW_BLC_SELF	0x020e0 /* 915+ only */
  #define   FW_BLC_SELF_EN_MASK      (1<<31)
  #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5838,7 @@ enum skl_disp_power_wells {
  # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
  # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
  #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
  # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
  #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 9faad82..d3a03f3 100644
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
  	struct drm_device *dev = ring->dev;
  	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
Quoted 11 lines

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1302

Quoted 8 lines
drivers/gpu/drm/i915/intel_lrc.c +8 -0
+	/* WA to reset "disable gather at set shader slice" bit */
+	if (IS_SKYLAKE(dev)) {
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+

Shouldn't this be for BXT as well? Also, why bother with the revid check below and not here?

spec says only SKL+

Quoted 28 lines
Quoted 28 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
  	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
  	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
  	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +9 -0
index dcd1b8f..4fc4b5e 100644
@@ -985,6 +985,15 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
  		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
  	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(FW_BLC, GEN9_DISABLE_GATHER_AT_SET_SHADER);
+		WA_SET_BIT_MASKED(FW_BLC2, GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
  	return 0;
  }
 
@@ -1068,6 +1077,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
  				  HDC_FENCE_DEST_SLM_DISABLE |
  				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
Quoted 17 lines

drivers/gpu/drm/i915/intel_ringbuffer.c static int skl_init_workarounds(struct intel_engine_cs *ring) · line 1089

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -0
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
  	return skl_tune_iz_hashing(ring);
  }
 

I wouldn't set both 20dc, and 20d8, I am not sure what implication it has. Instead, set or read bit 15 of 0x20e0 and then just set one. To me, it seems like the best way to do this is to set 1<<15 of 0x20e0, and then use bit 2 of 0x20dc for the workaround. We don't need per context controls of something we have to disable always anyway.

changed it to use 0x20e0

regards
Arun

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

#10 lore raw

PATCH v2 2/2 drm/i915:gen9: Add disable gather at set shader w/a

In reply to Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

v2: behaviour of disable gather at set shader bit can be specified by two different registers, use a better option (Ben).

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h         |  5 +++++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 ++++++++++++++++++
 3 files changed, 31 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 8991cd5..8719a5a 100644
@@ -1721,6 +1721,10 @@ enum skl_disp_power_wells {
 #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
 #define FW_BLC		0x020d8
 #define FW_BLC2		0x020dc
+#define GEN7_RS_CHICKEN  0x20DC
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)
+#define GEN7_FF_SLICE_CHICKEN1    0x20E0
+#define   GEN9_PER_CTX_DISABLE_GATHER_CONTROL  (1<<15)
 #define FW_BLC_SELF	0x020e0 /* 915+ only */
 #define   FW_BLC_SELF_EN_MASK      (1<<31)
 #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5840,7 @@ enum skl_disp_power_wells {
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
 #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
 # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
 #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +8 -0
index 9faad82..d3a03f3 100644
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
 	struct drm_device *dev = ring->dev;
 	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */
+	if (IS_SKYLAKE(dev)) {
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+
 	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
 	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
 	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +18 -0
index dcd1b8f..5e8e5f9 100644
@@ -985,6 +985,17 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
 		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
 	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if ((IS_SKYLAKE(dev) && INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(GEN7_FF_SLICE_CHICKEN1,
+				  GEN9_PER_CTX_DISABLE_GATHER_CONTROL);
+		WA_SET_BIT_MASKED(GEN7_RS_CHICKEN,
+				  GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
 	return 0;
 }
 
@@ -1068,6 +1079,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
 				  HDC_FENCE_DEST_SLM_DISABLE |
 				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
 	return skl_tune_iz_hashing(ring);
 }
 
Signature · 6 lines
1.9.1

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

Re: [PATCH v2 2/2] drm/i915:gen9: Add disable gather at set shader w/a

Quoted 45 lines · Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

v2: behaviour of disable gather at set shader bit can be specified by two different registers, use a better option (Ben).

Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h         |  5 +++++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 ++++++++++++++++++
 3 files changed, 31 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 8991cd5..8719a5a 100644
@@ -1721,6 +1721,10 @@ enum skl_disp_power_wells {
 #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
 #define FW_BLC		0x020d8
 #define FW_BLC2		0x020dc
+#define GEN7_RS_CHICKEN  0x20DC
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)
+#define GEN7_FF_SLICE_CHICKEN1    0x20E0
+#define   GEN9_PER_CTX_DISABLE_GATHER_CONTROL  (1<<15)
 #define FW_BLC_SELF	0x020e0 /* 915+ only */
 #define   FW_BLC_SELF_EN_MASK      (1<<31)
 #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5840,7 @@ enum skl_disp_power_wells {
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
 #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
 # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
 #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 9faad82..d3a03f3 100644
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
 	struct drm_device *dev = ring->dev;

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1302

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +8 -0
 	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */
+	if (IS_SKYLAKE(dev)) {
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+

The workaround is confusing because it says "SKL+, but explicitly excludes the next GEN, which leads me to believe it either shouldn't be SKL+ (it should be SKL), or we need it for BXT. We can always add it later if needed. Also, several of the ancillary bits do refer to BXT.

(Also, still confused why you don't do a revid check here, but if you do what I request below, we can ignore that).

Quoted 12 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
 	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
 	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
 	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -0
index dcd1b8f..5e8e5f9 100644
@@ -985,6 +985,17 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
 		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
 	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt

drivers/gpu/drm/i915/intel_ringbuffer.c static int gen9_init_workarounds(struct intel_engine_cs *ring) · line 998

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +10 -0
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if ((IS_SKYLAKE(dev) && INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(GEN7_FF_SLICE_CHICKEN1,
+				  GEN9_PER_CTX_DISABLE_GATHER_CONTROL);
+		WA_SET_BIT_MASKED(GEN7_RS_CHICKEN,
+				  GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+

This is a very poorly documented workaround... Reading this again, I believe this doesn't follow the text from the documentation and this hunk does the wrong thing. The text clearly states we must clear bit 12 of CS_COMMON2 to workaround the issue (before each context restore, but it shouldn't hurt to do it initially).

"If this field is set, Disable at Set Shader Common Slice in register 0x20DC bit 2 must also be set."

To clear this up even further, I think the reason these two registers are talked about is that the CS, or RS need to match the behavior for the common slice. Since the default is to always use the BTP for the streamers, and we're explicitly forcing the CS_COMMON to do the gather at BTP parsing, this has no meaning.

As we're explicitly clearing the field, I don't think we should be doing anything with RS_CHICKEN (20dc) or CS_DEBUG_MODE2 (20d8).

I tested on my platform with the hunk removed, and it seems to make no difference. (Interestingly, I learned that the patch before this is at least as important as this one). I did not test BXT.

So unless you can justify keeping this hunk, I'd like it gone, and the defines removed. Sorry for the churn. With that changed, I am happy with no REVID check too, so:

Quoted 17 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -0
 	return 0;
 }
 
@@ -1068,6 +1079,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
 				  HDC_FENCE_DEST_SLM_DISABLE |
 				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
 	return skl_tune_iz_hashing(ring);
 }
 
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH v2 2/2] drm/i915:gen9: Add disable gather at set shader w/a

In reply to Arun Siluvery
Quoted 7 lines · Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

v2: behaviour of disable gather at set shader bit can be specified by two different registers, use a better option (Ben).

For me it looks like there are 2 orthogonal goals for this patch.

I think the actual workaround should be one patch, the resetting of the set shader bit and the patch named accordingly.

Then the set shader initialization in a different patch, if there is justification for it (that I have not managed yet to find).

But lets concentrate on the workaround itself...

Quoted 37 lines
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h         |  5 +++++
 drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 18 ++++++++++++++++++
 3 files changed, 31 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 8991cd5..8719a5a 100644
@@ -1721,6 +1721,10 @@ enum skl_disp_power_wells {
 #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
 #define FW_BLC		0x020d8
 #define FW_BLC2		0x020dc
+#define GEN7_RS_CHICKEN  0x20DC
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)
+#define GEN7_FF_SLICE_CHICKEN1    0x20E0
+#define   GEN9_PER_CTX_DISABLE_GATHER_CONTROL  (1<<15)
 #define FW_BLC_SELF	0x020e0 /* 915+ only */
 #define   FW_BLC_SELF_EN_MASK      (1<<31)
 #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5840,7 @@ enum skl_disp_power_wells {
 # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
 # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
 #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
 # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
 #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 9faad82..d3a03f3 100644

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1295

Quoted 4 lines
drivers/gpu/drm/i915/intel_lrc.c +1 -0
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
 	struct drm_device *dev = ring->dev;
 	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */

I am thinking how we could also alert the reader that this workaround needs to be revisited when it has been given a name.
By adding WaNoName:skl,bxt along with the comment above?

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1296

Quoted 1 line
drivers/gpu/drm/i915/intel_lrc.c +1 -0
+	if (IS_SKYLAKE(dev)) {

As Ben noted, documentation is rather sparse. But the reference to previous problems with this bit being save/restored in wrong order, we can conclude that this should be for BXT also.

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1302

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +6 -0
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+

The actual value of 'disable set shader' is orthogonal and beyond scope of this Workaround so the rest should be strip out to different patch.

-Mika

Quoted 46 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
 	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
 	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
 	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +18 -0
index dcd1b8f..5e8e5f9 100644
@@ -985,6 +985,17 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
 		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
 	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if ((IS_SKYLAKE(dev) && INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(GEN7_FF_SLICE_CHICKEN1,
+				  GEN9_PER_CTX_DISABLE_GATHER_CONTROL);
+		WA_SET_BIT_MASKED(GEN7_RS_CHICKEN,
+				  GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
 	return 0;
 }
 
@@ -1068,6 +1079,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
 				  HDC_FENCE_DEST_SLM_DISABLE |
 				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
 	return skl_tune_iz_hashing(ring);
 }
 
Signature · 6 lines
1.9.1

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

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

#13 lore raw

Re: [PATCH v2 2/2] drm/i915:gen9: Add disable gather at set shader w/a

Quoted 10 lines · Mika Kuoppala
Quoted 7 lines · Arun Siluvery

This WA is implemented in init_context as well as WA batch init. There are also some dependent bits need to be set in other registers for this to be complete.

v2: behaviour of disable gather at set shader bit can be specified by two different registers, use a better option (Ben).

Quoted 8 lines

For me it looks like there are 2 orthogonal goals for this patch.

I think the actual workaround should be one patch, the resetting of the set shader bit and the patch named accordingly.

Then the set shader initialization in a different patch, if there is justification for it (that I have not managed yet to find).

I agree it needs to be split into two patches.

Quoted 55 lines

But lets concentrate on the workaround itself...

Quoted 37 lines
Cc Ben Widawsky <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h         |  5 +++++
  drivers/gpu/drm/i915/intel_lrc.c        |  8 ++++++++
  drivers/gpu/drm/i915/intel_ringbuffer.c | 18 ++++++++++++++++++
  3 files changed, 31 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 8991cd5..8719a5a 100644
@@ -1721,6 +1721,10 @@ enum skl_disp_power_wells {
  #define   MEM_DISPLAY_TRICKLE_FEED_DISABLE (1<<2) /* 85x only */
  #define FW_BLC		0x020d8
  #define FW_BLC2		0x020dc
+#define GEN7_RS_CHICKEN  0x20DC
+#define   GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER (1<<2)
+#define GEN7_FF_SLICE_CHICKEN1    0x20E0
+#define   GEN9_PER_CTX_DISABLE_GATHER_CONTROL  (1<<15)
  #define FW_BLC_SELF	0x020e0 /* 915+ only */
  #define   FW_BLC_SELF_EN_MASK      (1<<31)
  #define   FW_BLC_SELF_FIFO_MASK    (1<<16) /* 945 only */
@@ -5836,6 +5840,7 @@ enum skl_disp_power_wells {
  # define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC	((1<<10) | (1<<26))
  # define GEN9_RHWO_OPTIMIZATION_DISABLE		(1<<14)
  #define COMMON_SLICE_CHICKEN2			0x7014
+#define  GEN9_DISABLE_GATHER_SET_SHADER_SLICE   (1<<12)
  # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE	(1<<0)
 
  #define HIZ_CHICKEN					0x7018
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 9faad82..d3a03f3 100644

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1295

Quoted 4 lines
drivers/gpu/drm/i915/intel_lrc.c +1 -0
@@ -1292,6 +1292,14 @@ static int gen9_init_perctx_bb(struct intel_engine_cs *ring,
  	struct drm_device *dev = ring->dev;
  	uint32_t index = wa_ctx_start(wa_ctx, *offset, CACHELINE_DWORDS);
 
+	/* WA to reset "disable gather at set shader slice" bit */

I am thinking how we could also alert the reader that this workaround needs to be revisited when it has been given a name.
By adding WaNoName:skl,bxt along with the comment above?

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1296

Quoted 1 line
drivers/gpu/drm/i915/intel_lrc.c +1 -0
+	if (IS_SKYLAKE(dev)) {

As Ben noted, documentation is rather sparse. But the reference to previous problems with this bit being save/restored in wrong order, we can conclude that this should be for BXT also.

Quoted 10 lines

drivers/gpu/drm/i915/intel_lrc.c static int gen9_init_perctx_bb(struct intel_engine_cs *ring, · line 1302

Quoted 6 lines
drivers/gpu/drm/i915/intel_lrc.c +6 -0
+		wa_ctx_emit(batch, index, MI_LOAD_REGISTER_IMM(1));
+		wa_ctx_emit(batch, index, COMMON_SLICE_CHICKEN2);
+		wa_ctx_emit(batch, index,
+			    _MASKED_BIT_DISABLE(GEN9_DISABLE_GATHER_SET_SHADER_SLICE));
+	}
+

The actual value of 'disable set shader' is orthogonal and beyond scope of this Workaround so the rest should be strip out to different patch.

As you mentioned on irc we first need to know whether we need to disable the set shader or not (set ox7014[12:12] to 1), because the WA only talks about resetting this bit in per ctx batch. The following bits can be ignore if there is not need to set that bit in the first place.

with reference to gem_ringfill, on my system it only completes without any hang if I add this patch completely but on some system this patch doesn't seem to be necessary.

regards
Arun

Quoted 41 lines

-Mika

Quoted 39 lines
drivers/gpu/drm/i915/intel_lrc.c +0 -0
  	/* WaSetDisablePixMaskCammingAndRhwoInCommonSliceChicken:skl,bxt */
  	if ((IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_B0)) ||
  	    (IS_BROXTON(dev) && (INTEL_REVID(dev) == BXT_REVID_A0))) {
drivers/gpu/drm/i915/intel_ringbuffer.c +18 -0
index dcd1b8f..5e8e5f9 100644
@@ -985,6 +985,17 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring)
  		tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
  	WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
 
+	/* WA to gather at set shader - skl,bxt
+	 * These are dependent bits need to be set for the WA.
+	 */
+	if ((IS_SKYLAKE(dev) && INTEL_REVID(dev) > SKL_REVID_D0) ||
+	    (IS_BROXTON(dev) && INTEL_REVID(dev) > BXT_REVID_A0)) {
+		WA_SET_BIT_MASKED(GEN7_FF_SLICE_CHICKEN1,
+				  GEN9_PER_CTX_DISABLE_GATHER_CONTROL);
+		WA_SET_BIT_MASKED(GEN7_RS_CHICKEN,
+				  GEN9_RS_CHICKEN_DISABLE_GATHER_AT_SHADER);
+	}
+
  	return 0;
  }
 
@@ -1068,6 +1079,13 @@ static int skl_init_workarounds(struct intel_engine_cs *ring)
  				  HDC_FENCE_DEST_SLM_DISABLE |
  				  HDC_BARRIER_PERFORMANCE_DISABLE);
 
+	/* WA to Disable gather at set shader - skl
+	 * This bit needs to be reset in Per ctx WA batch and it is also
+	 * dependent on other bits in different register, all of them need
+	 * be set for the WA to be complete.
+	 */
+	WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2, GEN9_DISABLE_GATHER_SET_SHADER_SLICE);
+
  	return skl_tune_iz_hashing(ring);
  }
 
Quoted 8 lines
Quoted 7 lines

--
1.9.1

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

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