1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 Written 2012 by David Herrmann <dh.herrmann@googlemail.com>
7 Dedicated to the Public Domain
10 <refentry id="drmHandleEvent">
12 <title>Direct Rendering Manager</title>
13 <productname>libdrm</productname>
14 <date>September 2012</date>
17 <contrib>Developer</contrib>
18 <firstname>David</firstname>
19 <surname>Herrmann</surname>
20 <email>dh.herrmann@googlemail.com</email>
26 <refentrytitle>drmHandleEvent</refentrytitle>
27 <manvolnum>3</manvolnum>
31 <refname>drmHandleEvent</refname>
32 <refpurpose>read and process pending DRM events</refpurpose>
38 <funcsynopsisinfo>#include <xf86drm.h></funcsynopsisinfo>
41 <funcdef>int <function>drmHandleEvent</function></funcdef>
42 <paramdef>int <parameter>fd</parameter></paramdef>
43 <paramdef>drmEventContextPtr <parameter>evctx</parameter></paramdef>
50 <title>Description</title>
51 <para><function>drmHandleEvent</function> processes outstanding DRM events
52 on the DRM file-descriptor passed as <parameter>fd</parameter>. This
53 function should be called after the DRM file-descriptor has polled
54 readable; it will read the events and use the passed-in
55 <parameter>evctx</parameter> structure to call function pointers
56 with the parameters noted below:
59 typedef struct _drmEventContext {
61 void (*vblank_handler) (int fd,
62 unsigned int sequence,
66 void (*page_flip_handler) (int fd,
67 unsigned int sequence,
71 } drmEventContext, *drmEventContextPtr;
79 <title>Return Value</title>
80 <para><function>drmHandleEvent</function> returns <literal>0</literal> on
81 success, or if there is no data to read from the file-descriptor.
82 Returns <literal>-1</literal> if the read on the file-descriptor fails
83 or returns less than a full event record.</para>
87 <title>Reporting Bugs</title>
88 <para>Bugs in this function should be reported to
89 http://bugs.freedesktop.org under the "Mesa" product, with "Other"
90 as the component.</para>
94 <title>See Also</title>
96 <citerefentry><refentrytitle>drm</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
97 <citerefentry><refentrytitle>drm-kms</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>drmModePageFlip</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
99 <citerefentry><refentrytitle>drmWaitVBlank</refentrytitle><manvolnum>3</manvolnum></citerefentry>