Skip to contentSkip to conversation

drm/i915: RFC: Introduce Wa_14011282866

PATCH In review Matt Atwood 3 participants 4 messages May 10, 2023 – May 12, 2023

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

PATCH 1/1 drm/i915: RFC: Introduce Wa_14011282866

From: Tilak Tangudu <[email protected]>

Wa_14011282866 applies to RKL, ADL-S, ADL-P and TGL.

Allocate buffer pinned to GGTT and add WA to restore sampler power context.

Bspec: 46247

---
 drivers/gpu/drm/i915/gt/intel_gt_regs.h   |  5 ++
 drivers/gpu/drm/i915/gt/intel_rc6.c       | 88 +++++++++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_rc6_types.h |  3 +
 3 files changed, 96 insertions(+)
drivers/gpu/drm/i915/gt/intel_gt_regs.h +5 -0
index b8a39c219b60..91cbdd24572f 100644
@@ -48,6 +48,11 @@
 /* RCP unit config (Gen8+) */
 #define RCP_CONFIG				_MMIO(0xd08)
 
+#define CTX_WA_PTR				_MMIO(0x2058)
+#define CTX_WA_PTR_ADDR_MASK			REG_GENMASK(31, 12)
+#define CTX_WA_TYPE_MASK			REG_GENMASK(4, 3)
+#define CTX_WA_VALID				REG_BIT(0)
+
 #define RC6_LOCATION				_MMIO(0xd40)
 #define   RC6_CTX_IN_DRAM			(1 << 0)
 #define RC6_CTX_BASE				_MMIO(0xd48)
drivers/gpu/drm/i915/gt/intel_rc6.c +88 -0

120 lines not on this page · raw message

drivers/gpu/drm/i915/gt/intel_rc6_types.h +3 -0
index cd4587098162..643fd4e839ad 100644
@@ -33,6 +33,9 @@ struct intel_rc6 {
 
 	struct drm_i915_gem_object *pctx;
 
+	u32 *rc6_wa_bb;
+	struct i915_vma *vma;
+
 	bool supported : 1;
 	bool enabled : 1;
 	bool manual : 1;
Signature · 1 line
2.40.0
#1 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: RFC: Introduce Wa_14011282866

== Series Details ==

== Series Details ==

Series: drm/i915: RFC: Introduce Wa_14011282866
URL : https://patchwork.freedesktop.org/series/117604/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: RFC: Introduce Wa_14011282866

In reply to Matt Atwood
== Series Details ==

== Series Details ==

Series: drm/i915: RFC: Introduce Wa_14011282866
URL : https://patchwork.freedesktop.org/series/117604/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13131 -> Patchwork_117604v1
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_117604v1 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_117604v1, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/index.html

Participating hosts (40 -> 39)
------------------------------

Additional (1): bat-mtlp-6
Missing (2): fi-kbl-soraka fi-snb-2520m

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_117604v1:

### IGT changes ###

#### Possible regressions ####

* igt@i915_module_load@load:
- fi-rkl-11600: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/fi-rkl-11600/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/fi-rkl-11600/igt@[email protected]
- bat-adls-5: [PASS][3] -> [ABORT][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-adls-5/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-adls-5/igt@[email protected]
- bat-dg1-5: [PASS][5] -> [ABORT][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-dg1-5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-dg1-5/igt@[email protected]
- bat-dg1-7: [PASS][7] -> [ABORT][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-dg1-7/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-dg1-7/igt@[email protected]
- bat-adln-1: [PASS][9] -> [ABORT][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-adln-1/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-adln-1/igt@[email protected]
- bat-adlm-1: [PASS][11] -> [ABORT][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-adlm-1/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-adlm-1/igt@[email protected]
- bat-rplp-1: [PASS][13] -> [ABORT][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-rplp-1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-rplp-1/igt@[email protected]
- bat-rpls-2: [PASS][15] -> [ABORT][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-rpls-2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-rpls-2/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_117604v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_module_load@load:
- bat-rpls-1: [PASS][17] -> [ABORT][18] ([i915#7953])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-rpls-1/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-rpls-1/igt@[email protected]
- bat-adlp-6: [PASS][19] -> [ABORT][20] ([i915#8189])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-adlp-6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-adlp-6/igt@[email protected]
- bat-adlp-9: [PASS][21] -> [ABORT][22] ([i915#8189])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-adlp-9/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-adlp-9/igt@[email protected]
- bat-dg2-11: [PASS][23] -> [ABORT][24] ([i915#7953] / [i915#8189])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-dg2-11/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-dg2-11/igt@[email protected]
- fi-tgl-1115g4: [PASS][25] -> [ABORT][26] ([i915#7953] / [i915#8189])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/fi-tgl-1115g4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/fi-tgl-1115g4/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-1:
- bat-dg2-8: [PASS][27] -> [FAIL][28] ([i915#7932])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13131/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4342]: https://gitlab.freedesktop.org/drm/intel/issues/4342
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#7953]: https://gitlab.freedesktop.org/drm/intel/issues/7953
[i915#8189]: https://gitlab.freedesktop.org/drm/intel/issues/8189
[i915#8368]: https://gitlab.freedesktop.org/drm/intel/issues/8368

Build changes
-------------

* Linux: CI_DRM_13131 -> Patchwork_117604v1

CI-20190529: 20190529
CI_DRM_13131: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7285: d1cbf2bad9c2664ab8bd3bd0946510a52800912f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117604v1: 92b7f1c42fc99ff1bad5e18d6b1aaa585f134d47 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

50be141f7252 drm/i915: RFC: Introduce Wa_14011282866

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117604v1/index.html

#3 lore raw
In reply to Matt Atwood
Quoted 3 lines · Matt Atwood

From: Tilak Tangudu <[email protected]>

Wa_14011282866 applies to RKL, ADL-S, ADL-P and TGL.

Wa_14011282866 isn't a valid workaround number.

Quoted 8 lines

Allocate buffer pinned to GGTT and add WA to restore sampler power context.

Bspec: 46247

These lines are backward if Tilak is the original author as shown above. From Documentation/process/submitting-patches.rst:

"Any further SoBs (Signed-off-by:'s) following the author's SoB are from people handling and transporting the patch, but were not involved in its development. SoB chains should reflect the **real** route a patch took as it was propagated to the maintainers and ultimately to Linus, with the first SoB entry signalling primary authorship of a single author."

Quoted 11 lines
---
 drivers/gpu/drm/i915/gt/intel_gt_regs.h   |  5 ++
 drivers/gpu/drm/i915/gt/intel_rc6.c       | 88 +++++++++++++++++++++++
 drivers/gpu/drm/i915/gt/intel_rc6_types.h |  3 +
 3 files changed, 96 insertions(+)
drivers/gpu/drm/i915/gt/intel_gt_regs.h +0 -0
index b8a39c219b60..91cbdd24572f 100644

drivers/gpu/drm/i915/gt/intel_gt_regs.h line 54

Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_gt_regs.h +4 -0
@@ -48,6 +48,11 @@
 /* RCP unit config (Gen8+) */
 #define RCP_CONFIG				_MMIO(0xd08)
 
+#define CTX_WA_PTR				_MMIO(0x2058)
+#define CTX_WA_PTR_ADDR_MASK			REG_GENMASK(31, 12)
+#define CTX_WA_TYPE_MASK			REG_GENMASK(4, 3)
+#define CTX_WA_VALID				REG_BIT(0)

This register isn't at the right place. Also the bit definitions are missing a couple spaces before the bitfield names.

Quoted 17 lines
drivers/gpu/drm/i915/gt/intel_gt_regs.h +1 -0
+
 #define RC6_LOCATION				_MMIO(0xd40)
 #define   RC6_CTX_IN_DRAM			(1 << 0)
 #define RC6_CTX_BASE				_MMIO(0xd48)
drivers/gpu/drm/i915/gt/intel_rc6.c +1 -0
index 908a3d0f2343..9589af2e8ca3 100644
@@ -12,6 +12,7 @@
 #include "i915_vgpu.h"
 #include "intel_engine_regs.h"
 #include "intel_gt.h"
+#include "intel_gpu_commands.h"
 #include "intel_gt_pm.h"
 #include "intel_gt_regs.h"
 #include "intel_pcode.h"

drivers/gpu/drm/i915/gt/intel_rc6.c line 42

Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +1 -0
@@ -38,6 +39,7 @@
  * require higher latency to switch to and wake up.
  */
 
+#define RC6_CTX_WA_BB_SIZE (PAGE_SIZE)

Do we really need this? It's unlikely that we'll wind up needing more than a page (and we're not even trying to check in the code below either).

Quoted 20 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +13 -0
 static struct intel_gt *rc6_to_gt(struct intel_rc6 *rc6)
 {
 	return container_of(rc6, struct intel_gt, rc6);
@@ -53,8 +55,86 @@ static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc)
 	return rc6_to_gt(rc)->i915;
 }
 
+static int rc6_wa_bb_ctx_init(struct intel_rc6 *rc6)
+{
+	struct drm_i915_private *i915 = rc6_to_i915(rc6);
+	struct intel_gt *gt = rc6_to_gt(rc6);
+	struct drm_i915_gem_object *obj;
+	struct i915_vma *vma;
+	void *batch;
+	struct i915_gem_ww_ctx ww;
+	int err;
+
+	obj = i915_gem_object_create_shmem(i915, RC6_CTX_WA_BB_SIZE);
+	if (IS_ERR(obj))
+		return PTR_ERR(obj);

drivers/gpu/drm/i915/gt/intel_rc6.c static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc) · line 80

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +10 -0
+
+	vma = i915_vma_instance(obj, &gt->ggtt->vm, NULL);
+	if (IS_ERR(vma)) {
+		err = PTR_ERR(vma);
+		goto err;
+	}
+	rc6->vma = vma;
+	i915_gem_ww_ctx_init(&ww, true);
+retry:
+	err = i915_gem_object_lock(rc6->vma->obj, &ww);

Nitpick: Can't we just use the shorter local variable 'obj' here and in the pin_map?

Quoted 19 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +19 -0
+	if (!err)
+		err = i915_ggtt_pin(rc6->vma, &ww, 0, PIN_HIGH);
+	if (err)
+		goto err_ww_fini;
+
+	batch = i915_gem_object_pin_map(rc6->vma->obj, I915_MAP_WB);
+	if (IS_ERR(batch)) {
+		err = PTR_ERR(batch);
+		goto err_unpin;
+	}
+	rc6->rc6_wa_bb = batch;
+	return 0;
+err_unpin:
+	if (err)
+		i915_vma_unpin(rc6->vma);
+err_ww_fini:
+	if (err == -EDEADLK) {
+		err = i915_gem_ww_ctx_backoff(&ww);
+		if (!err)

drivers/gpu/drm/i915/gt/intel_rc6.c static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc) · line 109

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +10 -0
+			goto retry;
+	}
+	i915_gem_ww_ctx_fini(&ww);
+
+	if (err)
+		i915_vma_put(rc6->vma);
+err:
+	i915_gem_object_put(obj);
+	return err;
+}

Where do we clean up all the stuff done in this function?

Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +4 -0
+
+static void rc6_wa_bb_restore_sampler_power_ctx(struct intel_rc6 *rc6)
+{
+	struct intel_uncore *uncore = rc6_to_uncore(rc6);

drivers/gpu/drm/i915/gt/intel_rc6.c static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc) · line 123

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +10 -0
+	u32 *rc6_wa_bb;
+
+	if (!rc6->vma->obj)
+		return;
+
+	rc6_wa_bb = rc6->rc6_wa_bb;
+	*rc6_wa_bb++ = MI_NOOP;
+	*rc6_wa_bb++ = MI_LOAD_REGISTER_IMM(1) | MI_LRI_FORCE_POSTED;
+	*rc6_wa_bb++ = i915_mmio_reg_offset(GEN10_SAMPLER_MODE);
+	*rc6_wa_bb++ = _MASKED_BIT_ENABLE(ENABLE_SMALLPL);

This isn't the only register/bit that we're attempting to program (unsuccessfully) today; we need to handle all of the programming that targets the affected TDL registers such as Wa_1406941453.

Rather than including specific register values here (with no explanation of why we're even programming these), it would be better if we could just place these in the usual locations where workarounds and tuning settings are applied. Then have the code here walk the workaround list looking for any entries that write to a broken register; if any are found, add them to the power context batchbuffer here to restore them manually. That way the registers/values are clear because they're implemented in the same place they are for every other platform, and the code here is future-proof to catch any other uses of these registers in the future. You may need to adjust where this batch buffer gets built to do that (since I think the GT PM init happens before the WAL init).

drivers/gpu/drm/i915/gt/intel_rc6.c static struct drm_i915_private *rc6_to_i915(struct intel_rc6 *rc) · line 131

Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +8 -0
+	*rc6_wa_bb++ = MI_NOOP;
+	*rc6_wa_bb++ = MI_BATCH_BUFFER_END;
+
+	i915_gem_object_flush_map(rc6->vma->obj);
+
+	intel_uncore_write(uncore, CTX_WA_PTR,
+			   REG_FIELD_PREP(CTX_WA_PTR_ADDR_MASK,
+					  i915_vma_offset(rc6->vma) & GENMASK(19, 0)) |

This isn't what we want here; note the "Format:" label on the register bitfield...the value that you pack into bits 31:12 of the register is supposed to be bits 31:12 of the address. I.e., the entire register should effectively be the address, with the valid bit OR'd into bit 0 at the end.

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +4 -0
+			   CTX_WA_VALID);
+}
+
 static void gen11_rc6_enable(struct intel_rc6 *rc6)
 {
+	struct drm_i915_private *i915 = rc6_to_i915(rc6);
 	struct intel_gt *gt = rc6_to_gt(rc6);
 	struct intel_uncore *uncore = gt->uncore;
 	struct intel_engine_cs *engine;

drivers/gpu/drm/i915/gt/intel_rc6.c static void gen11_rc6_enable(struct intel_rc6 *rc6) · line 186

Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +1 -0
@@ -103,6 +183,11 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
 	intel_uncore_write_fw(uncore, GEN9_MEDIA_PG_IDLE_HYSTERESIS, 60);
 	intel_uncore_write_fw(uncore, GEN9_RENDER_PG_IDLE_HYSTERESIS, 60);
 
+	/* Wa_14011282866 Restore sampler power context */

We're inserting this into the middle of a numbered sequence. I'm not sure where that sequence comes from, but putting it here makes it look as if this was part of step "2c: Program Coarse Power Gating Policies."

drivers/gpu/drm/i915/gt/intel_rc6.c static void gen11_rc6_enable(struct intel_rc6 *rc6) · line 188

Quoted 2 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +2 -0
+	if (IS_DG1(i915) || IS_ROCKETLAKE(i915) || IS_TIGERLAKE(i915) ||
+	    IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915))

If we're using a long platform list like this in multiple places to implement a single workaround, it's generally best to make a dedicated function for it so that any future changes to the workaround bounds can be adjusted in just one place.

Matt

Quoted 32 lines
drivers/gpu/drm/i915/gt/intel_rc6.c +5 -0
+		rc6_wa_bb_restore_sampler_power_ctx(rc6);
+
 	/* 3a: Enable RC6
 	 *
 	 * With GuCRC, we do not enable bit 31 of RC_CTL,
@@ -610,6 +695,9 @@ void intel_rc6_init(struct intel_rc6 *rc6)
 		err = chv_rc6_init(rc6);
 	else if (IS_VALLEYVIEW(i915))
 		err = vlv_rc6_init(rc6);
+	else if (IS_DG1(i915) || IS_ROCKETLAKE(i915) || IS_TIGERLAKE(i915) ||
+		 IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915))
+		err = rc6_wa_bb_ctx_init(rc6);
 	else
 		err = 0;
 
drivers/gpu/drm/i915/gt/intel_rc6_types.h +3 -0
index cd4587098162..643fd4e839ad 100644
@@ -33,6 +33,9 @@ struct intel_rc6 {
 
 	struct drm_i915_gem_object *pctx;
 
+	u32 *rc6_wa_bb;
+	struct i915_vma *vma;
+
 	bool supported : 1;
 	bool enabled : 1;
 	bool manual : 1;
Signature · 1 line
2.40.0
Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation