drmHandleEvent.3.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ==============
  2. drmHandleEvent
  3. ==============
  4. -----------------------------------
  5. read and process pending DRM events
  6. -----------------------------------
  7. :Date: September 2012
  8. :Manual section: 3
  9. :Manual group: Direct Rendering Manager
  10. Synopsis
  11. ========
  12. ``#include <xf86drm.h>``
  13. ``int drmHandleEvent(int fd, drmEventContextPtr evctx);``
  14. Description
  15. ===========
  16. ``drmHandleEvent`` processes outstanding DRM events on the DRM
  17. file-descriptor passed as ``fd``. This function should be called after
  18. the DRM file-descriptor has polled readable; it will read the events and
  19. use the passed-in ``evctx`` structure to call function pointers with the
  20. parameters noted below:
  21. ::
  22. typedef struct _drmEventContext {
  23. int version;
  24. void (*vblank_handler) (int fd,
  25. unsigned int sequence,
  26. unsigned int tv_sec,
  27. unsigned int tv_usec,
  28. void *user_data)
  29. void (*page_flip_handler) (int fd,
  30. unsigned int sequence,
  31. unsigned int tv_sec,
  32. unsigned int tv_usec,
  33. void *user_data)
  34. } drmEventContext, *drmEventContextPtr;
  35. Return Value
  36. ============
  37. ``drmHandleEvent`` returns 0 on success, or if there is no data to
  38. read from the file-descriptor. Returns -1 if the read on the
  39. file-descriptor fails or returns less than a full event record.
  40. Reporting Bugs
  41. ==============
  42. Bugs in this function should be reported to
  43. https://gitlab.freedesktop.org/mesa/libdrm/-/issues
  44. See Also
  45. ========
  46. **drm**\ (7), **drm-kms**\ (7), **drmModePageFlip**\ (3),
  47. **drmWaitVBlank**\ (3)