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

drm/amd/display: Add missing WA and MCLK validation

When the commit fff7eb56b376 ("drm/amd/display: Don't set dram clock
change requirement for SubVP") was merged, we missed some parts
associated with the MCLK switch. This commit adds all the missing parts.

Fixes: fff7eb56b376 ("drm/amd/display: Don't set dram clock change requirement for SubVP")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rodrigo Siqueira and committed by
Alex Deucher
822b84ec ce560ac4

+19 -2
+1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
··· 948 948 if (dc->ctx->dmub_srv) { 949 949 dc_dmub_srv_query_caps_cmd(dc->ctx->dmub_srv->dmub); 950 950 dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; 951 + dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch; 951 952 } 952 953 } 953 954
+1 -1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
··· 2023 2023 // In general cases we want to keep the dram clock change requirement 2024 2024 // (prefer configs that support MCLK switch). Only override to false 2025 2025 // for SubVP 2026 - if (subvp_in_use) 2026 + if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || subvp_in_use) 2027 2027 context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false; 2028 2028 else 2029 2029 context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;
+17 -1
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c
··· 368 368 dc_assert_fp_enabled(); 369 369 370 370 if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].valid) { 371 - context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; 371 + if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || 372 + context->bw_ctx.dml.soc.dram_clock_change_latency_us == 0) 373 + context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; 372 374 context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_enter_plus_exit_time_us; 373 375 context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_exit_time_us; 374 376 } ··· 563 561 pipes[pipe_idx].clks_cfg.dppclk_mhz = dc->debug.min_dpp_clk_khz / 1000.0; 564 562 565 563 pipe_idx++; 564 + } 565 + 566 + // WA: restrict FPO to use first non-strobe mode (NV24 BW issue) 567 + if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && 568 + dc->dml.soc.num_chans <= 4 && 569 + context->bw_ctx.dml.vba.DRAMSpeed <= 1700 && 570 + context->bw_ctx.dml.vba.DRAMSpeed >= 1500) { 571 + 572 + for (i = 0; i < dc->dml.soc.num_states; i++) { 573 + if (dc->dml.soc.clock_limits[i].dram_speed_mts > 1700) { 574 + context->bw_ctx.dml.vba.DRAMSpeed = dc->dml.soc.clock_limits[i].dram_speed_mts; 575 + break; 576 + } 577 + } 566 578 } 567 579 568 580 dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);