aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-graphics/drm/libdrm-2.4.66/0120-tests-amdgpu-add-vram-memory-info-test.patch
blob: 03f6087b4c15dc45ebef3e20a35efbddab3674f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 15f3ca07aaf1a5836e79b7fe9324559689e3b57a Mon Sep 17 00:00:00 2001
From: Junwei Zhang <Jerry.Zhang@amd.com>
Date: Tue, 20 Sep 2016 14:15:59 +0800
Subject: [PATCH 03/10] tests/amdgpu: add vram memory info test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: If8f26c99f408fa2706ffc2f62ad17720d83e254c
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 tests/amdgpu/basic_tests.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 3817d27..ce14786 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -402,6 +402,31 @@ static void amdgpu_query_heap_info_test(void)
 	amdgpu_vprintf("    usage: 0x%"PRIx64"\n", info.heap_usage);
 }
 
+static void amdgpu_query_memory_info_test(void)
+{
+	struct amdgpu_memory_info mem;
+
+	amdgpu_query_memory_info(device_handle, &mem);
+
+	amdgpu_vprintf("\n    VRAM memory info...\n");
+	amdgpu_vprintf("    total: 0x%"PRIx64"\n", mem.vram.total_heap_size);
+	amdgpu_vprintf("    usable: 0x%"PRIx64"\n", mem.vram.usable_heap_size);
+	amdgpu_vprintf("    usage: 0x%"PRIx64"\n", mem.vram.heap_usage);
+	amdgpu_vprintf("    max: 0x%"PRIx64"\n", mem.vram.max_allocation);
+
+	amdgpu_vprintf("\n    Visible VRAM memory info...\n");
+	amdgpu_vprintf("    total: 0x%"PRIx64"\n", mem.cpu_accessible_vram.total_heap_size);
+	amdgpu_vprintf("    usable: 0x%"PRIx64"\n", mem.cpu_accessible_vram.usable_heap_size);
+	amdgpu_vprintf("    usage: 0x%"PRIx64"\n", mem.cpu_accessible_vram.heap_usage);
+	amdgpu_vprintf("    max: 0x%"PRIx64"\n", mem.cpu_accessible_vram.max_allocation);
+
+	amdgpu_vprintf("\n    GTT memory info...\n");
+	amdgpu_vprintf("    total: 0x%"PRIx64"\n", mem.gtt.total_heap_size);
+	amdgpu_vprintf("    usable: 0x%"PRIx64"\n", mem.gtt.usable_heap_size);
+	amdgpu_vprintf("    usage: 0x%"PRIx64"\n", mem.gtt.heap_usage);
+	amdgpu_vprintf("    max: 0x%"PRIx64"\n", mem.gtt.max_allocation);
+}
+
 static void amdgpu_query_info_test(void)
 {
 	amdgpu_query_gpu_info_test();
@@ -412,6 +437,7 @@ static void amdgpu_query_info_test(void)
 	amdgpu_query_hw_info_test(AMDGPU_HW_IP_UVD);
 	amdgpu_query_hw_info_test(AMDGPU_HW_IP_VCE);
 	amdgpu_query_heap_info_test();
+	amdgpu_query_memory_info_test();
 }
 
 static void amdgpu_memory_alloc(void)
-- 
2.7.4