Skip to content

Commit

Permalink
drm/xe/client: use mem_type from the current resource
Browse files Browse the repository at this point in the history
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 fbd73b7)
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
matt-auld authored and lucasdemarchi committed Sep 18, 2024
1 parent 69bbe3a commit 73d10c7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/gpu/drm/xe/xe_drm_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73d10c7

Please sign in to comment.