drm/amd/display: Add flip interval workaround
authorAngus Wang <Angus.Wang@amd.com>
Tue, 22 Mar 2022 19:37:15 +0000 (15:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Apr 2022 14:29:47 +0000 (10:29 -0400)
commit3fe5739db488434bc0368577615ea7275b0f43a5
tree84297b3b7c63817f3a0463c61afb7f815748082a
parent35b2186b13b66075035fa008e9390d14b331e1b3
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>
drivers/gpu/drm/amd/display/modules/freesync/freesync.c
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h