summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2019-03-01 18:28:11 +0100
committerMichel Dänzer <michel@daenzer.net>2019-03-04 17:07:14 +0100
commitc301b8af25d2c2cd49035a4395ebe6c3612df366 (patch)
tree51fa445623b06429d20255b74abc7622bae76ec1
parent705020b6247eaa062edc9c88e6ad52f8c5468051 (diff)
dri2: Call drm_queue_handle_deferred in dri2_deferred_event
drm_queue_handler just puts the event on the signalled list; without calling drm_queue_handle_deferred, actual processing of the event may be delayed indefinitely, e.g. until another event arrives from the kernel. This could result in DRI2 clients hanging during DPMS off. Fixes: ba83a866af5a "Add radeon_drm_handle_event wrapper for drmHandleEvent" (Ported from amdgpu commit 09be74a3d1dd9604336d9a27f98d132b262dcbaf) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_dri2.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index b5d6835c..a9f14e8d 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -979,12 +979,18 @@ CARD32 radeon_dri2_deferred_event(OsTimerPtr timer, CARD32 now, pointer data)
if (ret) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"%s cannot get current time\n", __func__);
- if (event_info->drm_queue_seq)
+
+ if (event_info->drm_queue_seq) {
drmmode_crtc->drmmode->event_context.
vblank_handler(pRADEONEnt->fd, 0, 0, 0,
(void*)event_info->drm_queue_seq);
- else
+ drmmode_crtc->wait_flip_nesting_level++;
+ radeon_drm_queue_handle_deferred(crtc);
+
+ } else {
radeon_dri2_frame_event_handler(crtc, 0, 0, data);
+ }
+
return 0;
}
/*
@@ -995,13 +1001,18 @@ CARD32 radeon_dri2_deferred_event(OsTimerPtr timer, CARD32 now, pointer data)
delta_seq = delta_t * drmmode_crtc->dpms_last_fps;
delta_seq /= 1000000;
frame = (CARD64)drmmode_crtc->dpms_last_seq + delta_seq;
- if (event_info->drm_queue_seq)
+
+ if (event_info->drm_queue_seq) {
drmmode_crtc->drmmode->event_context.
vblank_handler(pRADEONEnt->fd, frame, drm_now / 1000000,
drm_now % 1000000,
(void*)event_info->drm_queue_seq);
- else
+ drmmode_crtc->wait_flip_nesting_level++;
+ radeon_drm_queue_handle_deferred(crtc);
+ } else {
radeon_dri2_frame_event_handler(crtc, frame, drm_now, data);
+ }
+
return 0;
}