Skip to content

Commit 9c82354

Browse files
Hugo Hualexdeucher
authored andcommitted
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: b8720ed ("drm/amd/display: System black screen hangs on driver load") Signed-off-by: Hugo Hu <[email protected]> Reviewed-by: Sung Lee <[email protected]> Acked-by: Aurabindo Pillai <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8a20c97 commit 9c82354

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,43 @@ static struct wm_table ddr4_wm_table_rn = {
769769
}
770770
};
771771

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+
772809
static struct wm_table lpddr4_wm_table_rn = {
773810
.entries = {
774811
{
@@ -953,8 +990,12 @@ void rn_clk_mgr_construct(
953990
} else {
954991
if (is_green_sardine)
955992
rn_bw_params.wm_table = ddr4_wm_table_gs;
956-
else
957-
rn_bw_params.wm_table = ddr4_wm_table_rn;
993+
else {
994+
if (ctx->dc->config.is_single_rank_dimm)
995+
rn_bw_params.wm_table = ddr4_1R_wm_table_rn;
996+
else
997+
rn_bw_params.wm_table = ddr4_wm_table_rn;
998+
}
958999
}
9591000
/* Saved clocks configured at boot for debug purposes */
9601001
rn_dump_clk_registers(&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info);
@@ -972,6 +1013,9 @@ void rn_clk_mgr_construct(
9721013
if (status == PP_SMU_RESULT_OK &&
9731014
ctx->dc_bios && ctx->dc_bios->integrated_info) {
9741015
rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info);
1016+
/* treat memory config as single channel if memory is asymmetrics. */
1017+
if (ctx->dc->config.is_asymmetric_memory)
1018+
clk_mgr->base.bw_params->num_channels = 1;
9751019
}
9761020
}
9771021

drivers/gpu/drm/amd/display/dc/dc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ struct dc_config {
308308
#endif
309309
uint64_t vblank_alignment_dto_params;
310310
uint8_t vblank_alignment_max_frame_time_diff;
311+
bool is_asymmetric_memory;
312+
bool is_single_rank_dimm;
311313
};
312314

313315
enum visual_confirm {

0 commit comments

Comments
 (0)