diff options
author | Angus Wang <Angus.Wang@amd.com> | 2022-03-22 15:37:15 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-04-05 10:29:47 -0400 |
commit | 3fe5739db488434bc0368577615ea7275b0f43a5 (patch) | |
tree | 84297b3b7c63817f3a0463c61afb7f815748082a /drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h | |
parent | 35b2186b13b66075035fa008e9390d14b331e1b3 (diff) | |
download | linux-stable-3fe5739db488434bc0368577615ea7275b0f43a5.tar.gz linux-stable-3fe5739db488434bc0368577615ea7275b0f43a5.tar.bz2 linux-stable-3fe5739db488434bc0368577615ea7275b0f43a5.zip |
drm/amd/display: Add flip interval workaround
[WHY]
Some games experience low FPS issues when FreeSync is on and VSync is
toggled to half refresh rate.
[HOW]
First create a function to determine workaround conditions, which is
when we detect 2 or more VSync interrupts between flips and a very short
VSync to flip interval. We do the workaround during VSync interrupts and
set the v_total_max and min to nominal. We also cleanup after we exit
the game.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Angus Wang <Angus.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h index 75a158a2514c..cf6bc9446244 100644 --- a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +++ b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h @@ -105,6 +105,16 @@ struct mod_vrr_params_fixed_refresh { uint32_t frame_counter; }; +struct mod_vrr_params_flip_interval { + bool flip_interval_workaround_active; + bool program_flip_interval_workaround; + bool do_flip_interval_workaround_cleanup; + uint32_t flip_interval_detect_counter; + uint32_t vsyncs_between_flip; + uint32_t vsync_to_flip_in_us; + uint32_t v_update_timestamp_in_us; +}; + struct mod_vrr_params { bool supported; bool send_info_frame; @@ -121,6 +131,8 @@ struct mod_vrr_params { struct mod_vrr_params_fixed_refresh fixed; struct mod_vrr_params_btr btr; + + struct mod_vrr_params_flip_interval flip_interval; }; struct mod_freesync *mod_freesync_create(struct dc *dc); |