radv/rgp: report correct system ram size
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 2 Mar 2020 11:04:46 +0000 (12:04 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 08:22:02 +0000 (08:22 +0000)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4023>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4023>

src/amd/vulkan/radv_rgp.c

index 619ab8cfb0803b7b2e609e5e5603f3162cf1658a..c2dc98f4feca79d8d3f94505456a4630f51dd719 100644 (file)
@@ -166,6 +166,8 @@ static_assert(sizeof(struct sqtt_file_chunk_cpu_info) == 112,
 static void
 radv_sqtt_fill_cpu_info(struct sqtt_file_chunk_cpu_info *chunk)
 {
+       uint64_t system_ram_size = 0;
+
        chunk->header.chunk_id.type = SQTT_FILE_CHUNK_TYPE_CPU_INFO;
        chunk->header.chunk_id.index = 0;
        chunk->header.major_version = 0;
@@ -181,7 +183,10 @@ radv_sqtt_fill_cpu_info(struct sqtt_file_chunk_cpu_info *chunk)
        chunk->clock_speed = 0;
        chunk->num_logical_cores = 0;
        chunk->num_physical_cores = 0;
+
        chunk->system_ram_size = 0;
+       if (os_get_total_physical_memory(&system_ram_size))
+               chunk->system_ram_size = system_ram_size / (1024 * 1024);
 }
 
 /**