|
39 | 39 | * Register Immediate commands) once when initializing the device and saved in |
40 | 40 | * the default context. That default context is then used on every context |
41 | 41 | * creation to have a "primed golden context", i.e. a context image that |
42 | | - * already contains the changes needed to all the registers. |
| 42 | + * already contains the changes needed to all the registers. See |
| 43 | + * drivers/gpu/drm/xe/xe_lrc.c for default context handling. |
43 | 44 | * |
44 | 45 | * - Engine workarounds: the list of these WAs is applied whenever the specific |
45 | 46 | * engine is reset. It's also possible that a set of engine classes share a |
|
48 | 49 | * them need to keeep the workaround programming: the approach taken in the |
49 | 50 | * driver is to tie those workarounds to the first compute/render engine that |
50 | 51 | * is registered. When executing with GuC submission, engine resets are |
51 | | - * outside of kernel driver control, hence the list of registers involved in |
| 52 | + * outside of kernel driver control, hence the list of registers involved is |
52 | 53 | * written once, on engine initialization, and then passed to GuC, that |
53 | 54 | * saves/restores their values before/after the reset takes place. See |
54 | | - * ``drivers/gpu/drm/xe/xe_guc_ads.c`` for reference. |
| 55 | + * drivers/gpu/drm/xe/xe_guc_ads.c for reference. |
55 | 56 | * |
56 | 57 | * - GT workarounds: the list of these WAs is applied whenever these registers |
57 | 58 | * revert to their default values: on GPU reset, suspend/resume [1]_, etc. |
|
66 | 67 | * hardware on every HW context restore. These buffers are created and |
67 | 68 | * programmed in the default context so the hardware always go through those |
68 | 69 | * programming sequences when switching contexts. The support for workaround |
69 | | - * batchbuffers is enabled these hardware mechanisms: |
| 70 | + * batchbuffers is enabled via these hardware mechanisms: |
70 | 71 | * |
71 | | - * #. INDIRECT_CTX: A batchbuffer and an offset are provided in the default |
72 | | - * context, pointing the hardware to jump to that location when that offset |
73 | | - * is reached in the context restore. Workaround batchbuffer in the driver |
74 | | - * currently uses this mechanism for all platforms. |
| 72 | + * #. INDIRECT_CTX (also known as **mid context restore bb**): A batchbuffer |
| 73 | + * and an offset are provided in the default context, pointing the hardware |
| 74 | + * to jump to that location when that offset is reached in the context |
| 75 | + * restore. When a context is being restored, this is executed after the |
| 76 | + * ring context, in the middle (or beginning) of the engine context image. |
75 | 77 | * |
76 | | - * #. BB_PER_CTX_PTR: A batchbuffer is provided in the default context, |
77 | | - * pointing the hardware to a buffer to continue executing after the |
78 | | - * engine registers are restored in a context restore sequence. This is |
79 | | - * currently not used in the driver. |
| 78 | + * #. BB_PER_CTX_PTR (also known as **post context restore bb**): A |
| 79 | + * batchbuffer is provided in the default context, pointing the hardware to |
| 80 | + * a buffer to continue executing after the engine registers are restored |
| 81 | + * in a context restore sequence. |
| 82 | + * |
| 83 | + * Below is the timeline for a context restore sequence: |
| 84 | + * |
| 85 | + * .. code:: |
| 86 | + * |
| 87 | + * INDIRECT_CTX_OFFSET |
| 88 | + * |----------->| |
| 89 | + * .------------.------------.-------------.------------.--------------.-----------. |
| 90 | + * |Ring | Engine | Mid-context | Engine | Post-context | Ring | |
| 91 | + * |Restore | Restore (1)| BB Restore | Restore (2)| BB Restore | Execution | |
| 92 | + * `------------'------------'-------------'------------'--------------'-----------' |
80 | 93 | * |
81 | 94 | * - Other/OOB: There are WAs that, due to their nature, cannot be applied from |
82 | 95 | * a central place. Those are peppered around the rest of the code, as needed. |
83 | | - * Workarounds related to the display IP are the main example. |
| 96 | + * There's a central place to control which workarounds are enabled: |
| 97 | + * drivers/gpu/drm/xe/xe_wa_oob.rules for GT workarounds and |
| 98 | + * drivers/gpu/drm/xe/xe_device_wa_oob.rules for device/SoC workarounds. |
| 99 | + * These files only record which workarounds are enabled: during early device |
| 100 | + * initialization those rules are evaluated and recorded by the driver. Then |
| 101 | + * later the driver checks with ``XE_GT_WA()`` and ``XE_DEVICE_WA()`` to |
| 102 | + * implement them. |
84 | 103 | * |
85 | 104 | * .. [1] Technically, some registers are powercontext saved & restored, so they |
86 | 105 | * survive a suspend/resume. In practice, writing them again is not too |
|
0 commit comments