drm/xe: Update shared stats to use the new gem helper
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 12 Feb 2024 21:04:28 +0000 (16:04 -0500)
committerChristian König <christian.koenig@amd.com>
Fri, 16 Feb 2024 11:52:50 +0000 (12:52 +0100)
Switch to using the new gem shared memory stats helper
rather than hand rolling it.

Link: https://lore.kernel.org/all/20231207180225.439482-1-alexander.deucher@amd.com/
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/xe/xe_drm_client.c

index 82d1305e831f298f013338e4f7ee9e6e2ea67168..ecf2eb67d3106f8d0c1af9d344a52faafa5604e0 100644 (file)
@@ -113,7 +113,7 @@ static void bo_meminfo(struct xe_bo *bo,
        else
                mem_type = XE_PL_TT;
 
-       if (bo->ttm.base.handle_count > 1)
+       if (drm_gem_object_is_shared_for_memory_stats(&bo->ttm.base))
                stats[mem_type].shared += sz;
        else
                stats[mem_type].private += sz;