Skip to content

Commit 73d10c7

Browse files
matt-auldLucas De Marchi
authored andcommitted
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 <matthew.auld@intel.com> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Tejas Upadhyay <tejas.upadhyay@intel.com> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240911155527.178910-7-matthew.auld@intel.com (cherry picked from commit fbd73b7) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 69bbe3a commit 73d10c7

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/gpu/drm/xe/xe_drm_client.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,10 @@ static void bo_meminfo(struct xe_bo *bo,
168168
struct drm_memory_stats stats[TTM_NUM_MEM_TYPES])
169169
{
170170
u64 sz = bo->size;
171-
u32 mem_type;
171+
u32 mem_type = bo->ttm.resource->mem_type;
172172

173173
xe_bo_assert_held(bo);
174174

175-
if (bo->placement.placement)
176-
mem_type = bo->placement.placement->mem_type;
177-
else
178-
mem_type = XE_PL_TT;
179-
180175
if (drm_gem_object_is_shared_for_memory_stats(&bo->ttm.base))
181176
stats[mem_type].shared += sz;
182177
else

0 commit comments

Comments
 (0)