[PATCH] drm/xe: Remove unused variable

Lucas De Marchi lucas.demarchi at intel.com
Fri Jul 26 08:24:42 UTC 2024


On Thu, Jul 25, 2024 at 02:48:04PM GMT, Azhar Shaikh wrote:
>pde_encode_pat_index() and pte_encode_pat_index() no
>longer use the 'xe' parameter. Remove this parameter
>from these functions and also clean up all other places in
>the file where these functions are called.
>
>Signed-off-by: Azhar Shaikh <azhar.shaikh at intel.com>

for reference, AFAICS this is a cleanup after commit
e814389ff180 ("drm/xe: directly use pat_index for pte_encode").

Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>

thanks
Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_vm.c | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
>index 12d43c35978c..1b66d27ad7c3 100644
>--- a/drivers/gpu/drm/xe/xe_vm.c
>+++ b/drivers/gpu/drm/xe/xe_vm.c
>@@ -1191,7 +1191,7 @@ static const struct drm_gpuvm_ops gpuvm_ops = {
> 	.vm_free = xe_vm_free,
> };
>
>-static u64 pde_encode_pat_index(struct xe_device *xe, u16 pat_index)
>+static u64 pde_encode_pat_index(u16 pat_index)
> {
> 	u64 pte = 0;
>
>@@ -1204,8 +1204,7 @@ static u64 pde_encode_pat_index(struct xe_device *xe, u16 pat_index)
> 	return pte;
> }
>
>-static u64 pte_encode_pat_index(struct xe_device *xe, u16 pat_index,
>-				u32 pt_level)
>+static u64 pte_encode_pat_index(u16 pat_index, u32 pt_level)
> {
> 	u64 pte = 0;
>
>@@ -1246,12 +1245,11 @@ static u64 pte_encode_ps(u32 pt_level)
> static u64 xelp_pde_encode_bo(struct xe_bo *bo, u64 bo_offset,
> 			      const u16 pat_index)
> {
>-	struct xe_device *xe = xe_bo_device(bo);
> 	u64 pde;
>
> 	pde = xe_bo_addr(bo, bo_offset, XE_PAGE_SIZE);
> 	pde |= XE_PAGE_PRESENT | XE_PAGE_RW;
>-	pde |= pde_encode_pat_index(xe, pat_index);
>+	pde |= pde_encode_pat_index(pat_index);
>
> 	return pde;
> }
>@@ -1259,12 +1257,11 @@ static u64 xelp_pde_encode_bo(struct xe_bo *bo, u64 bo_offset,
> static u64 xelp_pte_encode_bo(struct xe_bo *bo, u64 bo_offset,
> 			      u16 pat_index, u32 pt_level)
> {
>-	struct xe_device *xe = xe_bo_device(bo);
> 	u64 pte;
>
> 	pte = xe_bo_addr(bo, bo_offset, XE_PAGE_SIZE);
> 	pte |= XE_PAGE_PRESENT | XE_PAGE_RW;
>-	pte |= pte_encode_pat_index(xe, pat_index, pt_level);
>+	pte |= pte_encode_pat_index(pat_index, pt_level);
> 	pte |= pte_encode_ps(pt_level);
>
> 	if (xe_bo_is_vram(bo) || xe_bo_is_stolen_devmem(bo))
>@@ -1276,14 +1273,12 @@ static u64 xelp_pte_encode_bo(struct xe_bo *bo, u64 bo_offset,
> static u64 xelp_pte_encode_vma(u64 pte, struct xe_vma *vma,
> 			       u16 pat_index, u32 pt_level)
> {
>-	struct xe_device *xe = xe_vma_vm(vma)->xe;
>-
> 	pte |= XE_PAGE_PRESENT;
>
> 	if (likely(!xe_vma_read_only(vma)))
> 		pte |= XE_PAGE_RW;
>
>-	pte |= pte_encode_pat_index(xe, pat_index, pt_level);
>+	pte |= pte_encode_pat_index(pat_index, pt_level);
> 	pte |= pte_encode_ps(pt_level);
>
> 	if (unlikely(xe_vma_is_null(vma)))
>@@ -1303,7 +1298,7 @@ static u64 xelp_pte_encode_addr(struct xe_device *xe, u64 addr,
>
> 	pte = addr;
> 	pte |= XE_PAGE_PRESENT | XE_PAGE_RW;
>-	pte |= pte_encode_pat_index(xe, pat_index, pt_level);
>+	pte |= pte_encode_pat_index(pat_index, pt_level);
> 	pte |= pte_encode_ps(pt_level);
>
> 	if (devmem)
>-- 
>2.34.1
>


More information about the Intel-xe mailing list