Commit 8b41903a authored by Hawking Zhang's avatar Hawking Zhang Committed by Alex Deucher

drm/amdgpu: support query vram info for sienna_cichlid

support query vram_module v11 and vram_info v2_5
for sienna_cichlid
Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarLikun Gao <Likun.Gao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9d370816
...@@ -120,11 +120,13 @@ union umc_info { ...@@ -120,11 +120,13 @@ 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; struct atom_vram_info_header_v2_4 v24;
struct atom_vram_info_header_v2_5 v25;
}; };
union vram_module { union vram_module {
struct atom_vram_module_v9 v9; struct atom_vram_module_v9 v9;
struct atom_vram_module_v10 v10; struct atom_vram_module_v10 v10;
struct atom_vram_module_v11 v11;
}; };
static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev, static int convert_atom_mem_type_to_vram_type(struct amdgpu_device *adev,
...@@ -260,6 +262,26 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, ...@@ -260,6 +262,26 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
if (vram_vendor) if (vram_vendor)
*vram_vendor = mem_vendor; *vram_vendor = mem_vendor;
break; break;
case 5:
if (module_id > vram_info->v25.vram_module_num)
module_id = 0;
vram_module = (union vram_module *)vram_info->v25.vram_module;
while (i < module_id) {
vram_module = (union vram_module *)
((u8 *)vram_module + vram_module->v11.vram_module_size);
i++;
}
mem_type = vram_module->v11.memory_type;
if (vram_type)
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
mem_channel_number = vram_module->v11.channel_num;
mem_channel_width = vram_module->v11.channel_width;
if (vram_width)
*vram_width = mem_channel_number * (1 << mem_channel_width);
mem_vendor = (vram_module->v11.vender_rev_id) & 0xF;
if (vram_vendor)
*vram_vendor = mem_vendor;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
......
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