diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-07-26 19:07:02 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 19:39:04 +0300 |
commit | 621c1fbd9b83fb6a731e0063ad4ea2d89ec20a9c (patch) | |
tree | 9fc776ce27ac38e87261ac523eb48e48c7e35da4 /drivers/gpu/drm/xe/xe_pt.c | |
parent | 43b5d81e04773d08df1ed3ff8a40936dca726fda (diff) | |
download | linux-621c1fbd9b83fb6a731e0063ad4ea2d89ec20a9c.tar.xz |
drm/xe: Remove vma arg from xe_pte_encode()
All the callers pass a NULL vma, so the buffer is always the BO. Remove
the argument and the side effects of dealing with it.
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20230726160708.3967790-5-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pt.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_pt.c | 47 |
1 files changed, 7 insertions, 40 deletions
diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 612de787c19e..ef7c258bdd90 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -78,30 +78,6 @@ u64 xe_pde_encode(struct xe_bo *bo, u64 bo_offset, return pde; } -static dma_addr_t vma_addr(struct xe_vma *vma, u64 offset, - size_t page_size, bool *is_vram) -{ - if (xe_vma_is_null(vma)) { - *is_vram = 0; - return 0; - } - - if (xe_vma_is_userptr(vma)) { - struct xe_res_cursor cur; - u64 page; - - *is_vram = false; - page = offset >> PAGE_SHIFT; - offset &= (PAGE_SIZE - 1); - - xe_res_first_sg(vma->userptr.sg, page << PAGE_SHIFT, page_size, - &cur); - return xe_res_dma(&cur) + offset; - } else { - return xe_bo_addr(xe_vma_bo(vma), offset, page_size, is_vram); - } -} - static u64 __pte_encode(u64 pte, enum xe_cache_level cache, struct xe_vma *vma, u32 pt_level) { @@ -140,34 +116,25 @@ static u64 __pte_encode(u64 pte, enum xe_cache_level cache, /** * xe_pte_encode() - Encode a page-table entry pointing to memory. - * @vma: The vma representing the memory to point to. - * @bo: If @vma is NULL, representing the memory to point to. - * @offset: The offset into @vma or @bo. + * @bo: The BO representing the memory to point to. + * @offset: The offset into @bo. * @cache: The cache level indicating * @pt_level: The page-table level of the page-table into which the entry * is to be inserted. * * Return: An encoded page-table entry. No errors. */ -u64 xe_pte_encode(struct xe_vma *vma, struct xe_bo *bo, - u64 offset, enum xe_cache_level cache, +u64 xe_pte_encode(struct xe_bo *bo, u64 offset, enum xe_cache_level cache, u32 pt_level) { u64 pte; bool is_vram; - if (vma) - pte = vma_addr(vma, offset, XE_PAGE_SIZE, &is_vram); - else - pte = xe_bo_addr(bo, offset, XE_PAGE_SIZE, &is_vram); - - if (is_vram) { + pte = xe_bo_addr(bo, offset, XE_PAGE_SIZE, &is_vram); + if (is_vram) pte |= XE_PPGTT_PTE_LM; - if (vma && vma->gpuva.flags & XE_VMA_ATOMIC_PTE_BIT) - pte |= XE_USM_PPGTT_PTE_AE; - } - return __pte_encode(pte, cache, vma, pt_level); + return __pte_encode(pte, cache, NULL, pt_level); } static u64 __xe_pt_empty_pte(struct xe_tile *tile, struct xe_vm *vm, @@ -179,7 +146,7 @@ static u64 __xe_pt_empty_pte(struct xe_tile *tile, struct xe_vm *vm, return 0; if (level == 0) { - u64 empty = xe_pte_encode(NULL, vm->scratch_bo[id], 0, + u64 empty = xe_pte_encode(vm->scratch_bo[id], 0, XE_CACHE_WB, 0); return empty; |