mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
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:
committed by
Michel Dänzer
parent
d9be5d712d
commit
bd090f389f
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user