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