Commit 3ebe7d16 authored by Jesse Barnes's avatar Jesse Barnes

libdrm: add support for page flip completion events

parent 8453af3d
......@@ -682,6 +682,12 @@ typedef struct _drmEventContext {
unsigned int tv_usec,
void *user_data);
void (*pageflip_handler)(int fd,
unsigned int sequence,
unsigned int tv_sec,
unsigned int tv_usec,
void *user_data);
} drmEventContext, *drmEventContextPtr;
extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
......
......@@ -700,7 +700,17 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
vblank->tv_usec,
U642VOID (vblank->user_data));
break;
case DRM_EVENT_FLIP_COMPLETE:
if (evctx->version < 1 ||
evctx->pageflip_handler == NULL)
break;
vblank = (struct drm_event_vblank *) e;
evctx->pageflip_handler(fd,
vblank->sequence,
vblank->tv_sec,
vblank->tv_usec,
U642VOID (vblank->user_data));
break;
default:
break;
}
......
......@@ -828,6 +828,7 @@ struct drm_event {
};
#define DRM_EVENT_VBLANK 0x01
#define DRM_EVENT_FLIP_COMPLETE 0x02
struct drm_event_vblank {
struct drm_event base;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment