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

drm/xe: Simplify xe_res_get_buddy()

We can remove the unnecessary indirection thru xe->tiles[] to get
the TTM VRAM manager.  This code can be common for VRAM and STOLEN.
Signed-off-by: default avatarBrian Welty <brian.welty@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent bf6d941c
......@@ -50,14 +50,9 @@ struct xe_res_cursor {
static struct drm_buddy *xe_res_get_buddy(struct ttm_resource *res)
{
struct xe_device *xe = ttm_to_xe_device(res->bo->bdev);
struct ttm_resource_manager *mgr;
if (res->mem_type != XE_PL_STOLEN)
return &xe->tiles[res->mem_type - XE_PL_VRAM0].mem.vram_mgr->mm;
mgr = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
mgr = ttm_manager_type(res->bo->bdev, res->mem_type);
return &to_xe_ttm_vram_mgr(mgr)->mm;
}
......
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