summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-08-07 15:47:51 +0200
committerAlex Deucher <alexander.deucher@amd.com>2017-08-17 15:46:01 -0400
commit97cbb28451c21212cc20f2a5e6c074ba33150c3d (patch)
tree755660b357958975e12eae60658e8494899405db /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
parent12d4ac584465845af3c7fba090a82c8ee84180d1 (diff)
drm/amdgpu: move debug print into the MM managers
Instead of the separate switch/case in the calling function. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 3f86b47984a0..1eb8d5d3acf2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -211,11 +211,17 @@ static void amdgpu_vram_mgr_del(struct ttm_mem_type_manager *man,
static void amdgpu_vram_mgr_debug(struct ttm_mem_type_manager *man,
struct drm_printer *printer)
{
+ struct amdgpu_device *adev = amdgpu_ttm_adev(man->bdev);
struct amdgpu_vram_mgr *mgr = man->priv;
spin_lock(&mgr->lock);
drm_mm_print(&mgr->mm, printer);
spin_unlock(&mgr->lock);
+
+ drm_printf(printer, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n",
+ adev->mman.bdev.man[TTM_PL_VRAM].size,
+ (u64)atomic64_read(&adev->vram_usage) >> 20,
+ (u64)atomic64_read(&adev->vram_vis_usage) >> 20);
}
const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func = {