Commit 12f2df72 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amdgpu: fix vram type and bandwidth error for DDR5 and DDR4

This patch is to update atomfirmware parser for the memory type and
bandwidth of DDR5 and DDR4.
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 04eb6e77
...@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) ...@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
union igp_info { union igp_info {
struct atom_integrated_system_info_v1_11 v11; struct atom_integrated_system_info_v1_11 v11;
struct atom_integrated_system_info_v1_12 v12; struct atom_integrated_system_info_v1_12 v12;
struct atom_integrated_system_info_v2_1 v21;
}; };
union umc_info { union umc_info {
...@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, ...@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
if (adev->flags & AMD_IS_APU) { if (adev->flags & AMD_IS_APU) {
igp_info = (union igp_info *) igp_info = (union igp_info *)
(mode_info->atom_context->bios + data_offset); (mode_info->atom_context->bios + data_offset);
switch (crev) { switch (frev) {
case 11: case 1:
mem_channel_number = igp_info->v11.umachannelnumber; switch (crev) {
/* channel width is 64 */ case 11:
if (vram_width) case 12:
*vram_width = mem_channel_number * 64; mem_channel_number = igp_info->v11.umachannelnumber;
mem_type = igp_info->v11.memorytype; if (!mem_channel_number)
if (vram_type) mem_channel_number = 1;
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type); /* channel width is 64 */
if (vram_width)
*vram_width = mem_channel_number * 64;
mem_type = igp_info->v11.memorytype;
if (vram_type)
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
break;
default:
return -EINVAL;
}
break; break;
case 12: case 2:
mem_channel_number = igp_info->v12.umachannelnumber; switch (crev) {
/* channel width is 64 */ case 1:
if (vram_width) case 2:
*vram_width = mem_channel_number * 64; mem_channel_number = igp_info->v21.umachannelnumber;
mem_type = igp_info->v12.memorytype; if (!mem_channel_number)
if (vram_type) mem_channel_number = 1;
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type); /* channel width is 64 */
if (vram_width)
*vram_width = mem_channel_number * 64;
mem_type = igp_info->v21.memorytype;
if (vram_type)
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
break;
default:
return -EINVAL;
}
break; 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