drm/amd/amdgpu: add info about vram and gtt total size

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index c2c7fb1..67b6274 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -411,6 +411,16 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		return copy_to_user(out, &vram_gtt,
 				    min((size_t)size, sizeof(vram_gtt))) ? -EFAULT : 0;
 	}
+	case AMDGPU_INFO_VRAM_GTT_TOTAL: {
+		struct drm_amdgpu_info_vram_gtt_total vram_gtt_total;
+
+		vram_gtt_total.vram_total_size = adev->mc.real_vram_size;
+		vram_gtt_total.vram_cpu_accessible_total_size = adev->mc.visible_vram_size;
+		vram_gtt_total.gtt_total_size = adev->mc.gtt_size;
+		return copy_to_user(out, &vram_gtt_total,
+				    min((size_t)size, sizeof(vram_gtt_total)))
+				    ? -EFAULT : 0;
+	}
 	case AMDGPU_INFO_READ_MMR_REG: {
 		unsigned n, alloc_size;
 		uint32_t *regs;