[Intel-xe] [PATCH] fixup! drm/xe: Convert pagefaulting code to use drm_exec

Matthew Brost matthew.brost at intel.com
Thu Oct 19 19:21:48 UTC 2023


On Thu, Oct 19, 2023 at 10:33:43AM -0700, Brian Welty wrote:
> Remove unneeded num_shared argument to xe_pf_begin().
> Per discussion w/ Matthew Brost, we request to preallocate 2 fence slots
> from xe_vm_prepare_vma() for binding and potential move.
> This should be hardcoded to 2, and not use tile_count which just happens
> to be correct on PVC platform.
> 
> Signed-off-by: Brian Welty <brian.welty at intel.com>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt_pagefault.c | 7 ++++---
>  1 file 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 c0027982ab4c..2ec0db7a4b29 100644
> --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
> +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
> @@ -100,10 +100,11 @@ static struct xe_vma *lookup_vma(struct xe_vm *vm, u64 page_addr)
>  }
>  
>  static int xe_pf_begin(struct drm_exec *exec, struct xe_vma *vma,
> -		       unsigned int num_shared, bool atomic, unsigned int id)
> +		       bool atomic, unsigned int id)
>  {
>  	struct xe_bo *bo = xe_vma_bo(vma);
>  	struct xe_vm *vm = xe_vma_vm(vma);
> +	unsigned int num_shared = 2; /* slots for bind + move */
>  	int err;
>  
>  	err = xe_vm_prepare_vma(exec, vma, num_shared);
> @@ -195,7 +196,7 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
>  	/* Lock VM and BOs dma-resv */
>  	drm_exec_init(&exec, 0);
>  	drm_exec_until_all_locked(&exec) {
> -		ret = xe_pf_begin(&exec, vma, xe->info.tile_count, atomic, tile->id);
> +		ret = xe_pf_begin(&exec, vma, atomic, tile->id);
>  		drm_exec_retry_on_contention(&exec);
>  		if (ret)
>  			goto unlock_dma_resv;
> @@ -525,7 +526,7 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc)
>  	/* Lock VM and BOs dma-resv */
>  	drm_exec_init(&exec, 0);
>  	drm_exec_until_all_locked(&exec) {
> -		ret = xe_pf_begin(&exec, vma, xe->info.tile_count, true, tile->id);
> +		ret = xe_pf_begin(&exec, vma, true, tile->id);
>  		drm_exec_retry_on_contention(&exec);
>  		if (ret)
>  			break;
> -- 
> 2.38.0
> 


More information about the Intel-xe mailing list