drm/amdgpu: fix vram type and bandwidth error for DDR5 and DDR4
Subsystems (2)
PATCH 1/1 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 Huang Rui <[email protected]>
--- .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +36 -17
@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)union igp_info {struct atom_integrated_system_info_v1_11 v11;struct atom_integrated_system_info_v1_12 v12; +struct atom_integrated_system_info_v2_1 v21; };union umc_info {
@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,if (adev->flags &AMD_IS_APU ) { igp_info = (union igp_info *) (mode_info->atom_context->bios + data_offset); -switch (crev) { -case 11 : - mem_channel_number = igp_info->v11.umachannelnumber; -/* 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); +switch (frev) { +case 1 : +switch (crev) { +case 11 : +case 12 : + mem_channel_number = igp_info->v11.umachannelnumber; +if (!mem_channel_number) + mem_channel_number =1 ; +/* 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 ; -case 12 : - mem_channel_number = igp_info->v12.umachannelnumber; -/* channel width is 64 */ -if (vram_width) - *vram_width = mem_channel_number *64 ; - mem_type = igp_info->v12.memorytype; -if (vram_type) - *vram_type =convert_atom_mem_type_to_vram_type (adev, mem_type); +case 2 : +switch (crev) { +case 1 : +case 2 : + mem_channel_number = igp_info->v21.umachannelnumber; +if (!mem_channel_number) + mem_channel_number =1 ; +/* 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 ;default :return -EINVAL ;
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 5 lines · Huang Rui
This patch is to update atomfirmware parser for the memory type and bandwidth of DDR5 and DDR4.
Signed-off-by Huang Rui <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 79 lines
--- .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +36
-18@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)union igp_info {struct atom_integrated_system_info_v1_11 v11;struct atom_integrated_system_info_v1_12 v12; +struct atom_integrated_system_info_v2_1 v21; };union umc_info {@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,if (adev->flags &AMD_IS_APU ) { igp_info = (union igp_info *) (mode_info->atom_context->bios + data_offset); -switch (crev) { -case 11 : - mem_channel_number = igp_info->v11.umachannelnumber; -/* 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); +switch (frev) { +case 1 : +switch (crev) { +case 11 : +case 12 : + mem_channel_number = igp_info->v11.umachannelnumber; +if (!mem_channel_number) + mem_channel_number =1 ; +/* 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 ; -case 12 : - mem_channel_number = igp_info->v12.umachannelnumber; -/* channel width is 64 */ -if (vram_width) - *vram_width = mem_channel_number *64 ; - mem_type = igp_info->v12.memorytype; -if (vram_type) - *vram_type =convert_atom_mem_type_to_vram_type (adev, mem_type); +case 2 : +switch (crev) { +case 1 : +case 2 : + mem_channel_number = igp_info->v21.umachannelnumber; +if (!mem_channel_number) + mem_channel_number =1 ; +/* 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 ;default :return -EINVAL ; --2.25.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx