[PATCH] drm/xe: Remove unused cpu_atomic bo flag

Nirmoy Das nirmoy.das at intel.com
Mon Mar 11 15:22:13 UTC 2024


Actually the whole property struct is not being used. I will resend this 
with other unused members.

On 3/11/2024 3:34 PM, Nirmoy Das wrote:
> cpu_atomic is not set so remove it and also related dead
> code.
>
> Fixes: ddfa2d6a846a ("drm/xe/uapi: Kill VM_MADVISE IOCTL")
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: "Thomas Hellström" <thomas.hellstrom at linux.intel.com>
> Cc: intel-xe at lists.freedesktop.org
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_bo.c       | 22 +++-------------------
>   drivers/gpu/drm/xe/xe_bo_types.h |  5 -----
>   2 files changed, 3 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index b89ac6db68a1..edf78505091e 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -1118,13 +1118,6 @@ static void xe_gem_object_close(struct drm_gem_object *obj,
>   	}
>   }
>   
> -static bool should_migrate_to_system(struct xe_bo *bo)
> -{
> -	struct xe_device *xe = xe_bo_device(bo);
> -
> -	return xe_device_in_fault_mode(xe) && bo->props.cpu_atomic;
> -}
> -
>   static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
>   {
>   	struct ttm_buffer_object *tbo = vmf->vma->vm_private_data;
> @@ -1133,7 +1126,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
>   	struct xe_bo *bo = ttm_to_xe_bo(tbo);
>   	bool needs_rpm = bo->flags & XE_BO_CREATE_VRAM_MASK;
>   	vm_fault_t ret;
> -	int idx, r = 0;
> +	int idx;
>   
>   	if (needs_rpm)
>   		xe_device_mem_access_get(xe);
> @@ -1145,17 +1138,8 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
>   	if (drm_dev_enter(ddev, &idx)) {
>   		trace_xe_bo_cpu_fault(bo);
>   
> -		if (should_migrate_to_system(bo)) {
> -			r = xe_bo_migrate(bo, XE_PL_TT);
> -			if (r == -EBUSY || r == -ERESTARTSYS || r == -EINTR)
> -				ret = VM_FAULT_NOPAGE;
> -			else if (r)
> -				ret = VM_FAULT_SIGBUS;
> -		}
> -		if (!ret)
> -			ret = ttm_bo_vm_fault_reserved(vmf,
> -						       vmf->vma->vm_page_prot,
> -						       TTM_BO_VM_NUM_PREFAULT);
> +		ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
> +					       TTM_BO_VM_NUM_PREFAULT);
>   		drm_dev_exit(idx);
>   	} else {
>   		ret = ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
> diff --git a/drivers/gpu/drm/xe/xe_bo_types.h b/drivers/gpu/drm/xe/xe_bo_types.h
> index 14ef13b7b421..f62a130fc948 100644
> --- a/drivers/gpu/drm/xe/xe_bo_types.h
> +++ b/drivers/gpu/drm/xe/xe_bo_types.h
> @@ -64,11 +64,6 @@ struct xe_bo {
>   		s16 preferred_gt;
>   		/** @preferred_mem_type: preferred memory type */
>   		s32 preferred_mem_type;
> -		/**
> -		 * @cpu_atomic: the CPU expects to do atomics operations to
> -		 * this BO
> -		 */
> -		bool cpu_atomic;
>   		/**
>   		 * @device_atomic: the device expects to do atomics operations
>   		 * to this BO


More information about the Intel-xe mailing list