Skip to content

Commit 20ea30a

Browse files
Ryan Setoalexdeucher
authored andcommitted
drm/amd/display: Toggle for Disable Force Pstate Allow on Disable
[Why & How] In theory, driver should be able to support disabling force pstate allow after hardware release however this behavior is not tested yet. Introducing a new toggle to disable the force on the fly. Reviewed-by: Dillon Varone <[email protected]> Signed-off-by: Ryan Seto <[email protected]> Signed-off-by: Roman Li <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e63e9f8 commit 20ea30a

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ struct dc_debug_options {
10731073
unsigned int force_mall_ss_num_ways;
10741074
bool alloc_extra_way_for_cursor;
10751075
uint32_t subvp_extra_lines;
1076+
bool disable_force_pstate_allow_on_hw_release;
10761077
bool force_usr_allow;
10771078
/* uses value at boot and disables switch */
10781079
bool disable_dtb_ref_clk_switch;

drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,20 +1621,28 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx,
16211621

16221622
void dcn401_hardware_release(struct dc *dc)
16231623
{
1624-
dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
1625-
1626-
/* If pstate unsupported, or still supported
1627-
* by firmware, force it supported by dcn
1628-
*/
1629-
if (dc->current_state) {
1630-
if ((!dc->clk_mgr->clks.p_state_change_support ||
1631-
dc->current_state->bw_ctx.bw.dcn.fams2_global_config.features.bits.enable) &&
1632-
dc->res_pool->hubbub->funcs->force_pstate_change_control)
1633-
dc->res_pool->hubbub->funcs->force_pstate_change_control(
1634-
dc->res_pool->hubbub, true, true);
1635-
1636-
dc->current_state->bw_ctx.bw.dcn.clk.p_state_change_support = true;
1637-
dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
1624+
if (!dc->debug.disable_force_pstate_allow_on_hw_release) {
1625+
dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
1626+
1627+
/* If pstate unsupported, or still supported
1628+
* by firmware, force it supported by dcn
1629+
*/
1630+
if (dc->current_state) {
1631+
if ((!dc->clk_mgr->clks.p_state_change_support ||
1632+
dc->current_state->bw_ctx.bw.dcn.fams2_global_config.features.bits.enable) &&
1633+
dc->res_pool->hubbub->funcs->force_pstate_change_control)
1634+
dc->res_pool->hubbub->funcs->force_pstate_change_control(
1635+
dc->res_pool->hubbub, true, true);
1636+
1637+
dc->current_state->bw_ctx.bw.dcn.clk.p_state_change_support = true;
1638+
dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
1639+
}
1640+
} else {
1641+
if (dc->current_state) {
1642+
dc->clk_mgr->clks.p_state_change_support = false;
1643+
dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
1644+
}
1645+
dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
16381646
}
16391647
}
16401648

drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ static const struct dc_debug_options debug_defaults_drv = {
708708
},
709709
.use_max_lb = true,
710710
.force_disable_subvp = false,
711+
.disable_force_pstate_allow_on_hw_release = false,
711712
.exit_idle_opt_for_cursor_updates = true,
712713
.using_dml2 = true,
713714
.using_dml21 = true,

0 commit comments

Comments
 (0)