]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Toggle for Disable Force Pstate Allow on Disable
authorRyan Seto <ryanseto@amd.com>
Thu, 24 Jul 2025 18:57:52 +0000 (14:57 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Aug 2025 18:40:29 +0000 (14:40 -0400)
[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 <dillon.varone@amd.com>
Signed-off-by: Ryan Seto <ryanseto@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c

index c013b28207a1b601d8f8dfa2803958c16ec49816..a83227f6bb142fa4c45a2583e6207adcbbb08feb 100644 (file)
@@ -1073,6 +1073,7 @@ struct dc_debug_options {
        unsigned int force_mall_ss_num_ways;
        bool alloc_extra_way_for_cursor;
        uint32_t subvp_extra_lines;
+       bool disable_force_pstate_allow_on_hw_release;
        bool force_usr_allow;
        /* uses value at boot and disables switch */
        bool disable_dtb_ref_clk_switch;
index fb949aeb124431e1acbcc3a0f99eaea4612dedf2..d5b5e2ce6ff63738bc157d0ca0c3207b19fe4aeb 100644 (file)
@@ -1621,20 +1621,28 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx,
 
 void dcn401_hardware_release(struct dc *dc)
 {
-       dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
-
-       /* If pstate unsupported, or still supported
-        * by firmware, force it supported by dcn
-        */
-       if (dc->current_state) {
-               if ((!dc->clk_mgr->clks.p_state_change_support ||
-                               dc->current_state->bw_ctx.bw.dcn.fams2_global_config.features.bits.enable) &&
-                               dc->res_pool->hubbub->funcs->force_pstate_change_control)
-                       dc->res_pool->hubbub->funcs->force_pstate_change_control(
-                                       dc->res_pool->hubbub, true, true);
-
-               dc->current_state->bw_ctx.bw.dcn.clk.p_state_change_support = true;
-               dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
+       if (!dc->debug.disable_force_pstate_allow_on_hw_release) {
+               dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
+
+               /* If pstate unsupported, or still supported
+               * by firmware, force it supported by dcn
+               */
+               if (dc->current_state) {
+                       if ((!dc->clk_mgr->clks.p_state_change_support ||
+                                       dc->current_state->bw_ctx.bw.dcn.fams2_global_config.features.bits.enable) &&
+                                       dc->res_pool->hubbub->funcs->force_pstate_change_control)
+                               dc->res_pool->hubbub->funcs->force_pstate_change_control(
+                                               dc->res_pool->hubbub, true, true);
+
+                       dc->current_state->bw_ctx.bw.dcn.clk.p_state_change_support = true;
+                       dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
+               }
+       } else {
+               if (dc->current_state) {
+                       dc->clk_mgr->clks.p_state_change_support = false;
+                       dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
+               }
+               dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
        }
 }
 
index b3988e38d0a6328a76e5416cb207e3ccddbd6677..068c123ea8a8abc062abf3874220d14f517b7250 100644 (file)
@@ -708,6 +708,7 @@ static const struct dc_debug_options debug_defaults_drv = {
        },
        .use_max_lb = true,
        .force_disable_subvp = false,
+       .disable_force_pstate_allow_on_hw_release = false,
        .exit_idle_opt_for_cursor_updates = true,
        .using_dml2 = true,
        .using_dml21 = true,