Skip to content

Commit 474f010

Browse files
Wesley Chalmersalexdeucher
authored andcommitted
drm/amd/display: Do not set drr on pipe commit
[WHY] Writing to DRR registers such as OTG_V_TOTAL_MIN on the same frame as a pipe commit can cause underflow. [HOW] Move DMUB p-state delegate into optimze_bandwidth; enabling FAMS sets optimized_required. This change expects that Freesync requests are blocked when optimized_required is true. Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0c1f033 commit 474f010

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,12 @@ void dcn20_optimize_bandwidth(
21132113
if (hubbub->funcs->program_compbuf_size)
21142114
hubbub->funcs->program_compbuf_size(hubbub, context->bw_ctx.bw.dcn.compbuf_size_kb, true);
21152115

2116+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) {
2117+
dc_dmub_srv_p_state_delegate(dc,
2118+
true, context);
2119+
context->bw_ctx.bw.dcn.clk.p_state_change_support = true;
2120+
}
2121+
21162122
dc->clk_mgr->funcs->update_clocks(
21172123
dc->clk_mgr,
21182124
context,

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,11 +985,18 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,
985985
void dcn30_prepare_bandwidth(struct dc *dc,
986986
struct dc_state *context)
987987
{
988+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) {
989+
dc->optimized_required = true;
990+
context->bw_ctx.bw.dcn.clk.p_state_change_support = false;
991+
}
992+
988993
if (dc->clk_mgr->dc_mode_softmax_enabled)
989994
if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000 &&
990995
context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000)
991996
dc->clk_mgr->funcs->set_max_memclk(dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries - 1].memclk_mhz);
992997

993998
dcn20_prepare_bandwidth(dc, context);
999+
1000+
dc_dmub_srv_p_state_delegate(dc, false, context);
9941001
}
9951002

0 commit comments

Comments
 (0)