drm/amd/display: Create debugging mechanism for Gaming FAMS
authorGianna Binder <gianna.binder@amd.com>
Sat, 17 Jun 2023 21:17:40 +0000 (17:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Jun 2023 17:12:16 +0000 (13:12 -0400)
[WHY]
To enable FAMS even during gaming sessions.

[HOW]
By leveraging a new dc.debug parameter.

Reviewed-by: Felipe Clark <felipe.clark@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Gianna Binder <gianna.binder@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/dcn30/dcn30_resource.c
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c

index 90e71c3..110ef14 100644 (file)
@@ -850,6 +850,7 @@ struct dc_debug_options {
        /* Enable dmub aux for legacy ddc */
        bool enable_dmub_aux_for_legacy_ddc;
        bool disable_fams;
+       bool disable_fams_gaming;
        /* FEC/PSR1 sequence enable delay in 100us */
        uint8_t fec_enable_delay_in100us;
        bool enable_driver_sequence_debug;
index a8cb066..abe4c12 100644 (file)
@@ -1987,11 +1987,10 @@ bool dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch(struct dc *dc,
        if (!is_refresh_rate_support_mclk_switch_using_fw_based_vblank_stretch(context))
                return false;
 
-       // check if freesync enabled
        if (!context->streams[0]->allow_freesync)
                return false;
 
-       if (context->streams[0]->vrr_active_variable)
+       if (context->streams[0]->vrr_active_variable && dc->debug.disable_fams_gaming)
                return false;
 
        context->streams[0]->fpo_in_use = true;
index a9c41ef..5be242a 100644 (file)
@@ -595,11 +595,10 @@ struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_stre
        if (!is_refresh_rate_support_mclk_switch_using_fw_based_vblank_stretch(fpo_candidate_stream, fpo_vactive_margin_us))
                return NULL;
 
-       // check if freesync enabled
        if (!fpo_candidate_stream->allow_freesync)
                return NULL;
 
-       if (fpo_candidate_stream->vrr_active_variable)
+       if (fpo_candidate_stream->vrr_active_variable && dc->debug.disable_fams_gaming)
                return NULL;
 
        return fpo_candidate_stream;