diff options
author | Matthew Brost <matthew.brost@intel.com> | 2024-05-14 16:23:25 -0700 |
---|---|---|
committer | Matthew Brost <matthew.brost@intel.com> | 2024-05-15 08:07:57 -0700 |
commit | c8ff26b82c5b0f589516edcf7628704e3a6bc426 (patch) | |
tree | 74b6f9d9c8d5f762fcbda6127aad3a629b963233 | |
parent | b31cfb47b27ae02ea7fb3f956b99c79356730e2a (diff) | |
download | linux-c8ff26b82c5b0f589516edcf7628704e3a6bc426.tar.gz linux-c8ff26b82c5b0f589516edcf7628704e3a6bc426.tar.bz2 linux-c8ff26b82c5b0f589516edcf7628704e3a6bc426.zip |
drm/xe: Only zap PTEs as needed
If PTEs are already invalidated no need to invalidate again.
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240514232325.84508-1-matthew.brost@intel.com
-rw-r--r-- | drivers/gpu/drm/xe/xe_pt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 87975e45622a..11dd0988ffda 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -812,8 +812,9 @@ bool xe_pt_zap_ptes(struct xe_tile *tile, struct xe_vma *vma) .tile = tile, }; struct xe_pt *pt = xe_vma_vm(vma)->pt_root[tile->id]; + u8 pt_mask = (vma->tile_present & ~vma->tile_invalidated); - if (!(vma->tile_present & BIT(tile->id))) + if (!(pt_mask & BIT(tile->id))) return false; (void)xe_pt_walk_shared(&pt->base, pt->level, xe_vma_start(vma), |