mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
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: 739181c8d3 "Add amdgpu_drm_handle_event wrapper for
drmHandleEvent"
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Tested-by: Aaron Liu <aaron.liu@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
a636f42b49
commit
09be74a3d1
@@ -884,12 +884,18 @@ CARD32 amdgpu_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(pAMDGPUEnt->fd, 0, 0, 0,
|
||||
(void*)event_info->drm_queue_seq);
|
||||
else
|
||||
drmmode_crtc->wait_flip_nesting_level++;
|
||||
amdgpu_drm_queue_handle_deferred(crtc);
|
||||
|
||||
} else {
|
||||
amdgpu_dri2_frame_event_handler(crtc, 0, 0, data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
@@ -900,13 +906,18 @@ CARD32 amdgpu_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(pAMDGPUEnt->fd, frame, drm_now / 1000000,
|
||||
drm_now % 1000000,
|
||||
(void*)event_info->drm_queue_seq);
|
||||
else
|
||||
drmmode_crtc->wait_flip_nesting_level++;
|
||||
amdgpu_drm_queue_handle_deferred(crtc);
|
||||
} else {
|
||||
amdgpu_dri2_frame_event_handler(crtc, frame, drm_now, data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user