Call amdgpu_present_set_screen_vrr from amdgpu_vrr_property_update

If the window is currently flipping.

This might make a difference when the property gets disabled: Variable
refresh will now be disabled immediately in that case, instead of only
when the window can no longer use page flipping at all.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
This commit is contained in:
Michel Dänzer
2019-02-12 17:57:17 +01:00
committed by Michel Dänzer
parent d9be5d712d
commit bd090f389f
3 changed files with 9 additions and 1 deletions

View File

@@ -361,6 +361,7 @@ void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
);
/* amdgpu_present.c */
void amdgpu_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled);
Bool amdgpu_present_screen_init(ScreenPtr screen);
/* amdgpu_sync.c */

View File

@@ -102,7 +102,14 @@ static inline struct amdgpu_window_priv *get_window_priv(WindowPtr win) {
static void
amdgpu_vrr_property_update(WindowPtr window, Bool variable_refresh)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(window->drawable.pScreen);
AMDGPUInfoPtr info = AMDGPUPTR(scrn);
get_window_priv(window)->variable_refresh = variable_refresh;
if (info->flip_window == window &&
info->drmmode.present_flipping)
amdgpu_present_set_screen_vrr(scrn, variable_refresh);
}
/* Wrapper for xserver/dix/property.c:ProcChangeProperty */

View File

@@ -90,7 +90,7 @@ amdgpu_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc)
/*
* Changes the variable refresh state for every CRTC on the screen.
*/
static void
void
amdgpu_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);