Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: treat memory as a single-channel for asymmetric memory v2

Previous change had been reverted since it caused hang.
Remake change to avoid defect.

[Why]
1. Driver use umachannelnumber to calculate watermarks for stutter.
In asymmetric memory config, the actual bandwidth is less than
dual-channel. The bandwidth should be the same as single-channel.
2. We found single rank dimm need additional delay time for stutter.

[How]
Get information from each DIMM. Treat memory config as a single-channel
for asymmetric memory in bandwidth calculating.
Add additional delay time for single rank dimm.

Fixes: b8720ed0b87d32 ("drm/amd/display: System black screen hangs on driver load")
Signed-off-by: Hugo Hu <hugo.hu@amd.com>
Reviewed-by: Sung Lee <Sung.Lee@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Hugo Hu and committed by
Alex Deucher
9c82354e 8a20c973

+48 -2
+46 -2
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
··· 769 769 } 770 770 }; 771 771 772 + static struct wm_table ddr4_1R_wm_table_rn = { 773 + .entries = { 774 + { 775 + .wm_inst = WM_A, 776 + .wm_type = WM_TYPE_PSTATE_CHG, 777 + .pstate_latency_us = 11.72, 778 + .sr_exit_time_us = 13.90, 779 + .sr_enter_plus_exit_time_us = 14.80, 780 + .valid = true, 781 + }, 782 + { 783 + .wm_inst = WM_B, 784 + .wm_type = WM_TYPE_PSTATE_CHG, 785 + .pstate_latency_us = 11.72, 786 + .sr_exit_time_us = 13.90, 787 + .sr_enter_plus_exit_time_us = 14.80, 788 + .valid = true, 789 + }, 790 + { 791 + .wm_inst = WM_C, 792 + .wm_type = WM_TYPE_PSTATE_CHG, 793 + .pstate_latency_us = 11.72, 794 + .sr_exit_time_us = 13.90, 795 + .sr_enter_plus_exit_time_us = 14.80, 796 + .valid = true, 797 + }, 798 + { 799 + .wm_inst = WM_D, 800 + .wm_type = WM_TYPE_PSTATE_CHG, 801 + .pstate_latency_us = 11.72, 802 + .sr_exit_time_us = 13.90, 803 + .sr_enter_plus_exit_time_us = 14.80, 804 + .valid = true, 805 + }, 806 + } 807 + }; 808 + 772 809 static struct wm_table lpddr4_wm_table_rn = { 773 810 .entries = { 774 811 { ··· 990 953 } else { 991 954 if (is_green_sardine) 992 955 rn_bw_params.wm_table = ddr4_wm_table_gs; 993 - else 994 - rn_bw_params.wm_table = ddr4_wm_table_rn; 956 + else { 957 + if (ctx->dc->config.is_single_rank_dimm) 958 + rn_bw_params.wm_table = ddr4_1R_wm_table_rn; 959 + else 960 + rn_bw_params.wm_table = ddr4_wm_table_rn; 961 + } 995 962 } 996 963 /* Saved clocks configured at boot for debug purposes */ 997 964 rn_dump_clk_registers(&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info); ··· 1013 972 if (status == PP_SMU_RESULT_OK && 1014 973 ctx->dc_bios && ctx->dc_bios->integrated_info) { 1015 974 rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info); 975 + /* treat memory config as single channel if memory is asymmetrics. */ 976 + if (ctx->dc->config.is_asymmetric_memory) 977 + clk_mgr->base.bw_params->num_channels = 1; 1016 978 } 1017 979 } 1018 980
+2
drivers/gpu/drm/amd/display/dc/dc.h
··· 308 308 #endif 309 309 uint64_t vblank_alignment_dto_params; 310 310 uint8_t vblank_alignment_max_frame_time_diff; 311 + bool is_asymmetric_memory; 312 + bool is_single_rank_dimm; 311 313 }; 312 314 313 315 enum visual_confirm {