diff options
author | Chunming Zhou <David1.Zhou@amd.com> | 2017-04-13 04:16:51 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-04-28 17:32:53 -0400 |
commit | 05a72a2864c2b27471e9f5365448563c78f9b114 (patch) | |
tree | 9671643ec131395d27c2e431555bddc7a86eabdf /drivers/gpu/drm/amd | |
parent | 4fcae787866915161f22d627328fa8d2e13d215b (diff) |
drm/amdgpu: add gtt print like vram when dump mm table V2
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>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index 0335c2f331e9..f7d22c44034d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | |||
@@ -134,6 +134,15 @@ int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, | |||
134 | return r; | 134 | return r; |
135 | } | 135 | } |
136 | 136 | ||
137 | void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager *man) | ||
138 | { | ||
139 | struct amdgpu_device *adev = amdgpu_ttm_adev(man->bdev); | ||
140 | struct amdgpu_gtt_mgr *mgr = man->priv; | ||
141 | |||
142 | seq_printf(m, "man size:%llu pages, gtt available:%llu pages, usage:%lluMB\n", | ||
143 | man->size, mgr->available, (u64)atomic64_read(&adev->gtt_usage) >> 20); | ||
144 | |||
145 | } | ||
137 | /** | 146 | /** |
138 | * amdgpu_gtt_mgr_new - allocate a new node | 147 | * amdgpu_gtt_mgr_new - allocate a new node |
139 | * | 148 | * |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index eadbcfad2299..24ca251f82ca 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -1411,6 +1411,8 @@ error_free: | |||
1411 | 1411 | ||
1412 | #if defined(CONFIG_DEBUG_FS) | 1412 | #if defined(CONFIG_DEBUG_FS) |
1413 | 1413 | ||
1414 | extern void amdgpu_gtt_mgr_print(struct seq_file *m, struct ttm_mem_type_manager | ||
1415 | *man); | ||
1414 | static int amdgpu_mm_dump_table(struct seq_file *m, void *data) | 1416 | static int amdgpu_mm_dump_table(struct seq_file *m, void *data) |
1415 | { | 1417 | { |
1416 | struct drm_info_node *node = (struct drm_info_node *)m->private; | 1418 | 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) | |||
1424 | spin_lock(&glob->lru_lock); | 1426 | spin_lock(&glob->lru_lock); |
1425 | drm_mm_print(mm, &p); | 1427 | drm_mm_print(mm, &p); |
1426 | spin_unlock(&glob->lru_lock); | 1428 | spin_unlock(&glob->lru_lock); |
1427 | if (ttm_pl == TTM_PL_VRAM) | 1429 | switch (ttm_pl) { |
1430 | case TTM_PL_VRAM: | ||
1428 | seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n", | 1431 | seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n", |
1429 | adev->mman.bdev.man[ttm_pl].size, | 1432 | adev->mman.bdev.man[ttm_pl].size, |
1430 | (u64)atomic64_read(&adev->vram_usage) >> 20, | 1433 | (u64)atomic64_read(&adev->vram_usage) >> 20, |
1431 | (u64)atomic64_read(&adev->vram_vis_usage) >> 20); | 1434 | (u64)atomic64_read(&adev->vram_vis_usage) >> 20); |
1435 | break; | ||
1436 | case TTM_PL_TT: | ||
1437 | amdgpu_gtt_mgr_print(m, &adev->mman.bdev.man[TTM_PL_TT]); | ||
1438 | break; | ||
1439 | } | ||
1432 | return 0; | 1440 | return 0; |
1433 | } | 1441 | } |
1434 | 1442 | ||