All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: intel-xe@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-xe] [PATCH v3 33/43] drm/xe/uapi: Convert tile_mask to a pt_placement_hint
Date: Thu, 9 Nov 2023 09:29:49 +0000	[thread overview]
Message-ID: <ZUymje2SlXQuDzH3@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231109154457.7-34-francois.dugast@intel.com>

On Thu, Nov 09, 2023 at 03:44:47PM +0000, Francois Dugast wrote:
> From: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> The previous tile_mask was also an optional hint, and only used
> for the page-table tree placement. However, it was so tied
> with the tile concept itself. Let's clarify things up and make
> this generic enough. So accept any valid memory region mask.
> It could even be a direct near_mem_region gotten from the engine_info.
> pt stands for page table.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>

I thought we landed on converting tile_mask to sched_group_mask? I do
not like pt_placement_hint at all as I've statede what we actually care
about is creating mappings for exec queues. The sched_group_mask is
still a hint basically saying at minimum you must create a mapping for
these sched groups perhaps more. The driver is free to place a PPGTT (or
multiple) anywhere it wants to based on the platform.

e.g. On PVC we have two scheduling groups, and two PPGTT (one per tile in VRAM)
e.g. On MTL we have two scheduling groups, and one PPGTT (sysmem)
e.g. On a unified memory hypothetical future platform we have two scheduling groups, and one PPGGT (shared across tiles in unified VRAM)

Matt

> ---
>  drivers/gpu/drm/xe/xe_vm.c | 14 ++++++++++----
>  include/uapi/drm/xe_drm.h  | 16 +++++++++++++---
>  2 files changed, 23 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index f8559ebad9bc..ad3b5ea6f91a 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -3018,11 +3018,16 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>  			goto release_vm_lock;
>  		}
>  
> -		if (bind_ops[i].tile_mask) {
> +		if (bind_ops[i].pt_placement_hint) {
>  			u64 valid_tiles = BIT(xe->info.tile_count) - 1;
> +			/*
> +			 * System memory is currently ignored from this hint,
> +			 * which gets entirely converted to a tile_mask
> +			 */
> +			u8 system_memory = 0x1;
>  
> -			if (XE_IOCTL_DBG(xe, bind_ops[i].tile_mask &
> -					 ~valid_tiles)) {
> +			if (XE_IOCTL_DBG(xe, bind_ops[i].pt_placement_hint &
> +					 ~valid_tiles & ~system_memory)) {
>  				err = -EINVAL;
>  				goto release_vm_lock;
>  			}
> @@ -3099,7 +3104,8 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>  		u32 op = bind_ops[i].op;
>  		u32 flags = bind_ops[i].flags;
>  		u64 obj_offset = bind_ops[i].obj_offset;
> -		u8 tile_mask = bind_ops[i].tile_mask;
> +		/* Remove the system memory bit when converting to tiles */
> +		u8 tile_mask = bind_ops[i].pt_placement_hint & ~0x1;
>  		u32 prefetch_region = bind_ops[i].prefetch_mem_region_instance;
>  
>  		ops[i] = vm_bind_ioctl_ops_create(vm, bos[i], obj_offset,
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 3cbfc17d9ffa..144a423868cf 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -853,10 +853,20 @@ struct drm_xe_vm_bind_op {
>  	__u64 addr;
>  
>  	/**
> -	 * @tile_mask: Mask for which tiles to create binds for, 0 == All tiles,
> -	 * only applies to creating new VMAs
> +	 * @pt_placement_hint: An optional memory_region bit-mask hint, which
> +	 * only applies when creating new VMAs. Default value '0' is the
> +	 * recommended value.
> +	 *
> +	 * It hints the optimal placement for the page-table tree for this VMA.
> +	 * For instance, when userspace is using engines living in a secondary
> +	 * tile with allocated BOs near those engines, that same
> +	 * @near_mem_region could be used in this hint field.
> +	 *
> +	 * Since it is a hint, the Xe kernel driver is free to ignore this mask
> +	 * and choose the best location for the page-table, taking into
> +	 * consideration the running hardware and runtime constrains.
>  	 */
> -	__u64 tile_mask;
> +	__u64 pt_placement_hint;
>  
>  #define DRM_XE_VM_BIND_OP_MAP		0x0
>  #define DRM_XE_VM_BIND_OP_UNMAP		0x1
> -- 
> 2.34.1
> 

  reply	other threads:[~2023-11-09 16:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 15:44 [Intel-xe] [PATCH v3 00/43] uAPI Alignment - take 2 Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 01/43] drm/xe/uapi: Add documentation for query Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 02/43] drm/xe: Extend drm_xe_vm_bind_op Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 03/43] drm/xe: Add uAPI to query micro-controler firmware version Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 04/43] drm/xe/uapi: Document DRM_XE_DEVICE_QUERY_HWCONFIG Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 05/43] drm/xe: Extend uAPI to query HuC micro-controler firmware version Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 06/43] drm/xe/uapi: Remove useless XE_QUERY_CONFIG_NUM_PARAM Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 07/43] drm/xe/uapi: Add missing DRM_ prefix in uAPI constants Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 08/43] drm/xe/uapi: Add _FLAG to uAPI constants usable for flags Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 09/43] drm/xe/uapi: Make constant comments visible in kernel doc Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 10/43] drm/xe/uapi: Change rsvd to pad in struct drm_xe_class_instance Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 11/43] drm/xe/uapi: Remove GT_TYPE_REMOTE Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 12/43] drm/xe/uapi: Kill VM_MADVISE IOCTL Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 13/43] drm/xe/uapi: Separate bo_create placement from flags Francois Dugast
2023-11-09 14:58   ` Matthew Brost
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 14/43] drm/xe/uapi: Remove unused inaccessible memory region Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 15/43] drm/xe/uapi: Remove unused QUERY_CONFIG_MEM_REGION_COUNT Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 16/43] drm/xe/uapi: Remove unused QUERY_CONFIG_GT_COUNT Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 17/43] drm/xe/uapi: Rename *_mem_regions masks Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 18/43] drm/xe/uapi: Rename query's mem_usage to mem_regions Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 19/43] drm/xe: Make DRM_XE_DEVICE_QUERY_ENGINES future proof Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 20/43] drm/xe/uapi: Replace BO with GEM in documentation Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 21/43] drm/xe/pmu: Drop interrupt pmu event Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 22/43] drm/xe/uapi: Reject bo creation of unaligned size Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 23/43] drm/xe/uapi: Fix indentation issues that sometimes causes build warning Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 24/43] drm/xe/uapi: Order sections Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 25/43] drm/xe/uapi: More uAPI documentation additions and cosmetic updates Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 26/43] drm/xe/uapi: Split xe_sync types from flags Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 27/43] drm/xe/uapi: Standardize the FLAG naming and assignment Francois Dugast
2023-11-09 15:10   ` Matthew Brost
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 28/43] drm/xe/uapi: Differentiate WAIT_OP from WAIT_MASK Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 29/43] drm/xe/uapi: Move xe_exec after xe_exec_queue Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 30/43] drm/xe/uapi: Move memory_region masks from GT to engine Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 31/43] drm/xe/uapi: Document the memory_region bitmask Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 32/43] drm/xe/uapi: Be more specific about the vm_bind prefetch region Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 33/43] drm/xe/uapi: Convert tile_mask to a pt_placement_hint Francois Dugast
2023-11-09  9:29   ` Matthew Brost [this message]
2023-11-09 19:05     ` Rodrigo Vivi
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 34/43] drm/xe/uapi: Exec queue documentation and variable renaming Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 35/43] drm/xe/uapi: Refactor engine information Francois Dugast
2023-11-09 12:07   ` Matthew Brost
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 36/43] drm/xe/uapi: Crystal Reference Clock updates Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 37/43] drm/xe/uapi: Add Tile ID information to the GT info query Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 38/43] drm/xe/uapi: Remove bogus engine list from the wait_user_fence IOCTL Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 39/43] drm/xe/uapi: Align on a common way to return arrays (memory regions) Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 40/43] drm/xe/uapi: Align on a common way to return arrays (gt) Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 41/43] drm/xe/uapi: Align on a common way to return arrays (engines) Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 42/43] drm/xe/uapi: Add block diagram of a device Francois Dugast
2023-11-09 15:44 ` [Intel-xe] [PATCH v3 43/43] drm/xe/uapi: Add examples of user space code Francois Dugast
2023-11-09 16:05 ` [Intel-xe] ✗ CI.Patch_applied: failure for uAPI Alignment - take 2 Patchwork
2023-11-09 17:11 ` [Intel-xe] [PATCH v3 00/43] " Souza, Jose
2023-11-15 23:29 ` [Intel-xe] ✗ CI.Patch_applied: failure for uAPI Alignment - take 2 (rev2) Patchwork
2023-11-17 21:35 ` 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=ZUymje2SlXQuDzH3@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=francois.dugast@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 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.