From: Alvin Lee <alvin.l...@amd.com>

[ Upstream commit fec05adc40c25a028c9dfa9d540f800a2d433f80 ]

VBIOS has suggested to use channel_width=2 for any ASIC that uses vram
info 3.0. This is because channel_width in the vram table no longer
represents the memory width

Tested-by: Daniel Wheeler <daniel.whee...@amd.com>
Reviewed-by: Samson Tam <samson....@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.sique...@amd.com>
Signed-off-by: Alvin Lee <alvin.l...@amd.com>
Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
Signed-off-by: Sasha Levin <sas...@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c 
b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
index e507d2e1410b7..72891d69afb68 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
@@ -2402,7 +2402,13 @@ static enum bp_result get_vram_info_v30(
                return BP_RESULT_BADBIOSTABLE;
 
        info->num_chans = info_v30->channel_num;
-       info->dram_channel_width_bytes = (1 << info_v30->channel_width) / 8;
+       /* As suggested by VBIOS we should always use
+        * dram_channel_width_bytes = 2 when using VRAM
+        * table version 3.0. This is because the channel_width
+        * param in the VRAM info table is changed in 7000 series and
+        * no longer represents the memory channel width.
+        */
+       info->dram_channel_width_bytes = 2;
 
        return result;
 }
-- 
2.42.0

Reply via email to