Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 3/5] drm/xe: Change tile masks from u64 to u8
Date: Fri, 14 Jul 2023 03:46:56 +0000	[thread overview]
Message-ID: <ZLDFMC0cTNGmQMSC@DUT025-TGLU> (raw)
In-Reply-To: <ZLBc22IiE8KZeysE@intel.com>

On Thu, Jul 13, 2023 at 04:21:47PM -0400, Rodrigo Vivi wrote:
> On Tue, Jul 11, 2023 at 02:27:46PM -0700, Matthew Brost wrote:
> > This will save us a few bytes in the xe_vma structure.
> > 
> > Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_vm.c       |  8 ++++----
> >  drivers/gpu/drm/xe/xe_vm_types.h | 28 ++++++++++++++--------------
> >  2 files changed, 18 insertions(+), 18 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> > index b2847be6de6a..762aefa75ed4 100644
> > --- a/drivers/gpu/drm/xe/xe_vm.c
> > +++ b/drivers/gpu/drm/xe/xe_vm.c
> > @@ -871,7 +871,7 @@ static struct xe_vma *xe_vma_create(struct xe_vm *vm,
> >  				    u64 start, u64 end,
> >  				    bool read_only,
> >  				    bool is_null,
> > -				    u64 tile_mask)
> > +				    u8 tile_mask)
> >  {
> >  	struct xe_vma *vma;
> >  	struct xe_tile *tile;
> > @@ -2246,7 +2246,7 @@ static void print_op(struct xe_device *xe, struct drm_gpuva_op *op)
> >  static struct drm_gpuva_ops *
> >  vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
> >  			 u64 bo_offset_or_userptr, u64 addr, u64 range,
> > -			 u32 operation, u64 tile_mask, u32 region)
> > +			 u32 operation, u8 tile_mask, u32 region)
> >  {
> >  	struct drm_gem_object *obj = bo ? &bo->ttm.base : NULL;
> >  	struct ww_acquire_ctx ww;
> > @@ -2343,7 +2343,7 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
> >  }
> >  
> >  static struct xe_vma *new_vma(struct xe_vm *vm, struct drm_gpuva_op_map *op,
> > -			      u64 tile_mask, bool read_only, bool is_null)
> > +			      u8 tile_mask, bool read_only, bool is_null)
> >  {
> >  	struct xe_bo *bo = op->gem.obj ? gem_to_xe_bo(op->gem.obj) : NULL;
> >  	struct xe_vma *vma;
> > @@ -3323,7 +3323,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
> >  		u64 addr = bind_ops[i].addr;
> >  		u32 op = bind_ops[i].op;
> >  		u64 obj_offset = bind_ops[i].obj_offset;
> > -		u64 tile_mask = bind_ops[i].tile_mask;
> > +		u8 tile_mask = bind_ops[i].tile_mask;
> >  		u32 region = bind_ops[i].region;
> >  
> >  		ops[i] = vm_bind_ioctl_ops_create(vm, bos[i], obj_offset,
> > diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
> > index 84bf1620214c..2a8691a48c55 100644
> > --- a/drivers/gpu/drm/xe/xe_vm_types.h
> > +++ b/drivers/gpu/drm/xe/xe_vm_types.h
> > @@ -37,18 +37,6 @@ struct xe_vma {
> >  	/** @gpuva: Base GPUVA object */
> >  	struct drm_gpuva gpuva;
> >  
> > -	/** @tile_mask: Tile mask of where to create binding for this VMA */
> > -	u64 tile_mask;
> > -
> > -	/**
> > -	 * @tile_present: GT mask of binding are present for this VMA.
> > -	 * protected by vm->lock, vm->resv and for userptrs,
> > -	 * vm->userptr.notifier_lock for writing. Needs either for reading,
> > -	 * but if reading is done under the vm->lock only, it needs to be held
> > -	 * in write mode.
> > -	 */
> > -	u64 tile_present;
> > -
> >  	/** @combined_links: links into lists which are mutually exclusive */
> >  	union {
> >  		/** @userptr: link into VM repin list if userptr */
> > @@ -97,9 +85,21 @@ struct xe_vma {
> >  	/** @usm: unified shared memory state */
> >  	struct {
> >  		/** @tile_invalidated: VMA has been invalidated */
> > -		u64 tile_invalidated;
> > +		u8 tile_invalidated;
> >  	} usm;
> >  
> > +	/** @tile_mask: Tile mask of where to create binding for this VMA */
> > +	u8 tile_mask;
> > +
> > +	/**
> > +	 * @tile_present: GT mask of binding are present for this VMA.
> > +	 * protected by vm->lock, vm->resv and for userptrs,
> > +	 * vm->userptr.notifier_lock for writing. Needs either for reading,
> > +	 * but if reading is done under the vm->lock only, it needs to be held
> > +	 * in write mode.
> > +	 */
> > +	u8 tile_present;
> > +
> >  	struct {
> >  		struct list_head rebind_link;
> >  	} notifier;
> > @@ -386,7 +386,7 @@ struct xe_vma_op {
> >  	 */
> >  	struct async_op_fence *fence;
> >  	/** @tile_mask: gt mask for this operation */
> > -	u64 tile_mask;
> > +	u8 tile_mask;
> 
> I'm seeing us to use hweight_long on this tile_mask...
> 

Will change to hweight8.

Matt

> >  	/** @flags: operation flags */
> >  	enum xe_vma_op_flags flags;
> >  
> > -- 
> > 2.34.1
> > 

  reply	other threads:[~2023-07-14  3:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 21:27 [Intel-xe] [PATCH 0/5] More VM cleanups Matthew Brost
2023-07-11 21:27 ` [Intel-xe] [PATCH 1/5] drm/xe: Avoid doing rebinds Matthew Brost
2023-07-13 20:10   ` Rodrigo Vivi
2023-07-13 20:11   ` Rodrigo Vivi
2023-07-11 21:27 ` [Intel-xe] [PATCH 2/5] drm/xe: Reduce the number list links in xe_vma Matthew Brost
2023-07-13 20:18   ` Rodrigo Vivi
2023-07-14  3:56     ` Matthew Brost
2023-07-14 13:42       ` Rodrigo Vivi
2023-07-15 13:11   ` Thomas Hellström
2023-07-19 22:19     ` Matthew Brost
2023-07-11 21:27 ` [Intel-xe] [PATCH 3/5] drm/xe: Change tile masks from u64 to u8 Matthew Brost
2023-07-13 20:21   ` Rodrigo Vivi
2023-07-14  3:46     ` Matthew Brost [this message]
2023-07-11 21:27 ` [Intel-xe] [PATCH 4/5] drm/xe: Combine destroy_cb and destroy_work in xe_vma into union Matthew Brost
2023-07-13 20:23   ` Rodrigo Vivi
2023-07-14  3:53     ` Matthew Brost
2023-07-14 14:28       ` Rodrigo Vivi
2023-07-11 21:27 ` [Intel-xe] [PATCH 5/5] drm/xe: Only alloc userptr part of xe_vma for userptrs Matthew Brost
2023-07-13 20:26   ` Rodrigo Vivi
2023-07-11 21:29 ` [Intel-xe] ✓ CI.Patch_applied: success for More VM cleanups Patchwork
2023-07-11 21:29 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-07-11 21:30 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-07-11 21:34 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-11 21:35 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-11 21:36 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-11 22:10 ` [Intel-xe] ○ CI.BAT: info " Patchwork

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=ZLDFMC0cTNGmQMSC@DUT025-TGLU \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox