diff options
author | Matthew Auld <[email protected]> | 2024-09-11 16:55:29 +0100 |
---|---|---|
committer | Lucas De Marchi <[email protected]> | 2024-09-17 23:30:22 -0500 |
commit | 73d10c7788f6d2b7badf9973afbdea7ca433c15d (patch) | |
tree | f0f7ababc70e0e0feab2bd52fc5dc16ad66b3faf | |
parent | 69bbe3adf36de47315498c9384f99a1ff9171694 (diff) |
drm/xe/client: use mem_type from the current resource
Rather extract the mem_type from the current resource. Checking the
first potential placement doesn't really tell us where the bo is
currently allocated, especially if there are multiple potential
placements.
Signed-off-by: Matthew Auld <[email protected]>
Cc: Himal Prasad Ghimiray <[email protected]>
Cc: Tejas Upadhyay <[email protected]>
Cc: "Thomas Hellström" <[email protected]>
Reviewed-by: Matthew Brost <[email protected]>
Reviewed-by: Tejas Upadhyay <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit fbd73b7d2ae29ef0f604f376bcc22b886a49329e)
Signed-off-by: Lucas De Marchi <[email protected]>
-rw-r--r-- | drivers/gpu/drm/xe/xe_drm_client.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c index 95a05c5bc897..c4add8b38bbd 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -168,15 +168,10 @@ static void bo_meminfo(struct xe_bo *bo, struct drm_memory_stats stats[TTM_NUM_MEM_TYPES]) { u64 sz = bo->size; - u32 mem_type; + u32 mem_type = bo->ttm.resource->mem_type; xe_bo_assert_held(bo); - if (bo->placement.placement) - mem_type = bo->placement.placement->mem_type; - else - mem_type = XE_PL_TT; - if (drm_gem_object_is_shared_for_memory_stats(&bo->ttm.base)) stats[mem_type].shared += sz; else |