summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-09-25 18:40:01 +0200
committerMichel Dänzer <michel@daenzer.net>2018-09-26 12:32:17 +0200
commit955373a3e69baa241a1f267e96d04ddb902f689f (patch)
treeedf0ca3cf5c7b3c3b5922ff4251195b3988feedb /src
parent0cd2c337d2c02b8ec2bd994d6124b4aaaad10741 (diff)
Make wait_pending_flip / handle_deferred symmetric in set_mode_major
We were always calling the latter, but not always the former, which could result in handling deferred DRM events prematurely. Acked-by: Slava Abramov <slava.abramov@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f1e8ce6..9917d9f 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1297,6 +1297,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ Bool handle_deferred = FALSE;
unsigned scanout_id = 0;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
int saved_x, saved_y;
@@ -1367,6 +1368,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
}
amdgpu_drm_wait_pending_flip(crtc);
+ handle_deferred = TRUE;
if (!drmmode_set_mode(crtc, fb, mode, x, y))
goto done;
@@ -1426,7 +1428,9 @@ done:
}
}
- amdgpu_drm_queue_handle_deferred(crtc);
+ if (handle_deferred)
+ amdgpu_drm_queue_handle_deferred(crtc);
+
return ret;
}