| 1 |
============== |
| 2 |
drmHandleEvent |
| 3 |
============== |
| 4 |
|
| 5 |
----------------------------------- |
| 6 |
read and process pending DRM events |
| 7 |
----------------------------------- |
| 8 |
|
| 9 |
:Date: September 2012 |
| 10 |
:Manual section: 3 |
| 11 |
:Manual group: Direct Rendering Manager |
| 12 |
|
| 13 |
Synopsis |
| 14 |
======== |
| 15 |
|
| 16 |
``#include <xf86drm.h>`` |
| 17 |
|
| 18 |
``int drmHandleEvent(int fd, drmEventContextPtr evctx);`` |
| 19 |
|
| 20 |
Description |
| 21 |
=========== |
| 22 |
|
| 23 |
``drmHandleEvent`` processes outstanding DRM events on the DRM |
| 24 |
file-descriptor passed as ``fd``. This function should be called after |
| 25 |
the DRM file-descriptor has polled readable; it will read the events and |
| 26 |
use the passed-in ``evctx`` structure to call function pointers with the |
| 27 |
parameters 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 |
|
| 45 |
Return Value |
| 46 |
============ |
| 47 |
|
| 48 |
``drmHandleEvent`` returns 0 on success, or if there is no data to |
| 49 |
read from the file-descriptor. Returns -1 if the read on the |
| 50 |
file-descriptor fails or returns less than a full event record. |
| 51 |
|
| 52 |
Reporting Bugs |
| 53 |
============== |
| 54 |
|
| 55 |
Bugs in this function should be reported to |
| 56 |
https://gitlab.freedesktop.org/mesa/libdrm/-/issues |
| 57 |
|
| 58 |
See Also |
| 59 |
======== |
| 60 |
|
| 61 |
**drm**\ (7), **drm-kms**\ (7), **drmModePageFlip**\ (3), |
| 62 |
**drmWaitVBlank**\ (3) |