Commit b646ce9c authored by Brian Welty's avatar Brian Welty Committed by Rodrigo Vivi

drm/xe: Make xe_mmio_tile_vram_size() static

During xe_mmio_probe_vram(), we already store the values returned from
xe_mmio_tile_vram_size() into the xe_tile structures.
There is no need to call xe_mmio_tile_vram_size() again later during
setup of the STOLEN region. Just use the values stored in the root tile.
Signed-off-by: default avatarBrian Welty <brian.welty@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent be13336e
......@@ -201,7 +201,8 @@ static int xe_determine_lmem_bar_size(struct xe_device *xe)
* NOTE: multi-tile bases will include the tile offset.
*
*/
int xe_mmio_tile_vram_size(struct xe_tile *tile, u64 *vram_size, u64 *tile_size, u64 *tile_offset)
static int xe_mmio_tile_vram_size(struct xe_tile *tile, u64 *vram_size,
u64 *tile_size, u64 *tile_offset)
{
struct xe_device *xe = tile_to_xe(tile);
struct xe_gt *gt = tile->primary_gt;
......
......@@ -135,7 +135,6 @@ static inline bool xe_mmio_in_range(const struct xe_gt *gt,
}
int xe_mmio_probe_vram(struct xe_device *xe);
int xe_mmio_tile_vram_size(struct xe_tile *tile, u64 *vram_size, u64 *tile_size, u64 *tile_base);
u64 xe_mmio_read64_2x32(struct xe_gt *gt, struct xe_reg reg);
#endif
......@@ -62,12 +62,9 @@ static s64 detect_bar2_dgfx(struct xe_device *xe, struct xe_ttm_stolen_mgr *mgr)
u64 stolen_size;
u64 tile_offset;
u64 tile_size;
u64 vram_size;
if (xe_mmio_tile_vram_size(tile, &vram_size, &tile_size, &tile_offset)) {
drm_err(&xe->drm, "Querying total vram size failed\n");
return 0;
}
tile_offset = tile->mem.vram.io_start - xe->mem.vram.io_start;
tile_size = tile->mem.vram.actual_physical_size;
/* Use DSM base address instead for stolen memory */
mgr->stolen_base = (xe_mmio_read64_2x32(mmio, DSMBASE) & BDSM_MASK) - tile_offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment