Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/2] drm/xe: Rename struct xe_mem_region to struct xe_vram_region
Date: Thu, 6 Feb 2025 15:52:37 -0500	[thread overview]
Message-ID: <Z6UhFUflmeau8zzN@intel.com> (raw)
In-Reply-To: <20250203135359.735832-2-piotr.piorkowski@intel.com>

On Mon, Feb 03, 2025 at 02:53:58PM +0100, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski@intel.com>
> 
> The xe_mem_region structure has so far been used only in the context
> of VRAM regions. Also, the description of its fields clearly indicates
> that it was designed for VRAM regions. This struct is strictly related
> only to VRAM.
> So let's be clear on this point and rename it to xe_vram_region.
> 
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

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

> ---
>  drivers/gpu/drm/xe/xe_bo.c                 | 12 ++++++------
>  drivers/gpu/drm/xe/xe_device_types.h       |  8 ++++----
>  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c       |  2 +-
>  drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h |  4 ++--
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index c32201123d44..095794200438 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -141,7 +141,7 @@ mem_type_to_migrate(struct xe_device *xe, u32 mem_type)
>  	return tile->migrate;
>  }
>  
> -static struct xe_mem_region *res_to_mem_region(struct ttm_resource *res)
> +static struct xe_vram_region *res_to_mem_region(struct ttm_resource *res)
>  {
>  	struct xe_device *xe = ttm_to_xe_device(res->bo->bdev);
>  	struct ttm_resource_manager *mgr;
> @@ -177,7 +177,7 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
>  		     struct ttm_place *places, u32 bo_flags, u32 mem_type, u32 *c)
>  {
>  	struct ttm_place place = { .mem_type = mem_type };
> -	struct xe_mem_region *vram;
> +	struct xe_vram_region *vram;
>  	u64 io_size;
>  
>  	xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
> @@ -466,7 +466,7 @@ static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
>  		return 0;
>  	case XE_PL_VRAM0:
>  	case XE_PL_VRAM1: {
> -		struct xe_mem_region *vram = res_to_mem_region(mem);
> +		struct xe_vram_region *vram = res_to_mem_region(mem);
>  
>  		if (!xe_ttm_resource_visible(mem))
>  			return -EINVAL;
> @@ -813,7 +813,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
>  
>  			/* Create a new VMAP once kernel BO back in VRAM */
>  			if (!ret && resource_is_vram(new_mem)) {
> -				struct xe_mem_region *vram = res_to_mem_region(new_mem);
> +				struct xe_vram_region *vram = res_to_mem_region(new_mem);
>  				void __iomem *new_addr = vram->mapping +
>  					(new_mem->start << PAGE_SHIFT);
>  
> @@ -1023,7 +1023,7 @@ static unsigned long xe_ttm_io_mem_pfn(struct ttm_buffer_object *ttm_bo,
>  {
>  	struct xe_bo *bo = ttm_to_xe_bo(ttm_bo);
>  	struct xe_res_cursor cursor;
> -	struct xe_mem_region *vram;
> +	struct xe_vram_region *vram;
>  
>  	if (ttm_bo->resource->mem_type == XE_PL_STOLEN)
>  		return xe_ttm_stolen_io_offset(bo, page_offset << PAGE_SHIFT) >> PAGE_SHIFT;
> @@ -1163,7 +1163,7 @@ static int xe_ttm_access_memory(struct ttm_buffer_object *ttm_bo,
>  	struct xe_device *xe = ttm_to_xe_device(ttm_bo->bdev);
>  	struct iosys_map vmap;
>  	struct xe_res_cursor cursor;
> -	struct xe_mem_region *vram;
> +	struct xe_vram_region *vram;
>  	int bytes_left = len;
>  
>  	xe_bo_assert_held(bo);
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index 89f532b67bc4..c7c285c6a6c9 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -69,11 +69,11 @@ struct xe_pat_ops;
>  		 struct xe_tile * : (tile__)->xe)
>  
>  /**
> - * struct xe_mem_region - memory region structure
> + * struct xe_vram_region - memory region structure
>   * This is used to describe a memory region in xe
>   * device, such as HBM memory or CXL extension memory.
>   */
> -struct xe_mem_region {
> +struct xe_vram_region {
>  	/** @io_start: IO start address of this VRAM instance */
>  	resource_size_t io_start;
>  	/**
> @@ -196,7 +196,7 @@ struct xe_tile {
>  		 * Although VRAM is associated with a specific tile, it can
>  		 * still be accessed by all tiles' GTs.
>  		 */
> -		struct xe_mem_region vram;
> +		struct xe_vram_region vram;
>  
>  		/** @mem.vram_mgr: VRAM TTM manager */
>  		struct xe_ttm_vram_mgr *vram_mgr;
> @@ -366,7 +366,7 @@ struct xe_device {
>  	/** @mem: memory info for device */
>  	struct {
>  		/** @mem.vram: VRAM info for device */
> -		struct xe_mem_region vram;
> +		struct xe_vram_region vram;
>  		/** @mem.sys_mgr: system TTM manager */
>  		struct ttm_resource_manager sys_mgr;
>  	} mem;
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> index f4a16e5fa770..a8c37fb4fec0 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> @@ -340,7 +340,7 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr,
>  int xe_ttm_vram_mgr_init(struct xe_tile *tile, struct xe_ttm_vram_mgr *mgr)
>  {
>  	struct xe_device *xe = tile_to_xe(tile);
> -	struct xe_mem_region *vram = &tile->mem.vram;
> +	struct xe_vram_region *vram = &tile->mem.vram;
>  
>  	mgr->vram = vram;
>  	return __xe_ttm_vram_mgr_init(xe, mgr, XE_PL_VRAM0 + tile->id,
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h b/drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h
> index 2d75cf126289..4c52ced4ee44 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h
> @@ -9,7 +9,7 @@
>  #include <drm/drm_buddy.h>
>  #include <drm/ttm/ttm_device.h>
>  
> -struct xe_mem_region;
> +struct xe_vram_region;
>  
>  /**
>   * struct xe_ttm_vram_mgr - XE TTM VRAM manager
> @@ -22,7 +22,7 @@ struct xe_ttm_vram_mgr {
>  	/** @mm: DRM buddy allocator which manages the VRAM */
>  	struct drm_buddy mm;
>  	/** @vram: ptr to details of associated VRAM region */
> -	struct xe_mem_region *vram;
> +	struct xe_vram_region *vram;
>  	/** @visible_size: Proped size of the CPU visible portion */
>  	u64 visible_size;
>  	/** @visible_avail: CPU visible portion still unallocated */
> -- 
> 2.34.1
> 

  reply	other threads:[~2025-02-06 20:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 13:53 [PATCH v2 0/2] Cleaning up code related to VRAM regions and its initialization - part 1 Piórkowski, Piotr
2025-02-03 13:53 ` [PATCH v2 1/2] drm/xe: Rename struct xe_mem_region to struct xe_vram_region Piórkowski, Piotr
2025-02-06 20:52   ` Rodrigo Vivi [this message]
2025-02-03 13:53 ` [PATCH v2 2/2] drm/xe: Move VRAM manager " Piórkowski, Piotr
2025-02-06 20:52   ` Rodrigo Vivi
2025-02-03 15:25 ` ✓ CI.Patch_applied: success for Cleaning up code related to VRAM regions and its initialization - part 1 (rev2) Patchwork
2025-02-03 15:25 ` ✓ CI.checkpatch: " Patchwork
2025-02-03 15:26 ` ✓ CI.KUnit: " Patchwork
2025-02-03 15:42 ` ✓ CI.Build: " Patchwork
2025-02-03 15:45 ` ✗ CI.Hooks: failure " Patchwork
2025-02-03 15:46 ` ✓ CI.checksparse: success " Patchwork
2025-02-03 16:06 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-03 17:09 ` ✗ Xe.CI.Full: 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=Z6UhFUflmeau8zzN@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=piotr.piorkowski@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