summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-11-20 12:16:56 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-20 12:16:56 -0800
commit3ebe7d1656cc9dbf7ac889bac227107acacc6f4a (patch)
treedb216ccbb1a7eecd4a5d4f7810f435bf2c4be355
parent8453af3d87a807887fbbc39f13231d4fee9387e7 (diff)
libdrm: add support for page flip completion eventspageflip
-rw-r--r--libdrm/xf86drm.h6
-rw-r--r--libdrm/xf86drmMode.c12
-rw-r--r--shared-core/drm.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/libdrm/xf86drm.h b/libdrm/xf86drm.h
index 2cb9c9e9..d75ec4f3 100644
--- a/libdrm/xf86drm.h
+++ b/libdrm/xf86drm.h
@@ -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);
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 400ad49d..7d318eaa 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -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;
}
diff --git a/shared-core/drm.h b/shared-core/drm.h
index f820e458..c381874f 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -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;