Skip to contentSkip to conversation

drm/i915: Add IS_BDW_GT3 macro.

PATCH Applied Rodrigo Vivi 9 participants 29 messages Sep 20, 2014 – Oct 19, 2014

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/5 drm/i915: Add IS_BDW_GT3 macro.

It will be usefull to specify w/a that affects only BDW GT3.

---
 drivers/gpu/drm/i915/i915_drv.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 5fce16c..a00214e 100644
@@ -2099,6 +2099,8 @@ struct drm_i915_cmd_table {
 				 ((INTEL_DEVID(dev) & 0xf) == 0x2  || \
 				 (INTEL_DEVID(dev) & 0xf) == 0x6 || \
 				 (INTEL_DEVID(dev) & 0xf) == 0xe))
+#define IS_BDW_GT3(dev)		(IS_BROADWELL(dev) && \
+				 (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
 #define IS_HSW_ULT(dev)		(IS_HASWELL(dev) && \
 				 (INTEL_DEVID(dev) & 0xFF00) == 0x0A00)
 #define IS_ULT(dev)		(IS_HSW_ULT(dev) || IS_BDW_ULT(dev))
Signature · 1 line
1.9.3
author maintainer
#1 lore raw

PATCH 2/5 drm/i915/bdw: WaDisableFenceDestinationToSLM

This WA affect BDW GT3 E and F steppings.

---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index ad8179b..124ea60 100644
@@ -4836,6 +4836,7 @@ enum punit_power_well {
 /* GEN8 chicken */
 #define HDC_CHICKEN0				0x7300
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
+#define  HDC_FENCE_DEST_SLM_DISABLE		(1<<14)
 
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
drivers/gpu/drm/i915/intel_ringbuffer.c +5 -1
index 681ea86..7c3d17a 100644
@@ -740,8 +740,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * workaround for for a possible hang in the unlikely event a TLB
 	 * invalidation occurs during a PSD flush.
 	 */
+	/* WaDisableFenceDestinationToSLM:bdw (GT3 pre-production E/F) */
 	intel_ring_emit_wa(ring, HDC_CHICKEN0,
-			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT));
+			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT |
+					      (IS_BDW_GT3(dev) ?
+					       HDC_FENCE_DEST_SLM_DISABLE : 0)
+				   ));
 
 	/* Wa4x4STCOptimizationDisable:bdw */
 	intel_ring_emit_wa(ring, CACHE_MODE_1,
Signature · 1 line
1.9.3
Reviewed-by on v1 2/5
#2 lore raw

Re: [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM

Quoted 3 lines · Rodrigo Vivi

This WA affect BDW GT3 E and F steppings.

Quoted 42 lines
---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index ad8179b..124ea60 100644
@@ -4836,6 +4836,7 @@ enum punit_power_well {
 /* GEN8 chicken */
 #define HDC_CHICKEN0				0x7300
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
+#define  HDC_FENCE_DEST_SLM_DISABLE		(1<<14)
 
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
drivers/gpu/drm/i915/intel_ringbuffer.c +5 -1
index 681ea86..7c3d17a 100644
@@ -740,8 +740,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * workaround for for a possible hang in the unlikely event a TLB
 	 * invalidation occurs during a PSD flush.
 	 */
+	/* WaDisableFenceDestinationToSLM:bdw (GT3 pre-production E/F) */
 	intel_ring_emit_wa(ring, HDC_CHICKEN0,
-			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT));
+			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT |
+					      (IS_BDW_GT3(dev) ?
+					       HDC_FENCE_DEST_SLM_DISABLE : 0)
+				   ));
 
 	/* Wa4x4STCOptimizationDisable:bdw */
 	intel_ring_emit_wa(ring, CACHE_MODE_1,
Signature · 6 lines
1.9.3

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

Re: [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM

Quoted 3 lines · Mika Kuoppala
Quoted 1 line · Rodrigo Vivi

This WA affect BDW GT3 E and F steppings.

Thou shalt not mention steppings in public. Fixed here and in the comment below while applying.

Quoted 4 lines
Quoted 2 lines

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

Quoted 47 lines
Quoted 43 lines
---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index ad8179b..124ea60 100644
@@ -4836,6 +4836,7 @@ enum punit_power_well {
 /* GEN8 chicken */
 #define HDC_CHICKEN0				0x7300
 #define  HDC_FORCE_NON_COHERENT			(1<<4)
+#define  HDC_FENCE_DEST_SLM_DISABLE		(1<<14)
 
 /* WaCatErrorRejectionIssue */
 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG		0x9030
drivers/gpu/drm/i915/intel_ringbuffer.c +5 -1
index 681ea86..7c3d17a 100644
@@ -740,8 +740,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * workaround for for a possible hang in the unlikely event a TLB
 	 * invalidation occurs during a PSD flush.
 	 */
+	/* WaDisableFenceDestinationToSLM:bdw (GT3 pre-production E/F) */
 	intel_ring_emit_wa(ring, HDC_CHICKEN0,
-			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT));
+			   _MASKED_BIT_ENABLE(HDC_FORCE_NON_COHERENT |
+					      (IS_BDW_GT3(dev) ?
+					       HDC_FENCE_DEST_SLM_DISABLE : 0)
+				   ));
 
 	/* Wa4x4STCOptimizationDisable:bdw */
 	intel_ring_emit_wa(ring, CACHE_MODE_1,
Signature · 6 lines
1.9.3

_______________________________________________
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 · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

Re: [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM

Quoted 5 lines · Daniel Vetter
Quoted 3 lines
Quoted 1 line

Queued for -next, thanks for the patch.

Well doesn't compile too well without the previous patch to introduce IS_GT3, so dropped again.
-Daniel

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

Re: [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM

Quoted 10 lines · Daniel Vetter
Quoted 5 lines · Daniel Vetter
Quoted 3 lines
Quoted 1 line

Queued for -next, thanks for the patch.

Well doesn't compile too well without the previous patch to introduce IS_GT3, so dropped again.
-Daniel

My mistake. I reviewed it but I failed at mailing. Mailed the r-b only to Rodrigo apparently.

Patch 1/5 is

-Mika

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

Re: [PATCH 2/5] drm/i915/bdw: WaDisableFenceDestinationToSLM

Quoted 13 lines · Mika Kuoppala
Quoted 10 lines · Daniel Vetter
Quoted 5 lines · Daniel Vetter
Quoted 3 lines
Quoted 1 line

Queued for -next, thanks for the patch.

Well doesn't compile too well without the previous patch to introduce IS_GT3, so dropped again.
-Daniel

Quoted 6 lines

My mistake. I reviewed it but I failed at mailing. Mailed the r-b only to Rodrigo apparently.

Patch 1/5 is

Jesse also reviewed patch 1, so I've merged the first 2 to dinq this morning. Thanks anyway.
-Daniel

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

PATCH 3/5 drm/i915/bdw: WaProgramL3SqcReg1Default

In reply to Rodrigo Vivi

Program the default initial value of the L3SqcReg1 on BDW for performance

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 124ea60..8aafa08 100644
@@ -4821,6 +4821,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1				0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
 
+#define GEN8_L3SQCREG1				0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT		0x00610000
+
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C47FF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 1ec3c8f..8a58565 100644
@@ -5811,6 +5811,9 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) |
 		   GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
 
+	/* WaProgramL3SqcReg1Default:bdw */
+	I915_WRITE(GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+
 	lpt_init_clock_gating(dev);
 }
 
Signature · 1 line
1.9.3
#8 lore raw

Re: [PATCH 3/5] drm/i915/bdw: WaProgramL3SqcReg1Default

Quoted 13 lines · Rodrigo Vivi

Program the default initial value of the L3SqcReg1 on BDW for performance

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 124ea60..8aafa08 100644

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 4826

Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -4821,6 +4821,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1				0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
 
+#define GEN8_L3SQCREG1				0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT		0x00610000
+

This is the default after reset. I think we want 0x00810000

-Mika

Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C47FF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 1ec3c8f..8a58565 100644

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

Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
@@ -5811,6 +5811,9 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) |
 		   GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
 
+	/* WaProgramL3SqcReg1Default:bdw */
+	I915_WRITE(GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+

Should we use intel_ring_emit_wa?

-Mika

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	lpt_init_clock_gating(dev);
 }
 
Signature · 6 lines
1.9.3

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

Re: [PATCH 3/5] drm/i915/bdw: WaProgramL3SqcReg1Default

Quoted 19 lines · Mika Kuoppala
Quoted 16 lines · Rodrigo Vivi

Program the default initial value of the L3SqcReg1 on BDW for performance

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 124ea60..8aafa08 100644
@@ -4821,6 +4821,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1                               0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE           0x00D30000
 
Quoted 5 lines

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 4826

Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
+#define GEN8_L3SQCREG1                               0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT            0x00610000
+

This is the default after reset. I think we want 0x00810000

Why do you think that?
Bspec explict says
Default Value: 0x00610000 [BDW]

And bit by bit:
[23:19] 01100b 24 (default)
[18:14] 00100b 8 (default)

0 as default for all other bits what end up on 0x00610000

Quoted 14 lines

-Mika

Quoted 11 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define GEN7_L3CNTLREG1                              0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL                 0x3C47FF8C
 #define  GEN7_L3AGDIS                                (1<<19)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 1ec3c8f..8a58565 100644
@@ -5811,6 +5811,9 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
      I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) |
                 GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
 
Quoted 5 lines

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

Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
+     /* WaProgramL3SqcReg1Default:bdw */
+     I915_WRITE(GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+

Should we use intel_ring_emit_wa?

Yes, this is probably better to do it after all resets right?! I do a v2 after we agree on the default value.

Quoted 17 lines

-Mika

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -1
      lpt_init_clock_gating(dev);
 }
 
--

1.9.3

_______________________________________________
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 · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
#10 lore raw

Re: [PATCH 3/5] drm/i915/bdw: WaProgramL3SqcReg1Default

In reply to Mika Kuoppala
Quoted 18 lines · Mika Kuoppala
Quoted 16 lines · Rodrigo Vivi

Program the default initial value of the L3SqcReg1 on BDW for performance

---
 drivers/gpu/drm/i915/i915_reg.h | 3 +++
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 124ea60..8aafa08 100644
@@ -4821,6 +4821,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1				0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
 
Quoted 5 lines

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 4826

Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
+#define GEN8_L3SQCREG1				0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT		0x00610000
+

This is the default after reset. I think we want 0x00810000

Digging through some attached mails in the hsd I found this number:
0x00784000

This w/a seems to be a real mess. No bspec update, no actual infromation in the w/a db, and even the hsd stuff is more or less useless until you notice there's some attached email dump that has the actual number :(

Quoted 36 lines

-Mika

Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C47FF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 1ec3c8f..8a58565 100644

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

Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
@@ -5811,6 +5811,9 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(GEN8_UCGCTL6, I915_READ(GEN8_UCGCTL6) |
 		   GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
 
+	/* WaProgramL3SqcReg1Default:bdw */
+	I915_WRITE(GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+

Should we use intel_ring_emit_wa?

-Mika

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	lpt_init_clock_gating(dev);
 }
 
Signature · 6 lines
1.9.3

_______________________________________________
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 · 2 lines
Ville Syrjälä
Intel OTC
author maintainer
#11 lore raw

PATCH 1/1 drm/i915/bdw: WaProgramL3SqcReg1Default

Program the default initial value of the L3SqcReg1 on BDW for performance

v2: Default confirmed and using intel_ring_emit_wa as Mika pointed out.

---
 drivers/gpu/drm/i915/i915_reg.h         | 3 +++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 36a847a..33143cc 100644
@@ -4972,6 +4972,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1				0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
 
+#define GEN8_L3SQCREG1				0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT		0x00610000
+
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C47FF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -1
index 816a692..a37675d 100644
@@ -707,7 +707,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * update the number of dwords required based on the
 	 * actual number of workarounds applied
 	 */
-	ret = intel_ring_begin(ring, 18);
+	ret = intel_ring_begin(ring, 21);
 	if (ret)
 		return ret;
 
@@ -751,6 +751,9 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	intel_ring_emit_wa(ring, GEN7_GT_MODE,
 			   GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4);
 
+	/* WaProgramL3SqcReg1Default:bdw */
+	intel_ring_emit_wa(ring, GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+
 	intel_ring_advance(ring);
 
 	DRM_DEBUG_DRIVER("Number of Workarounds applied: %d\n",
Signature · 1 line
1.9.3
#12 lore raw

Re: [PATCH] drm/i915/bdw: WaProgramL3SqcReg1Default

Quoted 16 lines · Rodrigo Vivi

Program the default initial value of the L3SqcReg1 on BDW for performance

v2: Default confirmed and using intel_ring_emit_wa as Mika pointed out.

---
 drivers/gpu/drm/i915/i915_reg.h         | 3 +++
 drivers/gpu/drm/i915/intel_ringbuffer.c | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 36a847a..33143cc 100644

drivers/gpu/drm/i915/i915_reg.h enum punit_power_well { · line 4977

Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -4972,6 +4972,9 @@ enum punit_power_well {
 #define GEN7_L3SQCREG1				0xB010
 #define  VLV_B0_WA_L3SQCREG1_VALUE		0x00D30000
 
+#define GEN8_L3SQCREG1				0xB100
+#define  BDW_WA_L3SQCREG1_DEFAULT		0x00610000
+

This is the default value after reset. I have experimented with other values and nothing improves above noise level. Further, my suggestion to using 0x00810000 will cause a gpu hang...so there is dragons here.

As you are writing the same default value that is already in register, and there is no indication that we should refresh anything, I would say this patch is not needed until someone comes along and shows something better than what the default is.

Thanks,
-Mika

Quoted 33 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define GEN7_L3CNTLREG1				0xB01C
 #define  GEN7_WA_FOR_GEN7_L3_CONTROL			0x3C47FF8C
 #define  GEN7_L3AGDIS				(1<<19)
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -1
index 816a692..a37675d 100644
@@ -707,7 +707,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * update the number of dwords required based on the
 	 * actual number of workarounds applied
 	 */
-	ret = intel_ring_begin(ring, 18);
+	ret = intel_ring_begin(ring, 21);
 	if (ret)
 		return ret;
 
@@ -751,6 +751,9 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	intel_ring_emit_wa(ring, GEN7_GT_MODE,
 			   GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4);
 
+	/* WaProgramL3SqcReg1Default:bdw */
+	intel_ring_emit_wa(ring, GEN8_L3SQCREG1, BDW_WA_L3SQCREG1_DEFAULT);
+
 	intel_ring_advance(ring);
 
 	DRM_DEBUG_DRIVER("Number of Workarounds applied: %d\n",
Signature · 6 lines
1.9.3

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

PATCH 4/5 drm/i915: Let number of workarounds more clear

In reply to Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +12 -4
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
@@ -775,6 +777,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -784,7 +787,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	dev_priv->num_wa_regs = 0;
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
-	ret = intel_ring_begin(ring, 12);
+	/*
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
+	 */
+	wa_amount = 4;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.9.3
author maintainer
#14 lore raw

PATCH 1/1 drm/i915: Let number of workarounds more clear

This helps when including or removing cs workarounds.

v2: Rebase after other Mika's patch that removed some BDW production workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +12 -4
index b583a60..0a4fd37 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 18);
+	wa_amount = 6;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
@@ -764,6 +766,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -773,7 +776,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	dev_priv->num_wa_regs = 0;
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
-	ret = intel_ring_begin(ring, 12);
+	/*
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
+	 */
+	wa_amount = 4;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.9.3
#15 lore raw

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

In reply to Rodrigo Vivi
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

-Mika

Quoted 29 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -1
@@ -775,6 +777,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -784,7 +787,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	dev_priv->num_wa_regs = 0;
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
-	ret = intel_ring_begin(ring, 12);
+	/*
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
+	 */
+	wa_amount = 4;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
Signature · 6 lines
1.9.3

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

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

Quoted 43 lines · Mika Kuoppala
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

Quoted 5 lines

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first, and doing intel_ring_begin() and the intel_ring_emit()s next, and not worry about this again.

BR,
Jani.

Quoted 36 lines

-Mika

Quoted 29 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -1
@@ -775,6 +777,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -784,7 +787,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	dev_priv->num_wa_regs = 0;
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
-	ret = intel_ring_begin(ring, 12);
+	/*
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
+	 */
+	wa_amount = 4;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
Signature · 6 lines
1.9.3

_______________________________________________
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 · 1 line
Jani Nikula, Intel Open Source Technology Center
#17 lore raw

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

Quoted 50 lines · Jani Nikula
Quoted 43 lines · Mika Kuoppala
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

Quoted 5 lines

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Quoted 3 lines

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first,

And only *once*.
-Chris

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

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

Quoted 13 lines · Chris Wilson
Quoted 13 lines
Quoted 12 lines

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Quoted 5 lines
Quoted 3 lines

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first,

And only *once*.

Note that Arun is signed up to fix all of that, starting with proposing changes upfront.

Signature · 1 line
Damien
#19 lore raw

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

In reply to Jani Nikula
Quoted 50 lines · Jani Nikula
Quoted 43 lines · Mika Kuoppala
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

Quoted 5 lines

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Quoted 5 lines

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first, and doing intel_ring_begin() and the intel_ring_emit()s next, and not worry about this again.

My RFC series of fixing the workarounds after reset/suspend does this.

-Mika

Quoted 42 lines

BR,
Jani.

Quoted 36 lines

-Mika

Quoted 29 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +7 -1
@@ -775,6 +777,7 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -784,7 +787,12 @@ static int chv_init_workarounds(struct intel_engine_cs *ring)
 	dev_priv->num_wa_regs = 0;
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
-	ret = intel_ring_begin(ring, 12);
+	/*
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
+	 */
+	wa_amount = 4;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
Signature · 6 lines
1.9.3

_______________________________________________
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 · 1 line
Jani Nikula, Intel Open Source Technology Center
#20 lore raw

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

Quoted 52 lines · Mika Kuoppala
Quoted 50 lines · Jani Nikula
Quoted 48 lines · Mika Kuoppala
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	int ret;
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	int wa_amount;
 
 	/*
 	 * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
 	/*
-	 * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-	 * actual number of workarounds applied
+	 * update the number of workarounds when adding or removing was
+	 * in order the have propper dwords
 	 */
-	ret = intel_ring_begin(ring, 24);
+	wa_amount = 8;
+	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Quoted 7 lines
Quoted 5 lines

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first, and doing intel_ring_begin() and the intel_ring_emit()s next, and not worry about this again.

My RFC series of fixing the workarounds after reset/suspend does this.

And so did mine! :-p
-Chris

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

Re: [PATCH 4/5] drm/i915: Let number of workarounds more clear

so please, just ignore this patch anyway.

Quoted 70 lines · Chris Wilson
Quoted 52 lines · Mika Kuoppala
Quoted 50 lines · Jani Nikula
Quoted 48 lines · Mika Kuoppala
Quoted 23 lines · Rodrigo Vivi

This helps when including or removing cs workarounds.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
index 7c3d17a..39fbea6 100644
@@ -694,6 +694,7 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
  int ret;
  struct drm_device *dev = ring->dev;
  struct drm_i915_private *dev_priv = dev->dev_private;
+ int wa_amount;
 
  /*
   * workarounds applied in this fn are part of register state context,
@@ -704,10 +705,11 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
  memset(dev_priv->intel_wa_regs, 0, sizeof(dev_priv->intel_wa_regs));
 
  /*
-  * update the number of dwords required based on the

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

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -2
-  * actual number of workarounds applied
+  * update the number of workarounds when adding or removing was
+  * in order the have propper dwords
   */
- ret = intel_ring_begin(ring, 24);
+ wa_amount = 8;
+ ret = intel_ring_begin(ring, 3 * wa_amount);
  if (ret)
          return ret;
 

I have a bit mixed feelings with this patch as I have tripped around here myself recently.

I think we should just drop this patch and use:
ret = intel_ring_begin(ring, 3 * <amount>) on the subsequent patches that modify the amount.

This way the intel_ring_begin will always be the one that shows in a diff. And raises alarm if it doesnt. We don't want this to be too transparent and looking too easy for the next reader. As the reviewer is the only and last line of defense ensuring symmetry between intel_ring_begin and amount of emits.

Quoted 7 lines
Quoted 5 lines

Considering intel_ring_emit_wa() adds all the needed information to dev_priv->intel_wa_regs and dev_priv->num_wa_regs anyway, we could trivially split this into constructing dev_priv->intel_wa_regs first, and doing intel_ring_begin() and the intel_ring_emit()s next, and not worry about this again.

My RFC series of fixing the workarounds after reset/suspend does this.

And so did mine! :-p
-Chris

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
author maintainer
#22 lore raw

PATCH 5/5 drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

In reply to Rodrigo Vivi

Let's clean this a bit

---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c | 20 ++++----------------
 2 files changed, 4 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index 8a58565..300ad6b 100644
@@ -5774,16 +5774,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* FIXME(BDW): Check all the w/a, some might only apply to
-	 * pre-production hw. */
-
-
-	I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-	I915_WRITE(_3D_CHICKEN3,
-		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -16
index 39fbea6..a334e49 100644
@@ -708,35 +708,23 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 	 * update the number of workarounds when adding or removing was
 	 * in order the have propper dwords
 	 */
-	wa_amount = 8;
+	wa_amount = 6;
 	ret = intel_ring_begin(ring, 3 * wa_amount);
 	if (ret)
 		return ret;
 
 	/* WaDisablePartialInstShootdown:bdw */
-	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableThreadStallDopClockGating:bdw (pre-production until D) */
 	intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
 			   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
 					     | STALL_DOP_GATING_DISABLE));
 
-	/* WaDisableDopClockGating:bdw May not be needed for production */
+	/* WaDisableDopClockGating:bdw */
 	intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 
-	/*
-	 * This GEN8_CENTROID_PIXEL_OPT_DIS W/A is only needed for
-	 * pre-production hardware
-	 */
 	intel_ring_emit_wa(ring, HALF_SLICE_CHICKEN3,
-			   _MASKED_BIT_ENABLE(GEN8_CENTROID_PIXEL_OPT_DIS
-					      | GEN8_SAMPLER_POWER_BYPASS_DIS));
-
-	intel_ring_emit_wa(ring, GEN7_HALF_SLICE_CHICKEN1,
-			   _MASKED_BIT_ENABLE(GEN7_SINGLE_SUBSCAN_DISPATCH_ENABLE));
-
-	intel_ring_emit_wa(ring, COMMON_SLICE_CHICKEN2,
-			   _MASKED_BIT_ENABLE(GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE));
+			   _MASKED_BIT_ENABLE(GEN8_SAMPLER_POWER_BYPASS_DIS));
 
 	/* Use Force Non-Coherent whenever executing a 3D context. This is a
 	 * workaround for for a possible hang in the unlikely event a TLB
Signature · 1 line
1.9.3
author maintainer
#23 lore raw

PATCH 1/1 drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

Let's clean this a bit

v2: Rebase after other Mika's patch that removed some BDW production workarounds.

---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index ae61b45..aaab056 100644
@@ -5803,16 +5803,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* FIXME(BDW): Check all the w/a, some might only apply to
-	 * pre-production hw. */
-
-
-	I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-	I915_WRITE(_3D_CHICKEN3,
-		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -3
index 0a4fd37..896f564 100644
@@ -714,13 +714,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 		return ret;
 
 	/* WaDisablePartialInstShootdown:bdw */
-	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableThreadStallDopClockGating:bdw (pre-production until D) */
 	intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
 			   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
 					     | STALL_DOP_GATING_DISABLE));
 
-	/* WaDisableDopClockGating:bdw May not be needed for production */
+	/* WaDisableDopClockGating:bdw */
 	intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 
Signature · 1 line
1.9.3
#24 lore raw

Re: [PATCH] drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

Just a note that v2 here can be useful and applied even without the patch 4/5 which I asked to ignore for now.

Mika, could you please help on review of this?

Quoted 58 lines · Rodrigo Vivi

Let's clean this a bit

v2: Rebase after other Mika's patch that removed some BDW production workarounds.

---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index ae61b45..aaab056 100644
@@ -5803,16 +5803,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
        I915_WRITE(WM2_LP_ILK, 0);
        I915_WRITE(WM1_LP_ILK, 0);
 
-       /* FIXME(BDW): Check all the w/a, some might only apply to
-        * pre-production hw. */
-
-
-       I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-       I915_WRITE(_3D_CHICKEN3,
-                  _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
        /* WaSwitchSolVfFArbitrationPriority:bdw */
        I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -4
index 0a4fd37..896f564 100644
@@ -714,13 +714,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
                return ret;
 
        /* WaDisablePartialInstShootdown:bdw */
-       /* WaDisableThreadStallDopClockGating:bdw */
-       /* FIXME: Unclear whether we really need this on production bdw. */
+       /* WaDisableThreadStallDopClockGating:bdw (pre-production until D) */
        intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
                           _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
                                             | STALL_DOP_GATING_DISABLE));
 
-       /* WaDisableDopClockGating:bdw May not be needed for production */
+       /* WaDisableDopClockGating:bdw */
        intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
                           _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 
--

1.9.3

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Reviewed-by on v1 1/1
#25 lore raw

Re: [PATCH] drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

In reply to Rodrigo Vivi
Quoted 42 lines · Rodrigo Vivi

Let's clean this a bit

v2: Rebase after other Mika's patch that removed some BDW production workarounds.

---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index ae61b45..aaab056 100644
@@ -5803,16 +5803,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* FIXME(BDW): Check all the w/a, some might only apply to
-	 * pre-production hw. */
-
-
-	I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-	I915_WRITE(_3D_CHICKEN3,
-		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -2
index 0a4fd37..896f564 100644
@@ -714,13 +714,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 		return ret;
 
 	/* WaDisablePartialInstShootdown:bdw */
-	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableThreadStallDopClockGating:bdw (pre-production until
Quoted 1 line

D) */

Just remove the fixme line here and dont add D.

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

Quoted 6 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +1 -1
 	intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
 			   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
 					     | STALL_DOP_GATING_DISABLE));
 
-	/* WaDisableDopClockGating:bdw May not be needed for production */
+	/* WaDisableDopClockGating:bdw */

With comment fixed:

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +0 -0
 	intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
Signature · 7 lines
-- 
1.9.3

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

PATCH 1/1 drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

Let's clean this a bit

v2: Rebase after other Mika's patch that removed some BDW production workarounds.
v3: Removed stepping info.

---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index daa99e7..23d3318 100644
@@ -5654,16 +5654,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* FIXME(BDW): Check all the w/a, some might only apply to
-	 * pre-production hw. */
-
-
-	I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-	I915_WRITE(_3D_CHICKEN3,
-		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -3
index 816a692..a0c52ad 100644
@@ -712,13 +712,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 		return ret;
 
 	/* WaDisablePartialInstShootdown:bdw */
-	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableThreadStallDopClockGating:bdw (pre-production) */
 	intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
 			   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
 					     | STALL_DOP_GATING_DISABLE));
 
-	/* WaDisableDopClockGating:bdw May not be needed for production */
+	/* WaDisableDopClockGating:bdw */
 	intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 
Signature · 1 line
1.9.3
#27 lore raw

Re: [PATCH] drm/i915/bdw: Remove BDW preproduction W/As until C stepping.

Quoted 7 lines · Rodrigo Vivi

Let's clean this a bit

v2: Rebase after other Mika's patch that removed some BDW production workarounds.
v3: Removed stepping info.

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

Quoted 53 lines
---
 drivers/gpu/drm/i915/intel_pm.c         | 10 ----------
 drivers/gpu/drm/i915/intel_ringbuffer.c |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index daa99e7..23d3318 100644
@@ -5654,16 +5654,6 @@ static void broadwell_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(WM2_LP_ILK, 0);
 	I915_WRITE(WM1_LP_ILK, 0);
 
-	/* FIXME(BDW): Check all the w/a, some might only apply to
-	 * pre-production hw. */
-
-
-	I915_WRITE(GAMTARBMODE, _MASKED_BIT_ENABLE(ARB_MODE_BWGTLB_DISABLE));
-
-	I915_WRITE(_3D_CHICKEN3,
-		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SDE_LIMIT_FIFO_POLY_DEPTH(2)));
-
-
 	/* WaSwitchSolVfFArbitrationPriority:bdw */
 	I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL);
 
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -3
index 816a692..a0c52ad 100644
@@ -712,13 +712,12 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
 		return ret;
 
 	/* WaDisablePartialInstShootdown:bdw */
-	/* WaDisableThreadStallDopClockGating:bdw */
-	/* FIXME: Unclear whether we really need this on production bdw. */
+	/* WaDisableThreadStallDopClockGating:bdw (pre-production) */
 	intel_ring_emit_wa(ring, GEN8_ROW_CHICKEN,
 			   _MASKED_BIT_ENABLE(PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE
 					     | STALL_DOP_GATING_DISABLE));
 
-	/* WaDisableDopClockGating:bdw May not be needed for production */
+	/* WaDisableDopClockGating:bdw */
 	intel_ring_emit_wa(ring, GEN7_ROW_CHICKEN2,
 			   _MASKED_BIT_ENABLE(DOP_CLOCK_GATING_DISABLE));
 
Signature · 6 lines
1.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Reviewed-by on v1 1/5
#28 lore raw
In reply to Rodrigo Vivi
Quoted 12 lines · On Fri, 19 Sep 2014 20:16:26 -0400 Rodrigo Vivi <[email protected]> wrote:

It will be usefull to specify w/a that affects only BDW GT3.

---
 drivers/gpu/drm/i915/i915_drv.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +0 -0
index 5fce16c..a00214e 100644

drivers/gpu/drm/i915/i915_drv.h struct drm_i915_cmd_table { · line 2106

Quoted 8 lines
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -2099,6 +2099,8 @@ struct drm_i915_cmd_table {
 				 ((INTEL_DEVID(dev) & 0xf) == 0x2  || \
 				 (INTEL_DEVID(dev) & 0xf) == 0x6 || \
 				 (INTEL_DEVID(dev) & 0xf) == 0xe))
+#define IS_BDW_GT3(dev)		(IS_BROADWELL(dev) && \
+				 (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
 #define IS_HSW_ULT(dev)		(IS_HASWELL(dev) && \
 				 (INTEL_DEVID(dev) & 0xFF00) == 0x0A00)
 #define IS_ULT(dev)		(IS_HSW_ULT(dev) || IS_BDW_ULT(dev))

Looks correct based on the configs I'm staring at...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center