diff options
author | Matthew Brost <matthew.brost@intel.com> | 2023-06-22 13:03:04 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:35:18 -0500 |
commit | 21ed3327e388c24ddbdc3b2e8533f0c3ab99953b (patch) | |
tree | 52ebc3f8f234c514a3a9e616f025f9cb5d9d3558 /drivers/gpu/drm/xe/xe_gt_pagefault.c | |
parent | 9d858b69b0cfb56dd67943138c10d84eeb73380f (diff) |
drm/xe: Add helpers to hide struct xe_vma internals
This will help with the GPUVA port as the internals of struct xe_vma
will change.
v2: Update comment around helpers
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_gt_pagefault.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_gt_pagefault.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c index 9dd8e5097e65..4d0f402cc630 100644 --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c @@ -77,7 +77,8 @@ static bool vma_is_valid(struct xe_tile *tile, struct xe_vma *vma) static bool vma_matches(struct xe_vma *vma, struct xe_vma *lookup) { - if (lookup->start > vma->end || lookup->end < vma->start) + if (xe_vma_start(lookup) > xe_vma_end(vma) - 1 || + xe_vma_end(lookup) - 1 < xe_vma_start(vma)) return false; return true; @@ -171,7 +172,7 @@ retry_userptr: } /* Lock VM and BOs dma-resv */ - bo = vma->bo; + bo = xe_vma_bo(vma); if (only_needs_bo_lock(bo)) { /* This path ensures the BO's LRU is updated */ ret = xe_bo_lock(bo, &ww, xe->info.tile_count, false); @@ -538,7 +539,7 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc) goto unlock_vm; /* Lock VM and BOs dma-resv */ - bo = vma->bo; + bo = xe_vma_bo(vma); if (only_needs_bo_lock(bo)) { /* This path ensures the BO's LRU is updated */ ret = xe_bo_lock(bo, &ww, xe->info.tile_count, false); |