Instead of processing DRM events directly from drmHandleEvent's callbacks, there are three phases:
1. drmHandleEvent is called, and signalled events are re-queued to _signalled lists from its callbacks. 2. Signalled page flip completion events are processed. 3. Signalled vblank events are processed.
This should make sure that we never call drmHandleEvent from one of its callbacks, which would usually result in blocking forever.
(Ported from amdgpu commit 739181c8d3334ff14b5a607895dfdeb29b0d9020)
ba83a866 Add radeon_drm_handle_event wrapper for drmHandleEvent
src/drmmode_display.c | 13 +++---
src/radeon_drm_queue.c | 110 ++++++++++++++++++++++++++++++++++++++-----------
src/radeon_drm_queue.h | 1 +
src/radeon_present.c | 2 +-
4 files changed, 96 insertions(+), 30 deletions(-)