Skip to contentSkip to conversation

Apply Wa_16018031267 / Wa_16018063123

PATCH Superseded Jonathan Cavitt 2 participants 7 messages Sep 19, 2023 – Sep 20, 2023

Subsystems (2)

v11 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

v11 cover Apply Wa_16018031267 / Wa_16018063123

Apply Wa_16018031267 / Wa_16018063123. This necessitates submitting a fastcolor blit as WABB and setting the copy engine arbitration to round-robin mode.

v2:
- Rename old platform check in second patch to match declaration in first patch.
- Refactor second patch name to match first patch.

v3:
- Move NEEDS_FASTCOLOR_BLT_WABB to intel_gt.h.
- Refactor NEEDS_FASTCOLOR_BLT_WABB to make it more streamlined to use.
- Stop dividing PAGE_SIZE by sizeof(u32) when computing ctx_bb_ggtt_addr for lrc_setup_bb_per_ctx.
- Reduce comment complexity.
- Fix several checkpatch warnings.

v4:
- Actually stop dividing PAGE_SIZE by sizeof(u32) when computing ctx_bb_ggtt_addr for lrc_setup_bb_per_ctx.

v5:
- Stop dividing PAGE_SIZE by sizeof(u32) in
check_ring_start during lrc live selftest.

v6:
- Append MI_BATCH_BUFFER_END to end of all PER_CTX_BB command streams.
- No longer skip on empty, as command stream will never be empty (always contains at least MI_BATCH_BUFFER_END).
- No longer append MI_NOOP until cachline aligned (was a fragment from INDIRECT_CTX setup).

v7:
- Use 0x6b instead of 0 for color to maintain functionality.

v8:
- Revert v7.
- Add some reserved kernel space per vm to run the workaround on.

v9:
- Hide reserved kernel space per vm from userspace.

v10:
- Revert v7 properly.
- Test on updated IGT.

v11:
- Remove Test-with tag.
- Reserve two pages per vm for workaround.

CC Joonas Lahtinen <[email protected]>
CC Rodrigo Vivi <[email protected]>
CC Tomasz Mistat <[email protected]>
CC Gregory F Germano <[email protected]>
CC Matt Roper <[email protected]>
CC James Ausmus <[email protected]>
CC Chris Wilson <[email protected]>
CC Andi Shyti <[email protected]>

Jonathan Cavitt (3):
drm/i915: Reserve some kernel space per vm drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123 drm/i915: Set copy engine arbitration for Wa_16018031267 /

    Wa_16018063123
 drivers/gpu/drm/i915/gt/gen8_ppgtt.c        |   7 ++
 drivers/gpu/drm/i915/gt/intel_engine_regs.h |   6 ++
 drivers/gpu/drm/i915/gt/intel_gt.h          |   4 +
 drivers/gpu/drm/i915/gt/intel_gt_types.h    |   2 +
 drivers/gpu/drm/i915/gt/intel_gtt.h         |   1 +
 drivers/gpu/drm/i915/gt/intel_lrc.c         | 100 +++++++++++++++++++-
 drivers/gpu/drm/i915/gt/intel_workarounds.c |   5 +
 drivers/gpu/drm/i915/gt/selftest_lrc.c      |  65 +++++++++----
 8 files changed, 169 insertions(+), 21 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v11 1/3 drm/i915: Reserve some kernel space per vm

Reserve two pages in each vm for kernel space to use for things such as workarounds.

---
 drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 7 +++++++
 drivers/gpu/drm/i915/gt/intel_gtt.h  | 1 +
 2 files changed, 8 insertions(+)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +7 -0
index 9895e18df0435..d6c0c84eda736 100644
@@ -230,6 +230,7 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
 				     gen8_pd_top_count(vm), vm->top);
 
 	free_scratch(vm);
+	drm_mm_remove_node(&vm->rsvd);
 }
 
 static u64 __gen8_ppgtt_clear(struct i915_address_space * const vm,
@@ -1011,6 +1012,12 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt,
 	ppgtt->vm.foreach = gen8_ppgtt_foreach;
 	ppgtt->vm.cleanup = gen8_ppgtt_cleanup;
 
+	ppgtt->vm.rsvd.start = ppgtt->vm.total - (SZ_4K * 2);
+	ppgtt->vm.rsvd.size = (SZ_4K * 2);
+	ppgtt->vm.rsvd.color = I915_COLOR_UNEVICTABLE;
+	GEM_BUG_ON(drm_mm_reserve_node(&ppgtt->vm.mm, &ppgtt->vm.rsvd));
+	ppgtt->vm.total -= (SZ_4K * 2);
+
 	err = gen8_init_scratch(&ppgtt->vm);
 	if (err)
 		goto err_put;
drivers/gpu/drm/i915/gt/intel_gtt.h +1 -0
index 346ec8ec2edda..ab38a158fc715 100644
@@ -246,6 +246,7 @@ struct i915_address_space {
 	struct work_struct release_work;
 
 	struct drm_mm mm;
+	struct drm_mm_node rsvd;
 	struct intel_gt *gt;
 	struct drm_i915_private *i915;
 	struct device *dma;
Signature · 1 line
2.25.1
#2 lore raw

PATCH v11 2/3 drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123

In reply to Jonathan Cavitt

Apply WABB blit for Wa_16018031267 / Wa_16018063123. Additionally, update the lrc selftest to exercise the new WABB changes.

---
 drivers/gpu/drm/i915/gt/intel_engine_regs.h |   3 +
 drivers/gpu/drm/i915/gt/intel_gt.h          |   4 +
 drivers/gpu/drm/i915/gt/intel_gt_types.h    |   2 +
 drivers/gpu/drm/i915/gt/intel_lrc.c         | 100 +++++++++++++++++++-
 drivers/gpu/drm/i915/gt/selftest_lrc.c      |  65 +++++++++----
 5 files changed, 153 insertions(+), 21 deletions(-)
drivers/gpu/drm/i915/gt/intel_engine_regs.h +3 -0
index 6b9d9f8376692..2e06bea73297a 100644
@@ -118,6 +118,9 @@
 #define   CCID_EXTENDED_STATE_RESTORE		BIT(2)
 #define   CCID_EXTENDED_STATE_SAVE		BIT(3)
 #define RING_BB_PER_CTX_PTR(base)		_MMIO((base) + 0x1c0) /* gen8+ */
+#define   PER_CTX_BB_FORCE			BIT(2)
+#define   PER_CTX_BB_VALID			BIT(0)
+
 #define RING_INDIRECT_CTX(base)			_MMIO((base) + 0x1c4) /* gen8+ */
 #define RING_INDIRECT_CTX_OFFSET(base)		_MMIO((base) + 0x1c8) /* gen8+ */
 #define ECOSKPD(base)				_MMIO((base) + 0x1d0)
drivers/gpu/drm/i915/gt/intel_gt.h +4 -0
index 239848bcb2a42..40cc0005dd735 100644
@@ -83,6 +83,10 @@ struct drm_printer;
 		  ##__VA_ARGS__);					\
 } while (0)
 
+#define NEEDS_FASTCOLOR_BLT_WABB(engine) ( \
+	IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 55), IP_VER(12, 71)) && \
+	engine->class == COPY_ENGINE_CLASS)
+
 static inline bool gt_is_root(struct intel_gt *gt)
 {
 	return !gt->info.id;
drivers/gpu/drm/i915/gt/intel_gt_types.h +2 -0
index def7dd0eb6f19..4917633f299dd 100644
@@ -307,6 +307,8 @@ enum intel_gt_scratch_field {
 
 	/* 8 bytes */
 	INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
+
+	INTEL_GT_SCRATCH_FIELD_DUMMY_BLIT = 384,
 };
 
 #define intel_gt_support_legacy_fencing(gt) ((gt)->ggtt->num_fences > 0)
drivers/gpu/drm/i915/gt/intel_lrc.c +97 -3

141 lines not on this page · raw message

drivers/gpu/drm/i915/gt/selftest_lrc.c +47 -18

148 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

PATCH v11 3/3 drm/i915: Set copy engine arbitration for Wa_16018031267 / Wa_16018063123

In reply to Jonathan Cavitt

Set copy engine arbitration into round robin mode for part of Wa_16018031267 / Wa_16018063123 mitigation.

---
 drivers/gpu/drm/i915/gt/intel_engine_regs.h | 3 +++
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 5 +++++
 2 files changed, 8 insertions(+)
drivers/gpu/drm/i915/gt/intel_engine_regs.h +3 -0
index 2e06bea73297a..823c6c40213f5 100644
@@ -124,6 +124,9 @@
 #define RING_INDIRECT_CTX(base)			_MMIO((base) + 0x1c4) /* gen8+ */
 #define RING_INDIRECT_CTX_OFFSET(base)		_MMIO((base) + 0x1c8) /* gen8+ */
 #define ECOSKPD(base)				_MMIO((base) + 0x1d0)
+#define   XEHP_BLITTER_SCHEDULING_MODE_MASK	REG_GENMASK(12, 11)
+#define   XEHP_BLITTER_ROUND_ROBIN_MODE		\
+		REG_FIELD_PREP(XEHP_BLITTER_SCHEDULING_MODE_MASK, 1)
 #define   ECO_CONSTANT_BUFFER_SR_DISABLE	REG_BIT(4)
 #define   ECO_GATING_CX_ONLY			REG_BIT(3)
 #define   GEN6_BLITTER_FBC_NOTIFY		REG_BIT(3)
drivers/gpu/drm/i915/gt/intel_workarounds.c +5 -0
index 660d4f358eab7..b8f3b991e4202 100644
@@ -2781,6 +2781,11 @@ xcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
 			 RING_SEMA_WAIT_POLL(engine->mmio_base),
 			 1);
 	}
+	/* Wa_16018031267, Wa_16018063123 */
+	if (NEEDS_FASTCOLOR_BLT_WABB(engine))
+		wa_masked_field_set(wal, ECOSKPD(engine->mmio_base),
+				    XEHP_BLITTER_SCHEDULING_MODE_MASK,
+				    XEHP_BLITTER_ROUND_ROBIN_MODE);
 }
 
 static void
Signature · 1 line
2.25.1
#4 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Apply Wa_16018031267 / Wa_16018063123

In reply to Jonathan Cavitt
== Series Details ==

== Series Details ==

Series: Apply Wa_16018031267 / Wa_16018063123
URL : https://patchwork.freedesktop.org/series/123941/
State : warning

== Summary ==

Error: dim checkpatch failed
af70823af2ff drm/i915: Reserve some kernel space per vm
-:31: WARNING:AVOID_BUG: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants #31: FILE: drivers/gpu/drm/i915/gt/gen8_ppgtt.c:1018:
+ GEM_BUG_ON(drm_mm_reserve_node(&ppgtt->vm.mm, &ppgtt->vm.rsvd));

total: 0 errors, 1 warnings, 0 checks, 26 lines checked
90081c3b60d0 drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123 -:10: WARNING:BAD_SIGN_OFF: Co-developed-by and Signed-off-by: name/email do not match #10:

-:35: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'engine' - possible side-effects? #35: FILE: drivers/gpu/drm/i915/gt/intel_gt.h:86:
+#define NEEDS_FASTCOLOR_BLT_WABB(engine) ( \
+ IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 55), IP_VER(12, 71)) && \
+ engine->class == COPY_ENGINE_CLASS)

-:35: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'engine' may be better as '(engine)' to avoid precedence issues #35: FILE: drivers/gpu/drm/i915/gt/intel_gt.h:86:
+#define NEEDS_FASTCOLOR_BLT_WABB(engine) ( \
+ IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 55), IP_VER(12, 71)) && \
+ engine->class == COPY_ENGINE_CLASS)

-:68: WARNING:AVOID_BUG: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants #68: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:836:
+ GEM_BUG_ON(lrc_ring_wa_bb_per_ctx(engine) == -1);

-:183: WARNING:AVOID_BUG: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants #183: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:1498:
+ GEM_BUG_ON(cs - start > I915_GTT_PAGE_SIZE / sizeof(*cs));

total: 0 errors, 3 warnings, 2 checks, 316 lines checked
aca1de7e9944 drm/i915: Set copy engine arbitration for Wa_16018031267 / Wa_16018063123

#6 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for Apply Wa_16018031267 / Wa_16018063123

In reply to Jonathan Cavitt
== Series Details ==

== Series Details ==

Series: Apply Wa_16018031267 / Wa_16018063123
URL : https://patchwork.freedesktop.org/series/123941/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13653 -> Patchwork_123941v1
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes
introduced in Patchwork_123941v1, please notify your bug team ([email protected]) 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_123941v1/index.html

Participating hosts (38 -> 37)
------------------------------

Additional (1): fi-hsw-4770
Missing (2): fi-kbl-soraka fi-snb-2520m

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@gem_contexts:
- bat-mtlp-8: NOTRUN -> [DMESG-FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-mtlp-8/igt@i915_selftest@live@gem_contexts.html

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

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

### CI changes ###

#### Issues hit ####

* boot:
- fi-hsw-4770: NOTRUN -> [FAIL][2] ([i915#8293])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/fi-hsw-4770/boot.html

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s0@lmem0:
- bat-dg2-9: [PASS][3] -> [INCOMPLETE][4] ([i915#9275])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-dg2-9/igt@gem_exec_suspend@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-dg2-9/igt@gem_exec_suspend@[email protected]

* igt@gem_exec_suspend@basic-s0@smem:
- bat-mtlp-8: NOTRUN -> [ABORT][5] ([i915#9262])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-mtlp-8/igt@gem_exec_suspend@[email protected]

* igt@i915_selftest@live@gem_contexts:
- bat-atsm-1: [PASS][6] -> [DMESG-FAIL][7] ([i915#7913])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-atsm-1/igt@i915_selftest@live@gem_contexts.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-atsm-1/igt@i915_selftest@live@gem_contexts.html
- bat-dg2-9: [PASS][8] -> [DMESG-FAIL][9] ([i915#7913])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-dg2-9/igt@i915_selftest@live@gem_contexts.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-dg2-9/igt@i915_selftest@live@gem_contexts.html

* igt@i915_selftest@live@workarounds:
- bat-dg2-11: [PASS][10] -> [DMESG-FAIL][11] ([i915#7913]) +1 other test dmesg-fail
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-dg2-11/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-dg2-11/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-mtlp-8: NOTRUN -> [SKIP][12] ([i915#6645])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-mtlp-8/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [PASS][13] -> [ABORT][14] ([i915#8668])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-rplp-1/igt@kms_pipe_crc_basic@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@requests:
- bat-mtlp-8: [ABORT][15] ([i915#9262]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-mtlp-8/igt@i915_selftest@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-mtlp-8/igt@i915_selftest@[email protected]

* igt@kms_chamelium_edid@hdmi-edid-read:
- {bat-dg2-13}: [DMESG-WARN][17] ([i915#7952]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-dg2-13/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-dg2-13/igt@[email protected]

* igt@kms_chamelium_frames@dp-crc-fast:
- {bat-dg2-13}: [DMESG-WARN][19] ([Intel XE#485]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-dg2-13/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-dg2-13/igt@[email protected]

#### Warnings ####

* igt@i915_suspend@basic-s3-without-i915:
- bat-rpls-1: [ABORT][21] ([i915#7978] / [i915#8668]) -> [INCOMPLETE][22] ([i915#9136])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13653/bat-rpls-1/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_123941v1/bat-rpls-1/igt@[email protected]

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

[Intel XE#485]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/485
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7952]: https://gitlab.freedesktop.org/drm/intel/issues/7952
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
[i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#9136]: https://gitlab.freedesktop.org/drm/intel/issues/9136
[i915#9262]: https://gitlab.freedesktop.org/drm/intel/issues/9262
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275

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

* Linux: CI_DRM_13653 -> Patchwork_123941v1

CI-20190529: 20190529
CI_DRM_13653: 56d487b04d902a227f8bc5cc93b73a71f7c06a12 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7493: 2517e42d612e0c1ca096acf8b5f6177f7ef4bce7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_123941v1: 56d487b04d902a227f8bc5cc93b73a71f7c06a12 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

a3b3e6a8fb0c drm/i915: Set copy engine arbitration for Wa_16018031267 / Wa_16018063123 c30d7d1c28e2 drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123 a280bfca23de drm/i915: Reserve some kernel space per vm

== Logs ==

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