All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/xe: Remove unused xe_bo->props struct
Date: Mon, 11 Mar 2024 12:33:29 -0400	[thread overview]
Message-ID: <Ze8yWTmHYScFSpax@intel.com> (raw)
In-Reply-To: <20240311151159.10036-1-nirmoy.das@intel.com>

On Mon, Mar 11, 2024 at 04:11:59PM +0100, Nirmoy Das wrote:
> Property struct is not being used so remove it and related dead code.
> 
> Fixes: ddfa2d6a846a ("drm/xe/uapi: Kill VM_MADVISE IOCTL")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
> Cc: intel-xe@lists.freedesktop.org
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_bo.c       | 59 +++++---------------------------
>  drivers/gpu/drm/xe/xe_bo_types.h | 19 ----------
>  2 files changed, 9 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index b89ac6db68a1..d7e0deb1b869 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -144,9 +144,6 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo,
>  			.mem_type = XE_PL_TT,
>  		};
>  		*c += 1;
> -
> -		if (bo->props.preferred_mem_type == XE_BO_PROPS_INVALID)
> -			bo->props.preferred_mem_type = XE_PL_TT;
>  	}
>  }
>  
> @@ -181,25 +178,15 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
>  	}
>  	places[*c] = place;
>  	*c += 1;
> -
> -	if (bo->props.preferred_mem_type == XE_BO_PROPS_INVALID)
> -		bo->props.preferred_mem_type = mem_type;
>  }
>  
>  static void try_add_vram(struct xe_device *xe, struct xe_bo *bo,
>  			 u32 bo_flags, u32 *c)
>  {
> -	if (bo->props.preferred_gt == XE_GT1) {
> -		if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
> -			add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
> -		if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
> -			add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
> -	} else {
> -		if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
> -			add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
> -		if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
> -			add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
> -	}
> +	if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
> +		add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
> +	if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
> +		add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
>  }
>  
>  static void try_add_stolen(struct xe_device *xe, struct xe_bo *bo,
> @@ -223,17 +210,8 @@ static int __xe_bo_placement_for_flags(struct xe_device *xe, struct xe_bo *bo,
>  {
>  	u32 c = 0;
>  
> -	bo->props.preferred_mem_type = XE_BO_PROPS_INVALID;
> -
> -	/* The order of placements should indicate preferred location */
> -
> -	if (bo->props.preferred_mem_class == DRM_XE_MEM_REGION_CLASS_SYSMEM) {
> -		try_add_system(xe, bo, bo_flags, &c);
> -		try_add_vram(xe, bo, bo_flags, &c);
> -	} else {
> -		try_add_vram(xe, bo, bo_flags, &c);
> -		try_add_system(xe, bo, bo_flags, &c);
> -	}
> +	try_add_vram(xe, bo, bo_flags, &c);
> +	try_add_system(xe, bo, bo_flags, &c);
>  	try_add_stolen(xe, bo, bo_flags, &c);
>  
>  	if (!c)
> @@ -1118,13 +1096,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 +1104,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 +1116,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);
> @@ -1283,9 +1245,6 @@ struct xe_bo *___xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
>  	bo->flags = flags;
>  	bo->cpu_caching = cpu_caching;
>  	bo->ttm.base.funcs = &xe_gem_object_funcs;
> -	bo->props.preferred_mem_class = XE_BO_PROPS_INVALID;
> -	bo->props.preferred_gt = XE_BO_PROPS_INVALID;
> -	bo->props.preferred_mem_type = XE_BO_PROPS_INVALID;
>  	bo->ttm.priority = XE_BO_PRIORITY_NORMAL;
>  	INIT_LIST_HEAD(&bo->pinned_link);
>  #ifdef CONFIG_PROC_FS
> diff --git a/drivers/gpu/drm/xe/xe_bo_types.h b/drivers/gpu/drm/xe/xe_bo_types.h
> index 14ef13b7b421..86422e113d39 100644
> --- a/drivers/gpu/drm/xe/xe_bo_types.h
> +++ b/drivers/gpu/drm/xe/xe_bo_types.h
> @@ -56,25 +56,6 @@ struct xe_bo {
>  	 */
>  	struct list_head client_link;
>  #endif
> -	/** @props: BO user controlled properties */
> -	struct {
> -		/** @preferred_mem: preferred memory class for this BO */
> -		s16 preferred_mem_class;
> -		/** @prefered_gt: preferred GT for this 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
> -		 */
> -		bool device_atomic;
> -	} props;
>  	/** @freed: List node for delayed put. */
>  	struct llist_node freed;
>  	/** @created: Whether the bo has passed initial creation */
> -- 
> 2.42.0
> 

  parent reply	other threads:[~2024-03-11 16:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 15:11 [PATCH] drm/xe: Remove unused xe_bo->props struct Nirmoy Das
2024-03-11 15:52 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-11 15:53 ` ✓ CI.checkpatch: " Patchwork
2024-03-11 15:54 ` ✓ CI.KUnit: " Patchwork
2024-03-11 16:06 ` ✓ CI.Build: " Patchwork
2024-03-11 16:06 ` ✓ CI.Hooks: " Patchwork
2024-03-11 16:07 ` ✓ CI.checksparse: " Patchwork
2024-03-11 16:33 ` ✓ CI.BAT: " Patchwork
2024-03-11 16:33 ` Rodrigo Vivi [this message]
2024-03-11 16:43   ` [PATCH] " Lucas De Marchi
2024-03-11 16:49     ` Rodrigo Vivi
2024-03-14  4:24       ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ze8yWTmHYScFSpax@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=nirmoy.das@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.