Emit SVG 3DSTATE during LRC init
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 1 replyIn review
- v13 patches 4 repliesSuperseded
Changes in v2 from the cover letter
- Minor checkpatch whitespace fix
- Add an extra assertion to ensure the num_dw is properly set in the state table. (Bala)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | drm/xe: Prepare to emit non-register state while recording default LRCdrivers/ drivers/ drivers/ | +57 | 0 replies | |
| 2/3 | drm/xe: Emit SVG state on RCS during driver load on DG2 and MTLdrivers/ drivers/ drivers/ | +162 | 0 replies | |
| 3/3 | drm/xe/xe2: Update SVG state handlingdrivers/ drivers/ | +14 | 0 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Balasubramani Vivekanandan |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Intel-xe] [PATCH v2 0/3] Emit SVG 3DSTATE during LRC init
DG2, MTL, and Xe2 do not write the 3DSTATE instruction headers to the SVG ("State Variable - Global") section of the LRC image during the first context switch if no explicit state has been programmed yet. When we record the default context, that portion of the LRC is effectively filled with noops. If a userspace driver later forgets to initialize some part of the SVG state, the result is that that state will not be saved/restored on context switch and the settings from one GPU client (which does initialize the state) can leak into another client (which does not initialize the state) on context switch. While failure to ever initialize a proper setting for part of the state is a mistake on the UMD side, any bugs arising from such mistakes are often erractic in nature and hard to track down because the behavior will vary according to what other clients are running on the system and the specific order they get scheduled to the hardware engine.
If we explicitly emit a copy of each SVG state instruction while recording the default LRC (i.e., at the same time we emit our register-based LRC workarounds), it will ensure that the context image always has a real SVG state in the LRC image, and save/restore on context switch will work as expected. Now if userspace fails to emit the proper state they want, they'll get reproducible behavior corresponding to known (zeroed out) state, making it much easier to debug and track down the problem.
More detailed explanation provided on patch #2 of the series.
We've been told that some future platforms will also require us to emit some other specific non-register state during driver init, so even though this SVG initialization/sanitization in this series is just a "nice to have" change for the time being, the infrastructure added will become necessary for other purposes on future platforms.
v2:
- Minor checkpatch whitespace fix
- Add an extra assertion to ensure the num_dw is properly set in the state table. (Bala)
Matt Roper (3):
drm/xe: Prepare to emit non-register state while recording default LRC drm/xe: Emit SVG state on RCS during driver load on DG2 and MTL drm/xe/xe2: Update SVG state handling
.../drm/xe/instructions/xe_gfxpipe_commands.h | 52 ++++++ drivers/gpu/drm/xe/xe_gt.c | 11 +- drivers/gpu/drm/xe/xe_lrc.c | 165 ++++++++++++++++++ drivers/gpu/drm/xe/xe_lrc.h | 3 + 4 files changed, 230 insertions(+), 1 deletion(-)
Signature · 1 line
2.41.0