aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Welty <[email protected]>2023-09-26 13:59:37 -0700
committerRodrigo Vivi <[email protected]>2023-12-21 11:43:19 -0500
commitc85d36be2993d65cfd678e01659ff69a4a803cad (patch)
tree3da8cdb71bd1ac4057e9fa2fd61aa8cf22bbcd4a
parentbf6d941c06c9681d0f3d8380e7093d7f79d3eef6 (diff)
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: Brian Welty <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_res_cursor.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_res_cursor.h b/drivers/gpu/drm/xe/xe_res_cursor.h
index 5cb4b66a5d74..006fc1361967 100644
--- a/drivers/gpu/drm/xe/xe_res_cursor.h
+++ b/drivers/gpu/drm/xe/xe_res_cursor.h
@@ -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;
}