summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-08-24 22:52:11 +0900
committerMichel Dänzer <michel@daenzer.net>2016-08-26 11:32:56 +0900
commita36fdaff40d5b4795a1400c348a80eee94892212 (patch)
tree277d3a29844617f1d225826cf7dd94474f1585d7 /src
parente520ce0ec0adf91ddce5c932d4b3f9477fd49304 (diff)
Don't override crtc parameter value in drmmode_flip_handler/abort
When overriding the crtc parameter value of the last pending CRTC, drmmode_clear_pending_flip would work on the wrong CRTC, and the last pending CRTC's flip_pending flag might never get cleared. This would prevent that CRTC from properly turning off and back on again. Fixes: 9090309e057d ("Wait for pending flips to complete before turning off an output or CRTC") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97392 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 96a3c3b8..cb228da0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2204,9 +2204,9 @@ drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data)
drmmode_flipdata_ptr flipdata = event_data;
if (--flipdata->flip_count == 0) {
- if (flipdata->fe_crtc)
- crtc = flipdata->fe_crtc;
- flipdata->abort(crtc, flipdata->event_data);
+ if (!flipdata->fe_crtc)
+ flipdata->fe_crtc = crtc;
+ flipdata->abort(flipdata->fe_crtc, flipdata->event_data);
free(flipdata);
}
@@ -2227,11 +2227,14 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even
}
if (--flipdata->flip_count == 0) {
- /* Deliver cached msc, ust from reference crtc to flip event handler */
+ /* Deliver MSC & UST from reference/current CRTC to flip event
+ * handler
+ */
if (flipdata->fe_crtc)
- crtc = flipdata->fe_crtc;
- flipdata->handler(crtc, flipdata->fe_frame, flipdata->fe_usec,
- flipdata->event_data);
+ flipdata->handler(flipdata->fe_crtc, flipdata->fe_frame,
+ flipdata->fe_usec, flipdata->event_data);
+ else
+ flipdata->handler(crtc, frame, usec, flipdata->event_data);
/* Release framebuffer */
drmModeRmFB(info->drmmode.fd, flipdata->old_fb_id);