Commit 89d7a79c authored by Hawking Zhang's avatar Hawking Zhang Committed by Alex Deucher

drm/amdgpu: query vram type from atomfirmware vram_info

vram_type is saved in member vram_module[0].memory_type
Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarJack Xiao <Jack.Xiao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 98cd7f5b
...@@ -118,6 +118,7 @@ union umc_info { ...@@ -118,6 +118,7 @@ union umc_info {
union vram_info { union vram_info {
struct atom_vram_info_header_v2_3 v23; struct atom_vram_info_header_v2_3 v23;
struct atom_vram_info_header_v2_4 v24;
}; };
/* /*
* Return vram width from integrated system info table, if available, * 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,6 +180,9 @@ static int convert_atom_mem_type_to_vram_type (struct amdgpu_device *adev,
case ATOM_DGPU_VRAM_TYPE_HBM2: case ATOM_DGPU_VRAM_TYPE_HBM2:
vram_type = AMDGPU_VRAM_TYPE_HBM; vram_type = AMDGPU_VRAM_TYPE_HBM;
break; break;
case ATOM_DGPU_VRAM_TYPE_GDDR6:
vram_type = AMDGPU_VRAM_TYPE_GDDR6;
break;
default: default:
vram_type = AMDGPU_VRAM_TYPE_UNKNOWN; vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
break; break;
...@@ -227,6 +231,9 @@ int amdgpu_atomfirmware_get_vram_type(struct amdgpu_device *adev) ...@@ -227,6 +231,9 @@ int amdgpu_atomfirmware_get_vram_type(struct amdgpu_device *adev)
case 3: case 3:
mem_type = vram_info->v23.vram_module[0].memory_type; mem_type = vram_info->v23.vram_module[0].memory_type;
return convert_atom_mem_type_to_vram_type(adev, mem_type); return convert_atom_mem_type_to_vram_type(adev, mem_type);
case 4:
mem_type = vram_info->v24.vram_module[0].memory_type;
return convert_atom_mem_type_to_vram_type(adev, mem_type);
default: default:
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment