From 21ed3327e388c24ddbdc3b2e8533f0c3ab99953b Mon Sep 17 00:00:00 2001 From: Matthew Brost Date: Thu, 22 Jun 2023 13:03:04 -0700 Subject: drm/xe: Add helpers to hide struct xe_vma internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Matthew Brost Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_gt_pagefault.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/xe/xe_gt_pagefault.c') 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); -- cgit