aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHawking Zhang <Hawking.Zhang@amd.com>2018-12-10 16:20:12 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-06-20 22:16:38 -0400
commit89d7a79c7bd9a9993a78aaad835cf7be3c7dcbfd (patch)
treeb9434bcced92a8d271d78022c37b706968b041be
parent98cd7f5b1837fd103088bfffacc4900372788e1d (diff)
drm/amdgpu: query vram type from atomfirmware vram_info
vram_type is saved in member vram_module[0].memory_type Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jack Xiao <Jack.Xiao@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
index f96d75c6e099..410118df16ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
@@ -118,6 +118,7 @@ union umc_info {
118 118
119union vram_info { 119union vram_info {
120 struct atom_vram_info_header_v2_3 v23; 120 struct atom_vram_info_header_v2_3 v23;
121 struct atom_vram_info_header_v2_4 v24;
121}; 122};
122/* 123/*
123 * Return vram width from integrated system info table, if available, 124 * Return vram width from integrated system info table, if available,
@@ -179,6 +180,9 @@ static int convert_atom_mem_type_to_vram_type (struct amdgpu_device *adev,
179 case ATOM_DGPU_VRAM_TYPE_HBM2: 180 case ATOM_DGPU_VRAM_TYPE_HBM2:
180 vram_type = AMDGPU_VRAM_TYPE_HBM; 181 vram_type = AMDGPU_VRAM_TYPE_HBM;
181 break; 182 break;
183 case ATOM_DGPU_VRAM_TYPE_GDDR6:
184 vram_type = AMDGPU_VRAM_TYPE_GDDR6;
185 break;
182 default: 186 default:
183 vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; 187 vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
184 break; 188 break;
@@ -227,6 +231,9 @@ int amdgpu_atomfirmware_get_vram_type(struct amdgpu_device *adev)
227 case 3: 231 case 3:
228 mem_type = vram_info->v23.vram_module[0].memory_type; 232 mem_type = vram_info->v23.vram_module[0].memory_type;
229 return convert_atom_mem_type_to_vram_type(adev, mem_type); 233 return convert_atom_mem_type_to_vram_type(adev, mem_type);
234 case 4:
235 mem_type = vram_info->v24.vram_module[0].memory_type;
236 return convert_atom_mem_type_to_vram_type(adev, mem_type);
230 default: 237 default:
231 return 0; 238 return 0;
232 } 239 }