]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Guard FAMS2 configuration updates
authorDillon Varone <Dillon.Varone@amd.com>
Tue, 18 Nov 2025 20:58:23 +0000 (20:58 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:41 +0000 (13:56 -0500)
[WHY&HOW]
If DMCUB is not initialized or FAMS2 is not supported, the
interface should not be called.

Reviewed-by: Sridevi Arvindekar <sridevi.arvindekar@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c

index 163b5869d7f78c0f4b3726d2116cd61845b4831c..a78dab94931664c450026028f0eec5849b8afdb8 100644 (file)
@@ -1772,7 +1772,8 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx,
 void dcn401_hardware_release(struct dc *dc)
 {
        if (!dc->debug.disable_force_pstate_allow_on_hw_release) {
-               dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
+               if (dc->ctx->dmub_srv && dc->debug.fams2_config.bits.enable)
+                       dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
 
                /* If pstate unsupported, or still supported
                * by firmware, force it supported by dcn
@@ -1792,7 +1793,9 @@ void dcn401_hardware_release(struct dc *dc)
                        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);
+
+               if (dc->ctx->dmub_srv && dc->debug.fams2_config.bits.enable)
+                       dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
        }
 }