Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Replace xe_ttm_vram_mgr.tile with xe_mem_region

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>

authored by

Brian Welty and committed by
Rodrigo Vivi
4e002016 4446fcf2

+6 -7
+3 -4
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
··· 358 358 int xe_ttm_vram_mgr_init(struct xe_tile *tile, struct xe_ttm_vram_mgr *mgr) 359 359 { 360 360 struct xe_device *xe = tile_to_xe(tile); 361 + struct xe_mem_region *vram = &tile->mem.vram; 361 362 362 - mgr->tile = tile; 363 - 363 + mgr->vram = vram; 364 364 return __xe_ttm_vram_mgr_init(xe, mgr, XE_PL_VRAM0 + tile->id, 365 - tile->mem.vram.usable_size, 366 - tile->mem.vram.io_size, 365 + vram->usable_size, vram->io_size, 367 366 PAGE_SIZE); 368 367 } 369 368
+3 -3
drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h
··· 9 9 #include <drm/drm_buddy.h> 10 10 #include <drm/ttm/ttm_device.h> 11 11 12 - struct xe_tile; 12 + struct xe_mem_region; 13 13 14 14 /** 15 15 * struct xe_ttm_vram_mgr - XE TTM VRAM manager ··· 17 17 * Manages placement of TTM resource in VRAM. 18 18 */ 19 19 struct xe_ttm_vram_mgr { 20 - /** @tile: Tile which the VRAM belongs to */ 21 - struct xe_tile *tile; 22 20 /** @manager: Base TTM resource manager */ 23 21 struct ttm_resource_manager manager; 24 22 /** @mm: DRM buddy allocator which manages the VRAM */ 25 23 struct drm_buddy mm; 24 + /** @vram: ptr to details of associated VRAM region */ 25 + struct xe_mem_region *vram; 26 26 /** @visible_size: Proped size of the CPU visible portion */ 27 27 u64 visible_size; 28 28 /** @visible_avail: CPU visible portion still unallocated */