Skip to content

Commit f583db8

Browse files
Alvin Leealexdeucher
authored andcommitted
drm/amd/display: Update FAMS sequence for DCN30 & DCN32
Provide DCN32 specific sequence and update DCN30 sequence Reviewed-by: Samson Tam <samson.tam@amd.com> Acked-by: Roman Li <roman.li@amd.com> Signed-off-by: Alvin Lee <alvin.lee2@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 79f3f1b commit f583db8

4 files changed

Lines changed: 38 additions & 19 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = {
6060
.pipe_control_lock = dcn20_pipe_control_lock,
6161
.interdependent_update_lock = dcn10_lock_all_pipes,
6262
.cursor_lock = dcn10_cursor_lock,
63-
.prepare_bandwidth = dcn30_prepare_bandwidth,
63+
.prepare_bandwidth = dcn32_prepare_bandwidth,
6464
.optimize_bandwidth = dcn20_optimize_bandwidth,
6565
.update_bandwidth = dcn20_update_bandwidth,
6666
.set_drr = dcn10_set_drr,

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -993,11 +993,7 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,
993993
void dcn30_prepare_bandwidth(struct dc *dc,
994994
struct dc_state *context)
995995
{
996-
bool p_state_change_support = context->bw_ctx.bw.dcn.clk.p_state_change_support;
997-
/* Any transition into an FPO config should disable MCLK switching first to avoid
998-
* driver and FW P-State synchronization issues.
999-
*/
1000-
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) {
996+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && !dc->clk_mgr->clks.fw_based_mclk_switching) {
1001997
dc->optimized_required = true;
1002998
context->bw_ctx.bw.dcn.clk.p_state_change_support = false;
1003999
}
@@ -1008,20 +1004,9 @@ void dcn30_prepare_bandwidth(struct dc *dc,
10081004
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);
10091005

10101006
dcn20_prepare_bandwidth(dc, context);
1011-
/*
1012-
* enabled -> enabled: do not disable
1013-
* enabled -> disabled: disable
1014-
* disabled -> enabled: don't care
1015-
* disabled -> disabled: don't care
1016-
*/
1017-
if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching)
1018-
dc_dmub_srv_p_state_delegate(dc, false, context);
10191007

1020-
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) {
1021-
/* After disabling P-State, restore the original value to ensure we get the correct P-State
1022-
* on the next optimize. */
1023-
context->bw_ctx.bw.dcn.clk.p_state_change_support = p_state_change_support;
1024-
}
1008+
if (!dc->clk_mgr->clks.fw_based_mclk_switching)
1009+
dc_dmub_srv_p_state_delegate(dc, false, context);
10251010
}
10261011

10271012
void dcn30_set_static_screen_control(struct pipe_ctx **pipe_ctx,

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "dce/dmub_hw_lock_mgr.h"
5151
#include "dcn32/dcn32_resource.h"
5252
#include "link.h"
53+
#include "../dcn20/dcn20_hwseq.h"
5354

5455
#define DC_LOGGER_INIT(logger)
5556

@@ -1677,3 +1678,33 @@ bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,
16771678

16781679
return is_seamless;
16791680
}
1681+
1682+
void dcn32_prepare_bandwidth(struct dc *dc,
1683+
struct dc_state *context)
1684+
{
1685+
bool p_state_change_support = context->bw_ctx.bw.dcn.clk.p_state_change_support;
1686+
/* Any transition into an FPO config should disable MCLK switching first to avoid
1687+
* driver and FW P-State synchronization issues.
1688+
*/
1689+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) {
1690+
dc->optimized_required = true;
1691+
context->bw_ctx.bw.dcn.clk.p_state_change_support = false;
1692+
}
1693+
1694+
if (dc->clk_mgr->dc_mode_softmax_enabled)
1695+
if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000 &&
1696+
context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000)
1697+
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);
1698+
1699+
dcn20_prepare_bandwidth(dc, context);
1700+
1701+
if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching)
1702+
dc_dmub_srv_p_state_delegate(dc, false, context);
1703+
1704+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || dc->clk_mgr->clks.fw_based_mclk_switching) {
1705+
/* After disabling P-State, restore the original value to ensure we get the correct P-State
1706+
* on the next optimize.
1707+
*/
1708+
context->bw_ctx.bw.dcn.clk.p_state_change_support = p_state_change_support;
1709+
}
1710+
}

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,7 @@ bool dcn32_is_pipe_topology_transition_seamless(struct dc *dc,
124124
const struct dc_state *cur_ctx,
125125
const struct dc_state *new_ctx);
126126

127+
void dcn32_prepare_bandwidth(struct dc *dc,
128+
struct dc_state *context);
129+
127130
#endif /* __DC_HWSS_DCN32_H__ */

0 commit comments

Comments
 (0)