[PATCH] drm/xe: Only zap PTEs as needed

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Wed May 15 06:53:15 UTC 2024


On 15-05-2024 04:53, Matthew Brost wrote:
> If PTEs are already invalidated no need to invalidate again.
>
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_pt.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 7f792b7feb06..d8817673c097 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -815,8 +815,9 @@ bool xe_pt_zap_ptes(struct xe_tile *tile, struct xe_vma *vma)
>   		.tile = tile,
>   	};
>   	struct xe_pt *pt = xe_vma_vm(vma)->pt_root[tile->id];
> +	u8 pt_mask = (vma->tile_present & ~vma->tile_invalidated);
>   
> -	if (!(vma->tile_present & BIT(tile->id)))
> +	if (!(pt_mask & BIT(tile->id)))
>   		return false;

LGTM

Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>


>   
>   	(void)xe_pt_walk_shared(&pt->base, pt->level, xe_vma_start(vma),


More information about the Intel-xe mailing list