]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: add gtt print like vram when dump mm table V2
authorChunming Zhou <David1.Zhou@amd.com>
Thu, 13 Apr 2017 08:16:51 +0000 (16:16 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 28 Apr 2017 21:32:53 +0000 (17:32 -0400)
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-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>
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 0335c2f331e9b9fa356eede6d6428344d7c5b70b..f7d22c44034d43cce77ecd096c953e18aadc955d 100644 (file)
@@ -134,6 +134,15 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man,
        return r;
 }
 
+void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager *man)
+{
+       struct amdgpu_device *adev = amdgpu_ttm_adev(man->bdev);
+       struct amdgpu_gtt_mgr *mgr = man->priv;
+
+       seq_printf(m, "man size:%llu pages, gtt available:%llu pages, usage:%lluMB\n",
+                  man->size, mgr->available, (u64)atomic64_read(&adev->gtt_usage) >> 20);
+
+}
 /**
  * amdgpu_gtt_mgr_new - allocate a new node
  *
index eadbcfad22992e0f8a011e09871adf214b39a970..24ca251f82ca2ea9314d23e4197b919385922523 100644 (file)
@@ -1411,6 +1411,8 @@ error_free:
 
 #if defined(CONFIG_DEBUG_FS)
 
+extern void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager
+                                *man);
 static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
 {
        struct drm_info_node *node = (struct drm_info_node *)m->private;
@@ -1424,11 +1426,17 @@ static int amdgpu_mm_dump_table(struct seq_file *m, void *data)
        spin_lock(&glob->lru_lock);
        drm_mm_print(mm, &p);
        spin_unlock(&glob->lru_lock);
-       if (ttm_pl == TTM_PL_VRAM)
+       switch (ttm_pl) {
+       case TTM_PL_VRAM:
                seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n",
                           adev->mman.bdev.man[ttm_pl].size,
                           (u64)atomic64_read(&adev->vram_usage) >> 20,
                           (u64)atomic64_read(&adev->vram_vis_usage) >> 20);
+               break;
+       case TTM_PL_TT:
+               amdgpu_gtt_mgr_print(m, &adev->mman.bdev.man[TTM_PL_TT]);
+               break;
+       }
        return 0;
 }