Skip to contentSkip to conversation

drm/i915: Update workaround documentation

PATCH In review Lucas De Marchi 4 participants 7 messages Nov 8, 2022 – Nov 15, 2022

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

PATCH 1/1 drm/i915: Update workaround documentation

There were several updates in the driver on how the workarounds are handled since its documentation was written. Update the documentation to reflect the current reality.

---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 87 +++++++++++++--------
 1 file changed, 56 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gt/intel_workarounds.c +56 -31
index 3cdf5c24dbc5..0db3713c1beb 100644
@@ -17,43 +17,68 @@
 /**
  * DOC: Hardware workarounds
  *
- * This file is intended as a central place to implement most [1]_ of the
- * required workarounds for hardware to work as originally intended. They fall
- * in five basic categories depending on how/when they are applied:
+ * This is intended as a central place to implement most [1]_ of the
+ * required workarounds for hardware to work as originally intended. Hardware
+ * workarounds are register programming documented to be executed in the driver
+ * that fall outside of the normal programming sequences for a platform. There
+ * are some basic categories of workarounds, depending on how/when they are
+ * applied:
  *
- * - Workarounds that touch registers that are saved/restored to/from the HW
- *   context image. The list is emitted (via Load Register Immediate commands)
- *   everytime a new context is created.
- * - GT workarounds. The list of these WAs is applied whenever these registers
- *   revert to default values (on GPU reset, suspend/resume [2]_, etc..).
- * - Display workarounds. The list is applied during display clock-gating
- *   initialization.
- * - Workarounds that whitelist a privileged register, so that UMDs can manage
- *   them directly. This is just a special case of a MMMIO workaround (as we
- *   write the list of these to/be-whitelisted registers to some special HW
- *   registers).
- * - Workaround batchbuffers, that get executed automatically by the hardware
- *   on every HW context restore.
+ * - Context workarounds: workarounds that touch registers that are
+ *   saved/restored to/from the HW context image. The list is emitted (via Load
+ *   Register Immediate commands) once when initializing the device and saved in
+ *   the default context. That default context is then used on every context
+ *   creation to have a "primed golden context", i.e. a context image that
+ *   already contains the changes needed to all the registers.
  *
- * .. [1] Please notice that there are other WAs that, due to their nature,
- *    cannot be applied from a central place. Those are peppered around the rest
- *    of the code, as needed.
+ * - Engine workarounds: the list of these WAs is applied whenever the specific
+ *   engine is reset. It's also possible that a set of engine classes share a
+ *   common power domain and they are reset together. This happens on some
+ *   platforms with render and compute engines. In this case (at least) one of
+ *   them need to keeep the workaround programming: the approach taken in the
+ *   driver is to tie those workarounds to the first compute/render engine that
+ *   is registered.  When executing with GuC submission, engine resets are
+ *   outside of kernel driver control, hence the list of registers involved in
+ *   written once, on engine initialization, and then passed to GuC, that
+ *   saves/restores their values before/after the reset takes place. See
+ *   ``drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c`` for reference.
  *
- * .. [2] Technically, some registers are powercontext saved & restored, so they
- *    survive a suspend/resume. In practice, writing them again is not too
- *    costly and simplifies things. We can revisit this in the future.
+ * - GT workarounds: the list of these WAs is applied whenever these registers
+ *   revert to their default values: on GPU reset, suspend/resume, etc.
  *
- * Layout
- * ~~~~~~
+ * - Register whitelist: some workarounds need to be implemented in userspace,
+ *   but need to touch privileged registers. The whitelist in the kernel
+ *   instructs the hardware to allow the access to happen. From the kernel side,
+ *   this is just a special case of a MMIO workaround (as we write the list of
+ *   these to/be-whitelisted registers to some special HW registers).
  *
- * Keep things in this file ordered by WA type, as per the above (context, GT,
- * display, register whitelist, batchbuffer). Then, inside each type, keep the
- * following order:
+ * - Workaround batchbuffers: buffers that get executed automatically by the
+ *   hardware on every HW context restore. These buffers are created and
+ *   programmed in the default context so the hardware always go through those
+ *   programming sequences when switching contexts. The support for workaround
+ *   batchbuffers is enabled these hardware mechanisms:
  *
- * - Infrastructure functions and macros
- * - WAs per platform in standard gen/chrono order
- * - Public functions to init or apply the given workaround type.
- */
+ *   #. INDIRECT_CTX: A batchbuffer and an offset are provided in the default
+ *      context, pointing the hardware to jump to that location when that offset
+ *      is reached in the context restore. Workaround batchbuffer in the driver
+ *      currently uses this mechanism for all platforms.
+ *
+ *   #. BB_PER_CTX_PTR: A batchbuffer is provided in the default context,
+ *      pointing the hardware to a buffer to continue executing after the
+ *      engine registers are restored in a context restore sequence. This is
+ *      currently not used in the driver.
+ *
+ * - Display workarounds. The list is applied during display clock-gating
+ *   initialization. However most of the display workarounds may be considered
+ *   to fall under the "Others" category below.
+ *
+ * - Other:  There are WAs that, due to their nature, cannot be applied from a central
+ *   place. Those are peppered around the rest of the code, as needed.
+ *
+ * .. [1] Technically, some registers are powercontext saved & restored, so they
+ *    survive a suspend/resume. In practice, writing them again is not too
+ *    costly and simplifies things, so it's the approach taken in the driver.
+  */
 
 static void wa_init_start(struct i915_wa_list *wal, const char *name, const char *engine_name)
 {
Signature · 1 line
2.38.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Update workaround documentation

== Series Details ==

== Series Details ==

Series: drm/i915: Update workaround documentation
URL : https://patchwork.freedesktop.org/series/110639/
State : warning

== Summary ==

Error: dim checkpatch failed
834c980e8fe0 drm/i915: Update workaround documentation
-:112: WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line #112: FILE: drivers/gpu/drm/i915/gt/intel_workarounds.c:81:
+ * costly and simplifies things, so it's the approach taken in the driver.
+ */

total: 0 errors, 1 warnings, 0 checks, 99 lines checked

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Update workaround documentation

In reply to Lucas De Marchi
== Series Details ==

== Series Details ==

Series: drm/i915: Update workaround documentation
URL : https://patchwork.freedesktop.org/series/110639/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12353 -> Patchwork_110639v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (41 -> 26)
------------------------------

Missing (15): fi-ilk-m540 fi-bdw-samus fi-tgl-dsi bat-dg2-8 bat-dg2-9 fi-cfl-8700k bat-adlp-6 bat-adlp-4 fi-ctg-p8600 bat-adln-1 bat-rplp-1 bat-rpls-1 bat-rpls-2 bat-dg2-11 bat-jsl-1

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-4770: NOTRUN -> [SKIP][1] ([fdo#109271] / [fdo#111827])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/fi-hsw-4770/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][2] ([i915#4785]) -> [PASS][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/fi-hsw-4770/igt@i915_selftest@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/fi-hsw-4770/igt@i915_selftest@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785

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

* Linux: CI_DRM_12353 -> Patchwork_110639v1

CI-20190529: 20190529
CI_DRM_12353: fb2b3ddb471df2f8d305b1bb7f3705e7e0fbf6e4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7046: c58d96d0fe237474b074e3472ce09c57c830d5de @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_110639v1: fb2b3ddb471df2f8d305b1bb7f3705e7e0fbf6e4 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

d9bad5d502b2 drm/i915: Update workaround documentation

== Logs ==

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

#3 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Update workaround documentation

In reply to Lucas De Marchi
== Series Details ==

== Series Details ==

Series: drm/i915: Update workaround documentation
URL : https://patchwork.freedesktop.org/series/110639/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12353_full -> Patchwork_110639v1_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (9 -> 9)
------------------------------

No changes in participating hosts

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

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

### IGT changes ###

#### Issues hit ####

* igt@feature_discovery@psr2:
- shard-iclb: [PASS][1] -> [SKIP][2] ([i915#658])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb1/igt@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][3] -> [FAIL][4] ([i915#2842])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-tglb6/igt@gem_exec_fair@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-tglb2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-sync@rcs0:
- shard-tglb: [PASS][5] -> [SKIP][6] ([i915#2848])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-tglb7/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-tglb1/igt@gem_exec_fair@[email protected]

* igt@gem_lmem_swapping@basic:
- shard-glk: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk8/igt@[email protected]

* igt@gem_lmem_swapping@heavy-verify-multi:
- shard-apl: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#4613])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]

* igt@gem_lmem_swapping@parallel-random:
- shard-skl: NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#4613]) +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@[email protected]

* igt@gem_pwrite@basic-exhaustion:
- shard-glk: NOTRUN -> [INCOMPLETE][10] ([i915#7248])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk2/igt@[email protected]

* igt@gem_userptr_blits@dmabuf-sync:
- shard-apl: NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#3323])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-skl: NOTRUN -> [FAIL][12] ([i915#3318])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@[email protected]

* igt@i915_pm_sseu@full-enable:
- shard-skl: [PASS][13] -> [FAIL][14] ([i915#6991])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl6/igt@[email protected]

* igt@i915_selftest@live@gt_heartbeat:
- shard-skl: [PASS][15] -> [DMESG-FAIL][16] ([i915#7459])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl1/igt@i915_selftest@live@gt_heartbeat.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl1/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_suspend@debugfs-reader:
- shard-apl: [PASS][17] -> [DMESG-WARN][18] ([i915#180])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl7/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl3/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip@pipe-b-edp-1:
- shard-skl: [PASS][19] -> [FAIL][20] ([i915#2521]) +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl6/igt@kms_async_flips@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_async_flips@[email protected]

* igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_rc_ccs_cc:
- shard-glk: NOTRUN -> [SKIP][21] ([fdo#109271] / [i915#3886]) +6 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk8/igt@kms_ccs@pipe-b-bad-rotation-90-y_tiled_gen12_rc_ccs_cc.html

* igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_mc_ccs:
- shard-skl: NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#3886]) +1 similar issue
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_mc_ccs.html

* igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_rc_ccs_cc:
- shard-apl: NOTRUN -> [SKIP][23] ([fdo#109271] / [i915#3886]) +1 similar issue
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_rc_ccs_cc.html

* igt@kms_chamelium@hdmi-hpd:
- shard-apl: NOTRUN -> [SKIP][24] ([fdo#109271] / [fdo#111827])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]

* igt@kms_color_chamelium@ctm-limited-range:
- shard-skl: NOTRUN -> [SKIP][25] ([fdo#109271] / [fdo#111827]) +3 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@[email protected]

* igt@kms_color_chamelium@ctm-red-to-blue:
- shard-glk: NOTRUN -> [SKIP][26] ([fdo#109271] / [fdo#111827]) +2 similar issues
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk8/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size:
- shard-glk: [PASS][27] -> [FAIL][28] ([i915#2346])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk3/igt@kms_cursor_legacy@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk5/igt@kms_cursor_legacy@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: [PASS][29] -> [FAIL][30] ([i915#79])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl6/igt@kms_flip@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@c-edp1:
- shard-skl: [PASS][31] -> [FAIL][32] ([i915#2122])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl7/igt@kms_flip@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl4/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-upscaling@pipe-a-default-mode:
- shard-iclb: NOTRUN -> [SKIP][33] ([i915#2672]) +2 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-upscaling@pipe-a-default-mode.html

* igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-downscaling@pipe-a-valid-mode:
- shard-iclb: NOTRUN -> [SKIP][34] ([i915#2587] / [i915#2672]) +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb1/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-downscaling@pipe-a-valid-mode.html

* igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-indfb-draw-mmap-gtt:
- shard-glk: NOTRUN -> [SKIP][35] ([fdo#109271]) +87 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk8/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-indfb-draw-mmap-gtt.html

* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-gtt:
- shard-skl: NOTRUN -> [DMESG-WARN][36] ([i915#1982])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-gtt.html

* igt@kms_plane_alpha_blend@constant-alpha-max@pipe-c-hdmi-a-1:
- shard-glk: NOTRUN -> [FAIL][37] ([i915#4573]) +2 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk2/igt@kms_plane_alpha_blend@[email protected]

* igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-b-edp-1:
- shard-skl: NOTRUN -> [SKIP][38] ([fdo#109271]) +55 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_plane_scaling@[email protected]

* igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-dp-1:
- shard-apl: NOTRUN -> [SKIP][39] ([fdo#109271]) +33 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@kms_plane_scaling@[email protected]

* igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-edp-1:
- shard-iclb: [PASS][40] -> [SKIP][41] ([i915#5235]) +2 similar issues
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb1/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-edp-1.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb2/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-5@pipe-a-edp-1.html

* igt@kms_psr2_su@page_flip-nv12:
- shard-glk: NOTRUN -> [SKIP][42] ([fdo#109271] / [i915#658]) +1 similar issue
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk2/igt@kms_psr2_su@page_flip-nv12.html

* igt@kms_psr@psr2_primary_blt:
- shard-iclb: [PASS][43] -> [SKIP][44] ([fdo#109441])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb2/igt@kms_psr@psr2_primary_blt.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb1/igt@kms_psr@psr2_primary_blt.html

* igt@kms_sysfs_edid_timing:
- shard-skl: [PASS][45] -> [FAIL][46] ([i915#6493])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl1/igt@kms_sysfs_edid_timing.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl1/igt@kms_sysfs_edid_timing.html

* igt@kms_vblank@pipe-b-ts-continuation-suspend:
- shard-skl: [PASS][47] -> [INCOMPLETE][48] ([i915#7404])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl3/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl6/igt@[email protected]

* igt@sysfs_clients@sema-25:
- shard-skl: NOTRUN -> [SKIP][49] ([fdo#109271] / [i915#2994]) +1 similar issue
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@[email protected]

* igt@sysfs_heartbeat_interval@nopreempt@vcs0:
- shard-tglb: [PASS][50] -> [FAIL][51] ([i915#6015]) +4 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-tglb7/igt@sysfs_heartbeat_interval@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-tglb1/igt@sysfs_heartbeat_interval@[email protected]

#### Possible fixes ####

* igt@gem_ctx_exec@basic-nohangcheck:
- shard-tglb: [FAIL][52] ([i915#6268]) -> [PASS][53]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-tglb7/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-tglb1/igt@[email protected]

* igt@gem_exec_fair@basic-none@vecs0:
- shard-glk: [FAIL][54] ([i915#2842]) -> [PASS][55]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk3/igt@gem_exec_fair@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk6/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-apl: [FAIL][56] ([i915#2842]) -> [PASS][57]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl1/igt@gem_exec_fair@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-gtt-wc-noreloc:
- shard-skl: [DMESG-WARN][58] ([i915#1982]) -> [PASS][59]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl10/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl3/igt@[email protected]

* igt@gen9_exec_parse@allowed-single:
- shard-apl: [DMESG-WARN][60] ([i915#5566] / [i915#716]) -> [PASS][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl1/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl8/igt@[email protected]
- shard-glk: [DMESG-WARN][62] ([i915#5566] / [i915#716]) -> [PASS][63]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk7/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk1/igt@[email protected]

* igt@i915_pm_dc@dc6-dpms:
- shard-iclb: [FAIL][64] ([i915#3989] / [i915#454]) -> [PASS][65]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb3/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb6/igt@[email protected]

* igt@i915_pm_sseu@full-enable:
- shard-glk: [FAIL][66] ([i915#3524]) -> [PASS][67]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk1/igt@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk6/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip@pipe-c-edp-1:
- shard-skl: [FAIL][68] ([i915#2521]) -> [PASS][69]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl6/igt@kms_async_flips@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_async_flips@[email protected]

* igt@kms_atomic_transition@plane-primary-toggle-with-vblank-wait@pipe-a-hdmi-a-1:
- shard-glk: [DMESG-WARN][70] ([i915#118]) -> [PASS][71] +1 similar issue
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk2/igt@kms_atomic_transition@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk2/igt@kms_atomic_transition@[email protected]

* igt@kms_cursor_legacy@cursor-vs-flip@atomic-transitions-varying-size:
- shard-iclb: [FAIL][72] ([i915#5072]) -> [PASS][73]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb7/igt@kms_cursor_legacy@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb1/igt@kms_cursor_legacy@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@c-hdmi-a2:
- shard-glk: [FAIL][74] ([i915#79]) -> [PASS][75]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk6/igt@kms_flip@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk7/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible@a-edp1:
- shard-skl: [FAIL][76] ([i915#2122]) -> [PASS][77]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl10/igt@kms_flip@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl10/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-apl: [DMESG-WARN][78] ([i915#180]) -> [PASS][79]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl2/igt@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]

* igt@perf@stress-open-close:
- shard-glk: [INCOMPLETE][80] ([i915#5213]) -> [PASS][81]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk6/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk7/igt@[email protected]

* igt@perf_pmu@interrupts:
- shard-skl: [FAIL][82] ([i915#7318]) -> [PASS][83]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-skl1/igt@[email protected]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-skl6/igt@[email protected]

#### Warnings ####

* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-tglb: [SKIP][84] ([i915#2848]) -> [FAIL][85] ([i915#2842])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-tglb1/igt@gem_exec_fair@[email protected]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-tglb8/igt@gem_exec_fair@[email protected]

* igt@gem_pread@exhaustion:
- shard-apl: [WARN][86] ([i915#2658]) -> [INCOMPLETE][87] ([i915#7248])
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl2/igt@[email protected]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl2/igt@[email protected]
- shard-glk: [INCOMPLETE][88] ([i915#7248]) -> [WARN][89] ([i915#2658])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-glk3/igt@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-glk6/igt@[email protected]

* igt@kms_psr2_sf@plane-move-sf-dmg-area:
- shard-iclb: [SKIP][90] ([fdo#111068] / [i915#658]) -> [SKIP][91] ([i915#2920]) +1 similar issue
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-iclb1/igt@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-iclb2/igt@[email protected]

* igt@runner@aborted:
- shard-apl: ([FAIL][92], [FAIL][93], [FAIL][94], [FAIL][95], [FAIL][96]) ([fdo#109271] / [i915#180] / [i915#3002] / [i915#4312]) -> ([FAIL][97], [FAIL][98], [FAIL][99], [FAIL][100]) ([i915#180] / [i915#3002] / [i915#4312])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl8/igt@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl3/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl2/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl2/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12353/shard-apl1/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl1/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl3/igt@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110639v1/shard-apl6/igt@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2848]: https://gitlab.freedesktop.org/drm/intel/issues/2848
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
[i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3524]: https://gitlab.freedesktop.org/drm/intel/issues/3524
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4573]: https://gitlab.freedesktop.org/drm/intel/issues/4573
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5072]: https://gitlab.freedesktop.org/drm/intel/issues/5072
[i915#5213]: https://gitlab.freedesktop.org/drm/intel/issues/5213
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#6015]: https://gitlab.freedesktop.org/drm/intel/issues/6015
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6493]: https://gitlab.freedesktop.org/drm/intel/issues/6493
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6991]: https://gitlab.freedesktop.org/drm/intel/issues/6991
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#7248]: https://gitlab.freedesktop.org/drm/intel/issues/7248
[i915#7318]: https://gitlab.freedesktop.org/drm/intel/issues/7318
[i915#7404]: https://gitlab.freedesktop.org/drm/intel/issues/7404
[i915#7459]: https://gitlab.freedesktop.org/drm/intel/issues/7459
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79

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

* Linux: CI_DRM_12353 -> Patchwork_110639v1

CI-20190529: 20190529
CI_DRM_12353: fb2b3ddb471df2f8d305b1bb7f3705e7e0fbf6e4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7046: c58d96d0fe237474b074e3472ce09c57c830d5de @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_110639v1: fb2b3ddb471df2f8d305b1bb7f3705e7e0fbf6e4 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

Acked-by on v1 1/1
#4 lore raw
In reply to Lucas De Marchi
Quoted 74 lines · Lucas De Marchi

There were several updates in the driver on how the workarounds are handled since its documentation was written. Update the documentation to reflect the current reality.

---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 87 +++++++++++++--------
 1 file changed, 56 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gt/intel_workarounds.c +29 -24
index 3cdf5c24dbc5..0db3713c1beb 100644
@@ -17,43 +17,68 @@
 /**
  * DOC: Hardware workarounds
  *
- * This file is intended as a central place to implement most [1]_ of the
- * required workarounds for hardware to work as originally intended. They fall
- * in five basic categories depending on how/when they are applied:
+ * This is intended as a central place to implement most [1]_ of the
+ * required workarounds for hardware to work as originally intended. Hardware
+ * workarounds are register programming documented to be executed in the driver
+ * that fall outside of the normal programming sequences for a platform. There
+ * are some basic categories of workarounds, depending on how/when they are
+ * applied:
  *
- * - Workarounds that touch registers that are saved/restored to/from the HW
- *   context image. The list is emitted (via Load Register Immediate commands)
- *   everytime a new context is created.
- * - GT workarounds. The list of these WAs is applied whenever these registers
- *   revert to default values (on GPU reset, suspend/resume [2]_, etc..).
- * - Display workarounds. The list is applied during display clock-gating
- *   initialization.
- * - Workarounds that whitelist a privileged register, so that UMDs can manage
- *   them directly. This is just a special case of a MMMIO workaround (as we
- *   write the list of these to/be-whitelisted registers to some special HW
- *   registers).
- * - Workaround batchbuffers, that get executed automatically by the hardware
- *   on every HW context restore.
+ * - Context workarounds: workarounds that touch registers that are
+ *   saved/restored to/from the HW context image. The list is emitted (via Load
+ *   Register Immediate commands) once when initializing the device and saved in
+ *   the default context. That default context is then used on every context
+ *   creation to have a "primed golden context", i.e. a context image that
+ *   already contains the changes needed to all the registers.
  *
- * .. [1] Please notice that there are other WAs that, due to their nature,
- *    cannot be applied from a central place. Those are peppered around the rest
- *    of the code, as needed.
+ * - Engine workarounds: the list of these WAs is applied whenever the specific
+ *   engine is reset. It's also possible that a set of engine classes share a
+ *   common power domain and they are reset together. This happens on some
+ *   platforms with render and compute engines. In this case (at least) one of
+ *   them need to keeep the workaround programming: the approach taken in the
+ *   driver is to tie those workarounds to the first compute/render engine that
+ *   is registered.  When executing with GuC submission, engine resets are
+ *   outside of kernel driver control, hence the list of registers involved in
+ *   written once, on engine initialization, and then passed to GuC, that
+ *   saves/restores their values before/after the reset takes place. See
+ *   ``drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c`` for reference.
  *
- * .. [2] Technically, some registers are powercontext saved & restored, so they
- *    survive a suspend/resume. In practice, writing them again is not too
- *    costly and simplifies things. We can revisit this in the future.
+ * - GT workarounds: the list of these WAs is applied whenever these registers
+ *   revert to their default values: on GPU reset, suspend/resume, etc.
  *
- * Layout
- * ~~~~~~
+ * - Register whitelist: some workarounds need to be implemented in userspace,
+ *   but need to touch privileged registers. The whitelist in the kernel
+ *   instructs the hardware to allow the access to happen. From the kernel side,
+ *   this is just a special case of a MMIO workaround (as we write the list of

drivers/gpu/drm/i915/gt/intel_workarounds.c line 59

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +6 -3
+ *   these to/be-whitelisted registers to some special HW registers).
  *
- * Keep things in this file ordered by WA type, as per the above (context, GT,
- * display, register whitelist, batchbuffer). Then, inside each type, keep the
- * following order:
+ * - Workaround batchbuffers: buffers that get executed automatically by the
+ *   hardware on every HW context restore. These buffers are created and
+ *   programmed in the default context so the hardware always go through those
+ *   programming sequences when switching contexts. The support for workaround
+ *   batchbuffers is enabled these hardware mechanisms:

Did you want to say "is enabled *through* these" ?

Rest looks good.

Quoted 32 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +21 -4
  *
- * - Infrastructure functions and macros
- * - WAs per platform in standard gen/chrono order
- * - Public functions to init or apply the given workaround type.
- */
+ *   #. INDIRECT_CTX: A batchbuffer and an offset are provided in the default
+ *      context, pointing the hardware to jump to that location when that offset
+ *      is reached in the context restore. Workaround batchbuffer in the driver
+ *      currently uses this mechanism for all platforms.
+ *
+ *   #. BB_PER_CTX_PTR: A batchbuffer is provided in the default context,
+ *      pointing the hardware to a buffer to continue executing after the
+ *      engine registers are restored in a context restore sequence. This is
+ *      currently not used in the driver.
+ *
+ * - Display workarounds. The list is applied during display clock-gating
+ *   initialization. However most of the display workarounds may be considered
+ *   to fall under the "Others" category below.
+ *
+ * - Other:  There are WAs that, due to their nature, cannot be applied from a central
+ *   place. Those are peppered around the rest of the code, as needed.
+ *
+ * .. [1] Technically, some registers are powercontext saved & restored, so they
+ *    survive a suspend/resume. In practice, writing them again is not too
+ *    costly and simplifies things, so it's the approach taken in the driver.
+  */
 
 static void wa_init_start(struct i915_wa_list *wal, const char *name, const char *engine_name)
 {
Signature · 1 line
2.38.1
#5 lore raw
In reply to Lucas De Marchi
Quoted 14 lines · Lucas De Marchi

There were several updates in the driver on how the workarounds are handled since its documentation was written. Update the documentation to reflect the current reality.

---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 87 +++++++++++++--------
 1 file changed, 56 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gt/intel_workarounds.c +0 -0
index 3cdf5c24dbc5..0db3713c1beb 100644

drivers/gpu/drm/i915/gt/intel_workarounds.c line 20

Quoted 7 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +1 -3
@@ -17,43 +17,68 @@
 /**
  * DOC: Hardware workarounds
  *
- * This file is intended as a central place to implement most [1]_ of the
- * required workarounds for hardware to work as originally intended. They fall
- * in five basic categories depending on how/when they are applied:
+ * This is intended as a central place to implement most [1]_ of the

Your footnotes don't hook up properly anymore. The original code had
[1] and [2], but the new code hooks [1] to what used to be [2].

Since we moved this file under gt/ a while back, I wonder if we should note somehow that sgunit/soc workarounds and display workarounds aren't expected to be part of this file?

Quoted 36 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +18 -16
+ * required workarounds for hardware to work as originally intended. Hardware
+ * workarounds are register programming documented to be executed in the driver
+ * that fall outside of the normal programming sequences for a platform. There
+ * are some basic categories of workarounds, depending on how/when they are
+ * applied:
  *
- * - Workarounds that touch registers that are saved/restored to/from the HW
- *   context image. The list is emitted (via Load Register Immediate commands)
- *   everytime a new context is created.
- * - GT workarounds. The list of these WAs is applied whenever these registers
- *   revert to default values (on GPU reset, suspend/resume [2]_, etc..).
- * - Display workarounds. The list is applied during display clock-gating
- *   initialization.
- * - Workarounds that whitelist a privileged register, so that UMDs can manage
- *   them directly. This is just a special case of a MMMIO workaround (as we
- *   write the list of these to/be-whitelisted registers to some special HW
- *   registers).
- * - Workaround batchbuffers, that get executed automatically by the hardware
- *   on every HW context restore.
+ * - Context workarounds: workarounds that touch registers that are
+ *   saved/restored to/from the HW context image. The list is emitted (via Load
+ *   Register Immediate commands) once when initializing the device and saved in
+ *   the default context. That default context is then used on every context
+ *   creation to have a "primed golden context", i.e. a context image that
+ *   already contains the changes needed to all the registers.
  *
- * .. [1] Please notice that there are other WAs that, due to their nature,
- *    cannot be applied from a central place. Those are peppered around the rest
- *    of the code, as needed.
+ * - Engine workarounds: the list of these WAs is applied whenever the specific
+ *   engine is reset. It's also possible that a set of engine classes share a
+ *   common power domain and they are reset together. This happens on some
+ *   platforms with render and compute engines. In this case (at least) one of
+ *   them need to keeep the workaround programming: the approach taken in the
+ *   driver is to tie those workarounds to the first compute/render engine that
+ *   is registered.  When executing with GuC submission, engine resets are

drivers/gpu/drm/i915/gt/intel_workarounds.c line 47

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +6 -3
+ *   outside of kernel driver control, hence the list of registers involved in
+ *   written once, on engine initialization, and then passed to GuC, that
+ *   saves/restores their values before/after the reset takes place. See
+ *   ``drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c`` for reference.
  *
- * .. [2] Technically, some registers are powercontext saved & restored, so they
- *    survive a suspend/resume. In practice, writing them again is not too
- *    costly and simplifies things. We can revisit this in the future.
+ * - GT workarounds: the list of these WAs is applied whenever these registers
+ *   revert to their default values: on GPU reset, suspend/resume, etc.

This is where the new [1] used to be referenced from.

Quoted 25 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +13 -9
  *
- * Layout
- * ~~~~~~
+ * - Register whitelist: some workarounds need to be implemented in userspace,
+ *   but need to touch privileged registers. The whitelist in the kernel
+ *   instructs the hardware to allow the access to happen. From the kernel side,
+ *   this is just a special case of a MMIO workaround (as we write the list of
+ *   these to/be-whitelisted registers to some special HW registers).
  *
- * Keep things in this file ordered by WA type, as per the above (context, GT,
- * display, register whitelist, batchbuffer). Then, inside each type, keep the
- * following order:
+ * - Workaround batchbuffers: buffers that get executed automatically by the
+ *   hardware on every HW context restore. These buffers are created and
+ *   programmed in the default context so the hardware always go through those
+ *   programming sequences when switching contexts. The support for workaround
+ *   batchbuffers is enabled these hardware mechanisms:
  *
- * - Infrastructure functions and macros
- * - WAs per platform in standard gen/chrono order
- * - Public functions to init or apply the given workaround type.
- */
+ *   #. INDIRECT_CTX: A batchbuffer and an offset are provided in the default
+ *      context, pointing the hardware to jump to that location when that offset
+ *      is reached in the context restore. Workaround batchbuffer in the driver

drivers/gpu/drm/i915/gt/intel_workarounds.c line 73

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +10 -0
+ *      currently uses this mechanism for all platforms.
+ *
+ *   #. BB_PER_CTX_PTR: A batchbuffer is provided in the default context,
+ *      pointing the hardware to a buffer to continue executing after the
+ *      engine registers are restored in a context restore sequence. This is
+ *      currently not used in the driver.
+ *
+ * - Display workarounds. The list is applied during display clock-gating
+ *   initialization. However most of the display workarounds may be considered
+ *   to fall under the "Others" category below.

We don't have any such list today. And if we do add one, I'm not sure it would happen here in gt/. Maybe we should just add this as an extra "or" in the "Other" description below for now?

Matt

Quoted 14 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +8 -0
+ *
+ * - Other:  There are WAs that, due to their nature, cannot be applied from a central
+ *   place. Those are peppered around the rest of the code, as needed.
+ *
+ * .. [1] Technically, some registers are powercontext saved & restored, so they
+ *    survive a suspend/resume. In practice, writing them again is not too
+ *    costly and simplifies things, so it's the approach taken in the driver.
+  */
 
 static void wa_init_start(struct i915_wa_list *wal, const char *name, const char *engine_name)
 {
Signature · 1 line
2.38.1
Signature · 4 lines
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
#6 lore raw
Quoted 10 lines · Matt Roper
Quoted 9 lines · Lucas De Marchi

There were several updates in the driver on how the workarounds are handled since its documentation was written. Update the documentation to reflect the current reality.

---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 87 +++++++++++++--------
 1 file changed, 56 insertions(+), 31 deletions(-)
Quoted 15 lines

drivers/gpu/drm/i915/gt/intel_workarounds.c line 20

Quoted 12 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +1 -3
index 3cdf5c24dbc5..0db3713c1beb 100644
@@ -17,43 +17,68 @@
 /**
  * DOC: Hardware workarounds
  *
- * This file is intended as a central place to implement most [1]_ of the
- * required workarounds for hardware to work as originally intended. They fall
- * in five basic categories depending on how/when they are applied:
+ * This is intended as a central place to implement most [1]_ of the

Your footnotes don't hook up properly anymore. The original code had
[1] and [2], but the new code hooks [1] to what used to be [2].

rewording this for next version

Quoted 4 lines

Since we moved this file under gt/ a while back, I wonder if we should note somehow that sgunit/soc workarounds and display workarounds aren't expected to be part of this file?

I'm trying to make this agnostic to "this file" since it doesn't look correct when reading the html documentation. Next version I'm rewording some of this to just reference "central place".

Quoted 86 lines
Quoted 37 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +18 -16
+ * required workarounds for hardware to work as originally intended. Hardware
+ * workarounds are register programming documented to be executed in the driver
+ * that fall outside of the normal programming sequences for a platform. There
+ * are some basic categories of workarounds, depending on how/when they are
+ * applied:
  *
- * - Workarounds that touch registers that are saved/restored to/from the HW
- *   context image. The list is emitted (via Load Register Immediate commands)
- *   everytime a new context is created.
- * - GT workarounds. The list of these WAs is applied whenever these registers
- *   revert to default values (on GPU reset, suspend/resume [2]_, etc..).
- * - Display workarounds. The list is applied during display clock-gating
- *   initialization.
- * - Workarounds that whitelist a privileged register, so that UMDs can manage
- *   them directly. This is just a special case of a MMMIO workaround (as we
- *   write the list of these to/be-whitelisted registers to some special HW
- *   registers).
- * - Workaround batchbuffers, that get executed automatically by the hardware
- *   on every HW context restore.
+ * - Context workarounds: workarounds that touch registers that are
+ *   saved/restored to/from the HW context image. The list is emitted (via Load
+ *   Register Immediate commands) once when initializing the device and saved in
+ *   the default context. That default context is then used on every context
+ *   creation to have a "primed golden context", i.e. a context image that
+ *   already contains the changes needed to all the registers.
  *
- * .. [1] Please notice that there are other WAs that, due to their nature,
- *    cannot be applied from a central place. Those are peppered around the rest
- *    of the code, as needed.
+ * - Engine workarounds: the list of these WAs is applied whenever the specific
+ *   engine is reset. It's also possible that a set of engine classes share a
+ *   common power domain and they are reset together. This happens on some
+ *   platforms with render and compute engines. In this case (at least) one of
+ *   them need to keeep the workaround programming: the approach taken in the
+ *   driver is to tie those workarounds to the first compute/render engine that
+ *   is registered.  When executing with GuC submission, engine resets are

drivers/gpu/drm/i915/gt/intel_workarounds.c line 47

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +6 -3
+ *   outside of kernel driver control, hence the list of registers involved in
+ *   written once, on engine initialization, and then passed to GuC, that
+ *   saves/restores their values before/after the reset takes place. See
+ *   ``drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c`` for reference.
  *
- * .. [2] Technically, some registers are powercontext saved & restored, so they
- *    survive a suspend/resume. In practice, writing them again is not too
- *    costly and simplifies things. We can revisit this in the future.
+ * - GT workarounds: the list of these WAs is applied whenever these registers
+ *   revert to their default values: on GPU reset, suspend/resume, etc.

This is where the new [1] used to be referenced from.

Quoted 25 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +13 -9
  *
- * Layout
- * ~~~~~~
+ * - Register whitelist: some workarounds need to be implemented in userspace,
+ *   but need to touch privileged registers. The whitelist in the kernel
+ *   instructs the hardware to allow the access to happen. From the kernel side,
+ *   this is just a special case of a MMIO workaround (as we write the list of
+ *   these to/be-whitelisted registers to some special HW registers).
  *
- * Keep things in this file ordered by WA type, as per the above (context, GT,
- * display, register whitelist, batchbuffer). Then, inside each type, keep the
- * following order:
+ * - Workaround batchbuffers: buffers that get executed automatically by the
+ *   hardware on every HW context restore. These buffers are created and
+ *   programmed in the default context so the hardware always go through those
+ *   programming sequences when switching contexts. The support for workaround
+ *   batchbuffers is enabled these hardware mechanisms:
  *
- * - Infrastructure functions and macros
- * - WAs per platform in standard gen/chrono order
- * - Public functions to init or apply the given workaround type.
- */
+ *   #. INDIRECT_CTX: A batchbuffer and an offset are provided in the default
+ *      context, pointing the hardware to jump to that location when that offset
+ *      is reached in the context restore. Workaround batchbuffer in the driver

drivers/gpu/drm/i915/gt/intel_workarounds.c line 73

Quoted 10 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c +10 -0
+ *      currently uses this mechanism for all platforms.
+ *
+ *   #. BB_PER_CTX_PTR: A batchbuffer is provided in the default context,
+ *      pointing the hardware to a buffer to continue executing after the
+ *      engine registers are restored in a context restore sequence. This is
+ *      currently not used in the driver.
+ *
+ * - Display workarounds. The list is applied during display clock-gating
+ *   initialization. However most of the display workarounds may be considered
+ *   to fall under the "Others" category below.
Quoted 3 lines

We don't have any such list today. And if we do add one, I'm not sure it would happen here in gt/. Maybe we should just add this as an extra "or" in the "Other" description below for now?

yeah, sounds good. I'm moving display workarounds under "Other" in the next version.

thanks
Lucas De Marchi