summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h1
-rw-r--r--src/amdgpu_kms.c7
-rw-r--r--src/amdgpu_present.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 7b3bace..0ae171f 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -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 */
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index e50c6d1..458d2d0 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -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 */
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 5a4b9c0..2fbcd25 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -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);