Skip to content

PAT and cache coherency support

Matthew Auld intel-xe 13 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v12 Latest3 patches 0 repliesNew
  2. v113 patches 0 repliesSuperseded
  3. v10 posting 2/215 patches 0 repliesSuperseded
Earlier versions · 10
VersionPostedPatchesRepliesStatus
v10 posting 1/23 patches0 repliesSuperseded
v915 patches0 repliesSuperseded
v815 patches0 repliesSuperseded
v715 patches0 repliesSuperseded
v615 patches0 repliesSuperseded
v515 patches7 repliesSuperseded
v415 patches12 repliesSuperseded
v312 patches11 repliesSuperseded
v212 patches3 repliesSuperseded
v112 patches9 repliesSuperseded

Changes in v12 from the cover letter

- Small fix to the selftests.

Patches in v12 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/xe/uapi: Add support for CPU caching modedrivers/gpu/drm/xe/tests/xe_bo.c drivers/gpu/drm/xe/tests/xe_dma_buf.c drivers/gpu/drm/xe/xe_bo.c +4 more+123 -400 replies
2/3drm/xe/pat: annotate pat_index with coherency modedrivers/gpu/drm/xe/xe_device_types.h drivers/gpu/drm/xe/xe_pat.c drivers/gpu/drm/xe/xe_pat.h+88 -410 replies
3/3drm/xe/uapi: support pat_index selection with vm_binddrivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_vm.c drivers/gpu/drm/xe/xe_vm_types.h +1 more+109 -180 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJosé Roberto de SouzaZhengguo XuBartosz DunajskiMatt RoperPallavi Mishra
1/3R-b A-b A-b
2/3R-b R-b R-b
3/3T-b R-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v12 thread

Cover letter [Intel-xe] [PATCH v12 0/3] PAT and cache coherency support

Branch available here:
https://gitlab.freedesktop.org/mwa/kernel/-/tree/xe-pat-index?ref_type=heads

IGT changes:
https://patchwork.freedesktop.org/series/124667/

Mesa:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462

Goal here is to allow userspace to directly control the pat_index when mapping memory via the ppGTT, in addtion to the CPU caching mode. This is very much needed on newer igpu platforms which allow incoherent GT access, where the choice over the cache level and expected coherency is best left to userspace depending on their usecase. In the future there may also be other stuff encoded in the pat_index, so giving userspace direct control will also be needed there.

To support this we added new gem_create uAPI for selecting the CPU cache mode to use for system memory, including the expected GPU coherency mode. There are various restrictions here for the selected coherency mode and compatible CPU cache modes. With that in place the actual pat_index can now be provided as part of vm_bind. The only restriction is that the coherency mode of the pat_index must be at least as coherent as the gem_create coherency mode. There are also some special cases like with userptr and dma-buf.

v2:
- Loads of improvements/tweaks. Main changes are to now allow gem_create.coh_mode <= coh_mode(pat_index), rather than it needing to match exactly. This simplifies the dma-buf policy from userspace pov. Also we now only consider COH_NONE and COH_AT_LEAST_1WAY.
v3:
- Rebase. Split the pte_encode() refactoring, plus various smaller tweaks and fixes.
v4:
- Rebase on Lucas' new series.
- Drop UC cache mode.
- s/smem_cpu_caching/cpu_caching/. Idea is to make VRAM WC explicit in the uapi, plus make it more future proof.
v5:
- Rebase, plus some small tweaks and fixes.
v6:
- CI hooks fixes + checkpatch.
v7:
- Some small tweaks
v8:
- Rebase on Xe2 PAT table additions.
v9:
- Drop coh_mode.
v10:
- Rebase. Also add some UMD acks.
v11:
- Rebase on some more changes to vm_bind.
v12:
- Small fix to the selftests.

Signature · 1 line
2.42.0