b98f417d6fdbec136e1df21371a0e88592e26451
[profile/ivi/libdrm.git] / man / drmHandleEvent.man
1 .\" shorthand for double quote that works everywhere.
2 .ds q \N'34'
3 .TH drmHandleEvent  __drivermansuffix__ __vendorversion__
4 .SH NAME
5 drmHandleEvent \- read and process pending DRM events
6 .SH SYNOPSIS
7 .nf
8 .B "#include <xf86drm.h>"
9
10 .B "typedef struct _drmEventContext {"
11 .BI "   int version;"
12 .BI "   void (*vblank_handler)(int fd,"
13 .BI "                          unsigned int sequence,"
14 .BI "                          unsigned int tv_sec,"
15 .BI "                          unsigned int tv_usec,"
16 .BI "                          void *user_data);"
17 .BI "   void (*page_flip_handler)(int fd,"
18 .BI "                             unsigned int sequence,"
19 .BI "                             unsigned int tv_sec,"
20 .BI "                             unsigned int tv_usec,"
21 .BI "                             void *user_data);"
22 .B "} drmEventContext, *drmEventContextPtr;"
23
24 .B "int drmHandleEvent(int fd, drmEventContextPtr evctx);"
25 .fi
26 .SH DESCRIPTION
27 This function will process outstanding DRM events on
28 .I fd
29 , which must be an open DRM device.  This function should be called after
30 the DRM file descriptor has polled readable; it will read the events and
31 use the passed-in
32 .I evctx
33 structure to call function pointers with the parameters noted above.
34
35 .SH RETURN VALUE
36 Returns 0 on success, or if there is no data to read from the file descriptor.
37 Returns -1 if the read on the file descriptor fails or returns less than a
38 full event record.
39
40 .SH REPORTING BUGS
41 Bugs in this function should be reported to http://bugs.freedesktop.org under
42 the "Mesa" product, with "Other" or "libdrm" as the component.
43
44 .SH "SEE ALSO"
45 drmModePageFlip(__libmansuffix__), drmWaitVBlank(__libmansuffix__)