drm/xe: Replace xe_ttm_vram_mgr.tile with xe_mem_region
authorBrian Welty <brian.welty@intel.com>
Mon, 25 Sep 2023 21:02:32 +0000 (14:02 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:43:32 +0000 (11:43 -0500)
Replace the xe_ttm_vram_mgr.tile pointer with a xe_mem_region pointer
instead. The former is currently unused.
TTM VRAM regions are exposing device vram and is better to store a pointer
directly to the xe_mem_region instead of the tile. This allows to cleanup
unnecessary usage of xe_tile from xe_bo.c in later patch.

Signed-off-by: Brian Welty <brian.welty@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h

index 285791eb4a796fe4a29c76470bce13385ddc7962..953e5dc0fd808ee9fdb2bb249c6d0e1e8783f008 100644 (file)
@@ -358,12 +358,11 @@ 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;
 
-       mgr->tile = tile;
-
+       mgr->vram = vram;
        return __xe_ttm_vram_mgr_init(xe, mgr, XE_PL_VRAM0 + tile->id,
-                                     tile->mem.vram.usable_size,
-                                     tile->mem.vram.io_size,
+                                     vram->usable_size, vram->io_size,
                                      PAGE_SIZE);
 }
 
index 48bb991c14a565c41ef8f7f9fca55cedf8a91f30..2d75cf1262893fb01b30d412e533128a2cd7804b 100644 (file)
@@ -9,7 +9,7 @@
 #include <drm/drm_buddy.h>
 #include <drm/ttm/ttm_device.h>
 
-struct xe_tile;
+struct xe_mem_region;
 
 /**
  * struct xe_ttm_vram_mgr - XE TTM VRAM manager
@@ -17,12 +17,12 @@ struct xe_tile;
  * Manages placement of TTM resource in VRAM.
  */
 struct xe_ttm_vram_mgr {
-       /** @tile: Tile which the VRAM belongs to */
-       struct xe_tile *tile;
        /** @manager: Base TTM resource manager */
        struct ttm_resource_manager manager;
        /** @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;
        /** @visible_size: Proped size of the CPU visible portion */
        u64 visible_size;
        /** @visible_avail: CPU visible portion still unallocated */