From e322b05799fcf6f83a2087e25f6198966c2ccde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 24 Aug 2016 22:52:11 +0900 Subject: [PATCH xf86-video-ati] Call drmmode_clear_pending_flip first in drmmode_flip_handler/abort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These functions may override the local crtc value of the last pending CRTC, in which case drmmode_clear_pending_flip would work on the wrong CRTC, and the last pending CRTC's flip_pending flag might never get cleared. Fixes: 9090309e057d ("Wait for pending flips to complete before turning off an output or CRTC") --- src/drmmode_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 14d86c7..de5e697 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2203,14 +2203,14 @@ drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data) { drmmode_flipdata_ptr flipdata = event_data; + drmmode_clear_pending_flip(crtc); + if (--flipdata->flip_count == 0) { if (flipdata->fe_crtc) crtc = flipdata->fe_crtc; flipdata->abort(crtc, flipdata->event_data); free(flipdata); } - - drmmode_clear_pending_flip(crtc); } static void @@ -2219,6 +2219,8 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even RADEONInfoPtr info = RADEONPTR(crtc->scrn); drmmode_flipdata_ptr flipdata = event_data; + drmmode_clear_pending_flip(crtc); + /* Is this the event whose info shall be delivered to higher level? */ if (crtc == flipdata->fe_crtc) { /* Yes: Cache msc, ust for later delivery. */ @@ -2238,8 +2240,6 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even free(flipdata); } - - drmmode_clear_pending_flip(crtc); } -- 2.9.3