Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hellstrom, Thomas" <thomas.hellstrom@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Zeng,  Oak" <oak.zeng@intel.com>
Cc: "Brost, Matthew" <matthew.brost@intel.com>,
	"Welty, Brian" <brian.welty@intel.com>,
	"Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH 2/8] drm/xe/svm: Add DRM_XE_SVM kernel config entry
Date: Tue, 19 Mar 2024 09:25:48 +0000	[thread overview]
Message-ID: <b467523d7a1e3153f01e6a1b036f5db2ac5760ea.camel@intel.com> (raw)
In-Reply-To: <20240319025511.1598354-3-oak.zeng@intel.com>

Hi, Oak,

On Mon, 2024-03-18 at 22:55 -0400, Oak Zeng wrote:
> DRM_XE_SVM kernel config entry is added so
> xe svm feature can be configured before kernel
> compilation.

Please use imperative language in commit messages.


> 
> Signed-off-by: Oak Zeng <oak.zeng@intel.com>
> Co-developed-by: Niranjana Vishwanathapura
> <niranjana.vishwanathapura@intel.com>
> Signed-off-by: Niranjana Vishwanathapura
> <niranjana.vishwanathapura@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@intel.com>
> Cc: Brian Welty <brian.welty@intel.com>
> ---
>  drivers/gpu/drm/xe/Kconfig   | 21 +++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_tile.c |  4 ++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
> index 1a556d087e63..e244165459c5 100644
> --- a/drivers/gpu/drm/xe/Kconfig
> +++ b/drivers/gpu/drm/xe/Kconfig
> @@ -83,6 +83,27 @@ config DRM_XE_FORCE_PROBE
>  	  4571.
>  
>  	  Use "!*" to block the probe of the driver for all known
> devices.
> +config DRM_XE_SVM
> +	bool "Enable Shared Virtual Memory support in xe"
> +	depends on DRM_XE
> +	depends on ARCH_ENABLE_MEMORY_HOTPLUG
> +	depends on ARCH_ENABLE_MEMORY_HOTREMOVE
> +	depends on MEMORY_HOTPLUG
> +	depends on MEMORY_HOTREMOVE
> +	depends on ARCH_HAS_PTE_DEVMAP
> +	depends on SPARSEMEM_VMEMMAP
> +	depends on ZONE_DEVICE
> +	depends on DEVICE_PRIVATE
> +	depends on MMU
> +	select HMM_MIRROR
> +	select MMU_NOTIFIER
> +	default y
> +	help
> +	  Choose this option if you want Shared Virtual Memory (SVM)
> +	  support in xe. With SVM, virtual address space is shared
> +	  between CPU and GPU. This means any virtual address such
> +	  as malloc or mmap returns, variables on stack, or global
> +	  memory pointers, can be used for GPU transparently.
>  
>  menu "drm/Xe Debugging"
>  depends on DRM_XE
> diff --git a/drivers/gpu/drm/xe/xe_tile.c
> b/drivers/gpu/drm/xe/xe_tile.c
> index f1c4f9de51df..b52a00a6b5d5 100644
> --- a/drivers/gpu/drm/xe/xe_tile.c
> +++ b/drivers/gpu/drm/xe/xe_tile.c
> @@ -159,7 +159,9 @@ static int tile_ttm_mgr_init(struct xe_tile
> *tile)
>   */
>  int xe_tile_init_noalloc(struct xe_tile *tile)
>  {
> +#if IS_ENABLED(CONFIG_DRM_XE_SVM)
>  	struct xe_device *xe = tile_to_xe(tile);
> +#endif

Avoid using conditional compilation in this way inside functions if
possible, please see below:

>  	int err;
>  
>  	xe_device_mem_access_get(tile_to_xe(tile));
> @@ -177,8 +179,10 @@ int xe_tile_init_noalloc(struct xe_tile *tile)
>  
>  	xe_tile_sysfs_init(tile);
>  
> +#if IS_ENABLED(CONFIG_DRM_XE_SVM)
>  	if (xe->info.has_usm)

Could be:
	if (IS_ENABLED(CONFIG_DRM_XE_SVM) && tile_to_xe(tile)-
>info.has_usm)

/Thomas


>  		xe_devm_add(tile, &tile->mem.vram);
> +#endif
>  err_mem_access:
>  	xe_device_mem_access_put(tile_to_xe(tile));
>  	return err;


  reply	other threads:[~2024-03-19  9:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  2:55 [PATCH 0/8] Use hmm_range_fault to populate user page Oak Zeng
2024-03-19  2:55 ` [PATCH 1/8] drm/xe/svm: Remap and provide memmap backing for GPU vram Oak Zeng
2024-03-19  2:55 ` [PATCH 2/8] drm/xe/svm: Add DRM_XE_SVM kernel config entry Oak Zeng
2024-03-19  9:25   ` Hellstrom, Thomas [this message]
2024-03-19 18:27     ` Zeng, Oak
2024-03-19  2:55 ` [PATCH 3/8] drm/xe: Helper to get tile from memory region Oak Zeng
2024-03-19  9:28   ` Hellstrom, Thomas
2024-03-19  2:55 ` [PATCH 4/8] drm/xe: Introduce a helper to get dpa from pfn Oak Zeng
2024-03-19  2:55 ` [PATCH 5/8] drm/xe/svm: Get xe memory region from page Oak Zeng
2024-03-19  2:55 ` [PATCH 6/8] drm/xe: Helper to populate a userptr or hmmptr Oak Zeng
2024-03-19 10:33   ` Hellstrom, Thomas
2024-03-19 10:45     ` Hellstrom, Thomas
2024-03-19 20:56       ` Zeng, Oak
2024-03-19 16:48     ` Matthew Brost
2024-03-19 17:59       ` Zeng, Oak
2024-03-19 20:45     ` Zeng, Oak
2024-03-19  2:55 ` [PATCH 7/8] drm/xe: Introduce a helper to free sg table Oak Zeng
2024-03-19  2:55 ` [PATCH 8/8] drm/xe: Use hmm_range_fault to populate user pages Oak Zeng
2024-03-19  4:09 ` ✓ CI.Patch_applied: success for Use hmm_range_fault to populate user page (rev2) Patchwork
2024-03-19  4:09 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-19  4:10 ` ✗ CI.KUnit: failure " 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=b467523d7a1e3153f01e6a1b036f5db2ac5760ea.camel@intel.com \
    --to=thomas.hellstrom@intel.com \
    --cc=brian.welty@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=oak.zeng@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