diff options
author | Harry Wentland <harry.wentland@amd.com> | 2017-03-31 20:14:33 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-04-04 14:42:40 -0400 |
commit | 1ce65f5284d6018916dd4a86865d0ce5f11d24b9 (patch) | |
tree | 3338f081ba0e265f3710023945802bf7e11662e0 /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |
parent | 83ca145d155fbd50b9f23b0de99cd16e805a75d0 (diff) |
drm/amdgpu: Read vram width from integrated system info table
On KB, KV, CZ we should read the vram width from integrated system
table, if we can. The NOOFCHAN in MC_SHARED_CHMAP is not accurate.
With this change we can enable two 4k displays on CZ again. This use
case was broken sometime in January when we started looking at
vram_width for bandwidth calculations instead of hardcoding this value.
v2:
Return 0 if integrated system info table is not available.
Tested-by: Roman Li <roman.li@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index f52b1bf3d3d9..ad4329922f79 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |||
@@ -754,6 +754,35 @@ union igp_info { | |||
754 | struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_9 info_9; | 754 | struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_9 info_9; |
755 | }; | 755 | }; |
756 | 756 | ||
757 | /* | ||
758 | * Return vram width from integrated system info table, if available, | ||
759 | * or 0 if not. | ||
760 | */ | ||
761 | int amdgpu_atombios_get_vram_width(struct amdgpu_device *adev) | ||
762 | { | ||
763 | struct amdgpu_mode_info *mode_info = &adev->mode_info; | ||
764 | int index = GetIndexIntoMasterTable(DATA, IntegratedSystemInfo); | ||
765 | u16 data_offset, size; | ||
766 | union igp_info *igp_info; | ||
767 | u8 frev, crev; | ||
768 | |||
769 | /* get any igp specific overrides */ | ||
770 | if (amdgpu_atom_parse_data_header(mode_info->atom_context, index, &size, | ||
771 | &frev, &crev, &data_offset)) { | ||
772 | igp_info = (union igp_info *) | ||
773 | (mode_info->atom_context->bios + data_offset); | ||
774 | switch (crev) { | ||
775 | case 8: | ||
776 | case 9: | ||
777 | return igp_info->info_8.ucUMAChannelNumber * 64; | ||
778 | default: | ||
779 | return 0; | ||
780 | } | ||
781 | } | ||
782 | |||
783 | return 0; | ||
784 | } | ||
785 | |||
757 | static void amdgpu_atombios_get_igp_ss_overrides(struct amdgpu_device *adev, | 786 | static void amdgpu_atombios_get_igp_ss_overrides(struct amdgpu_device *adev, |
758 | struct amdgpu_atom_ss *ss, | 787 | struct amdgpu_atom_ss *ss, |
759 | int id) | 788 | int id) |