Skip to contentSkip to conversation

drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

PATCH Superseded [email protected] 4 participants 6 messages Jun 9, 2016

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

From: Tim Gore <[email protected]>

This patch enables a workaround for a mid thread preemption issue where a hardware timing problem can prevent the context restore from happening, leading to a hang.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
 drivers/gpu/drm/i915/i915_reg.h     | 4 ++++
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +6 -0
index 4668477..e9046f6 100644
@@ -2156,6 +2156,12 @@ static void gtt_write_workarounds(struct drm_device *dev)
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
 	else if (IS_BROXTON(dev))
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
+
+	/* WaConextSwitchWithConcurrentTLBInvalidate:gen9 */
+	if (IS_GEN9(dev))
+	{
+		I915_WRITE(GEN9_CSFE_CHICKEN1_RCS, _MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE));
+	}
 }
 
 static int i915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index 81d1896..2a6fc62 100644
@@ -1810,6 +1810,10 @@ enum skl_disp_power_wells {
 #define   GEN9_IZ_HASHING_MASK(slice)			(0x3 << ((slice) * 2))
 #define   GEN9_IZ_HASHING(slice, val)			((val) << ((slice) * 2))
 
+/* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
+#define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4)
+#define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2)
+
 /* WaClearTdlStateAckDirtyBits */
 #define GEN8_STATE_ACK		_MMIO(0x20F0)
 #define GEN9_STATE_ACK_SLICE1	_MMIO(0x20F8)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#1 lore raw
Quoted 17 lines · On Thu, 09 Jun 2016, [email protected] wrote:

From: Tim Gore <[email protected]>

This patch enables a workaround for a mid thread preemption issue where a hardware timing problem can prevent the context restore from happening, leading to a hang.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
 drivers/gpu/drm/i915/i915_reg.h     | 4 ++++
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index 4668477..e9046f6 100644

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev) · line 2160

Quoted 5 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -0
@@ -2156,6 +2156,12 @@ static void gtt_write_workarounds(struct drm_device *dev)
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
 	else if (IS_BROXTON(dev))
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
+
+	/* WaConextSwitchWithConcurrentTLBInvalidate:gen9 */
             ^^^^^^

Typo or sic?

BR,
Jani.

Quoted 22 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +4 -0
+	if (IS_GEN9(dev))
+	{
+		I915_WRITE(GEN9_CSFE_CHICKEN1_RCS, _MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE));
+	}
 }
 
 static int i915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt)
drivers/gpu/drm/i915/i915_reg.h +4 -0
index 81d1896..2a6fc62 100644
@@ -1810,6 +1810,10 @@ enum skl_disp_power_wells {
 #define   GEN9_IZ_HASHING_MASK(slice)			(0x3 << ((slice) * 2))
 #define   GEN9_IZ_HASHING(slice, val)			((val) << ((slice) * 2))
 
+/* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
+#define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4)
+#define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2)
+
 /* WaClearTdlStateAckDirtyBits */
 #define GEN8_STATE_ACK		_MMIO(0x20F0)
 #define GEN9_STATE_ACK_SLICE1	_MMIO(0x20F8)
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw

Tim Gore
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ

Quoted 36 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Thursday, June 09, 2016 9:34 AM
To: Gore, Tim; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct

Quoted 18 lines · On Thu, 09 Jun 2016, [email protected] wrote:

From: Tim Gore <[email protected]>

This patch enables a workaround for a mid thread preemption issue where a hardware timing problem can prevent the context restore from happening, leading to a hang.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
 drivers/gpu/drm/i915/i915_reg.h     | 4 ++++
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index 4668477..e9046f6 100644
@@ -2156,6 +2156,12 @@ static void gtt_write_workarounds(struct

drm_device *dev)

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct · line 2156

Quoted 1 line
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU,

GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev) · line 2160

Quoted 5 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -0
 	else if (IS_BROXTON(dev))
 		I915_WRITE(GEN8_L3_LRA_1_GPGPU,
 GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
+
+	/* WaConextSwitchWithConcurrentTLBInvalidate:gen9 */
             ^^^^^^
Quoted 5 lines

Typo or sic?

BR,
Jani.

Sic !!
Tim

Quoted 19 lines

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev)

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +3 -0
+	if (IS_GEN9(dev))
+	{
+		I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,

_MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE));

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

Quoted 10 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -0
+	}
 }
 

static int i915_ppgtt_init(struct drm_device *dev, struct
i915_hw_ppgtt *ppgtt) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 81d1896..2a6fc62 100644

drivers/gpu/drm/i915/i915_reg.h +0 -0
@@ -1810,6 +1810,10 @@ enum skl_disp_power_wells {
 #define   GEN9_IZ_HASHING_MASK(slice)			(0x3 <<

((slice) * 2))

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

Quoted 1 line
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define   GEN9_IZ_HASHING(slice, val)			((val) <<

((slice) * 2))

Quoted 1 line
Quoted 10 lines

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

Quoted 7 lines
drivers/gpu/drm/i915/i915_reg.h +4 -0
+/* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
+#define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4)
+#define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2)
+
 /* WaClearTdlStateAckDirtyBits */
 #define GEN8_STATE_ACK		_MMIO(0x20F0)
 #define GEN9_STATE_ACK_SLICE1	_MMIO(0x20F8)

--
Jani Nikula, Intel Open Source Technology Center

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

#3 lore raw

✓ Ro.CI.BAT: success for drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate
URL : https://patchwork.freedesktop.org/series/8487/
State : success

== Summary ==

Series 8487v1 drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate
http://patchwork.freedesktop.org/api/1.0/series/8487/revisions/1/mbox

Test kms_flip:

        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (ro-bdw-i7-5600u)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> SKIP       (ro-bdw-i5-5250u)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> SKIP       (ro-bdw-i7-5557U)
fi-bdw-i7-5557u  total:209  pass:197  dwarn:0   dfail:0   fail:0   skip:12 
fi-skl-i5-6260u  total:209  pass:198  dwarn:0   dfail:0   fail:0   skip:11 
fi-skl-i7-6700k  total:209  pass:184  dwarn:0   dfail:0   fail:0   skip:25 
fi-snb-i7-2600   total:209  pass:170  dwarn:0   dfail:0   fail:0   skip:39 
ro-bdw-i5-5250u  total:209  pass:193  dwarn:3   dfail:0   fail:0   skip:13 
ro-bdw-i7-5557U  total:209  pass:193  dwarn:1   dfail:0   fail:0   skip:15 
ro-bdw-i7-5600u  total:209  pass:181  dwarn:0   dfail:0   fail:0   skip:28 
ro-bsw-n3050     total:209  pass:168  dwarn:0   dfail:0   fail:2   skip:39 
ro-byt-n2820     total:209  pass:169  dwarn:0   dfail:0   fail:3   skip:37 
ro-hsw-i3-4010u  total:209  pass:186  dwarn:0   dfail:0   fail:0   skip:23 
ro-hsw-i7-4770r  total:209  pass:186  dwarn:0   dfail:0   fail:0   skip:23 
ro-ilk1-i5-650   total:204  pass:146  dwarn:0   dfail:0   fail:1   skip:57 
ro-ivb-i7-3770   total:209  pass:177  dwarn:0   dfail:0   fail:0   skip:32 
ro-ivb2-i7-3770  total:209  pass:181  dwarn:0   dfail:0   fail:0   skip:28 
ro-snb-i7-2620M  total:209  pass:170  dwarn:0   dfail:0   fail:1   skip:38 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1146/

d54fc9b drm-intel-nightly: 2016y-06m-09d-06h-54m-13s UTC integration manifest ce836e8 drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

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

#4 lore raw
In reply to [email protected]
Quoted 17 lines · On 09/06/2016 13:48, [email protected] wrote:

From: Tim Gore <[email protected]>

This patch enables a workaround for a mid thread preemption issue where a hardware timing problem can prevent the context restore from happening, leading to a hang.

---
  drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
  drivers/gpu/drm/i915/i915_reg.h     | 4 ++++
  2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index 4668477..e9046f6 100644

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev) · line 2164

Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +6 -0
@@ -2156,6 +2156,12 @@ static void gtt_write_workarounds(struct drm_device *dev)
  		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
  	else if (IS_BROXTON(dev))
  		I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
+
+	/* WaConextSwitchWithConcurrentTLBInvalidate:gen9 */
+	if (IS_GEN9(dev))
+	{
+		I915_WRITE(GEN9_CSFE_CHICKEN1_RCS, _MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE));
+	}

This is not the correct place, it should be added in gen9_init_workarounds() in intel_ringbuffer.c as it applies to both skl and bxt.

Please also correct the spelling and we usually mention both skl, bxt instead of gen9. WaContextSwitchWithConcurrentTLBInvalidate:skl,bxt

regards
Arun

Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
  }
 
  static int i915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 81d1896..2a6fc62 100644

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

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -1810,6 +1810,10 @@ enum skl_disp_power_wells {
  #define   GEN9_IZ_HASHING_MASK(slice)			(0x3 << ((slice) * 2))
  #define   GEN9_IZ_HASHING(slice, val)			((val) << ((slice) * 2))
 
+/* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
+#define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4)
+#define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2)
+
  /* WaClearTdlStateAckDirtyBits */
  #define GEN8_STATE_ACK		_MMIO(0x20F0)
  #define GEN9_STATE_ACK_SLICE1	_MMIO(0x20F8)

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

author
#5 lore raw

Tim Gore
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ

Quoted 43 lines

-----Original Message-----
From: Arun Siluvery [mailto:[email protected]]
Sent: Thursday, June 09, 2016 2:05 PM
To: Gore, Tim; [email protected]
Subject: Re: [PATCH] drm/i915/gen9: implement WaConextSwitchWithConcurrentTLBInvalidate

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct

Quoted 18 lines · On 09/06/2016 13:48, [email protected] wrote:

From: Tim Gore <[email protected]>

This patch enables a workaround for a mid thread preemption issue where a hardware timing problem can prevent the context restore from happening, leading to a hang.

---
  drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
  drivers/gpu/drm/i915/i915_reg.h     | 4 ++++
  2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index 4668477..e9046f6 100644
@@ -2156,6 +2156,12 @@ static void gtt_write_workarounds(struct

drm_device *dev)

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct · line 2156

Quoted 1 line
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
  		I915_WRITE(GEN8_L3_LRA_1_GPGPU,

GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev)

Quoted 8 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +5 -0
  	else if (IS_BROXTON(dev))
  		I915_WRITE(GEN8_L3_LRA_1_GPGPU,
 GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
+
+	/* WaConextSwitchWithConcurrentTLBInvalidate:gen9 */
+	if (IS_GEN9(dev))
+	{
+		I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,

_MASKED_BIT_ENABLE(GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE));

drivers/gpu/drm/i915/i915_gem_gtt.c static void gtt_write_workarounds(struct drm_device *dev) · line 2164

Quoted 1 line
drivers/gpu/drm/i915/i915_gem_gtt.c +1 -0
+	}

This is not the correct place, it should be added in gen9_init_workarounds() in intel_ringbuffer.c as it applies to both skl and bxt.

Quoted 7 lines

Please also correct the spelling and we usually mention both skl, bxt instead of gen9.
WaContextSwitchWithConcurrentTLBInvalidate:skl,bxt

regards
Arun

The spelling is as per documentation and other code. Changing it will just add confusion. The w/a is for all gen 9 chips, kbl, bxt, skl etc., not sure why we need to enumerate them, anyway there is unlikely to be another gen9 chip so maybe a moot point, so I'll list them. Will move to gen9_init_workarounds, this seems to be called during reset and resume so Should also work. V2 patch to follow

Tim

Quoted 13 lines

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

Quoted 9 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
  }
 

static int i915_ppgtt_init(struct drm_device *dev, struct
i915_hw_ppgtt *ppgtt) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 81d1896..2a6fc62 100644

drivers/gpu/drm/i915/i915_reg.h +0 -0
@@ -1810,6 +1810,10 @@ enum skl_disp_power_wells {
  #define   GEN9_IZ_HASHING_MASK(slice)			(0x3 <<

((slice) * 2))

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

Quoted 1 line
drivers/gpu/drm/i915/i915_reg.h +0 -0
  #define   GEN9_IZ_HASHING(slice, val)			((val) <<

((slice) * 2))

Quoted 1 line
Quoted 8 lines

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

Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h +4 -0
+/* chicken reg for WaConextSwitchWithConcurrentTLBInvalidate */
+#define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20D4)
+#define   GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2)
+
  /* WaClearTdlStateAckDirtyBits */
  #define GEN8_STATE_ACK		_MMIO(0x20F0)
  #define GEN9_STATE_ACK_SLICE1	_MMIO(0x20F8)

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