aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-09-11 14:33:34 -0400
committerDave Airlie <airlied@redhat.com>2009-10-25 23:29:27 -0400
commitc182be37ed7cb04c344501b88b8fdb747016e6cf (patch)
tree013ae7e4c5bb512ac8e4132a642f40c27f03390e /include/drm/drmP.h
parent0a5c1e61dbaceb6ce56281a3128a6912b0dcd043 (diff)
drm: Add async event synchronization for drmWaitVblank
This patch adds a new flag to the drmWaitVblank ioctl, which asks the drm to return immediately and notify userspace when the specified vblank sequence happens by sending an event back on the drm fd. The event mechanism works with the other flags supported by the ioctls, specifically, the vblank sequence can be specified relatively or absolutely, and works for primary and seconday crtc. The signal field of the vblank request is used to provide user data, which will be sent back to user space in the vblank event. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index eeefb6369e19..fe52254df60c 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -426,6 +426,14 @@ struct drm_buf_entry {
426 struct drm_freelist freelist; 426 struct drm_freelist freelist;
427}; 427};
428 428
429/* Event queued up for userspace to read */
430struct drm_pending_event {
431 struct drm_event *event;
432 struct list_head link;
433 struct drm_file *file_priv;
434 void (*destroy)(struct drm_pending_event *event);
435};
436
429/** File private data */ 437/** File private data */
430struct drm_file { 438struct drm_file {
431 int authenticated; 439 int authenticated;
@@ -449,6 +457,10 @@ struct drm_file {
449 struct drm_master *master; /* master this node is currently associated with 457 struct drm_master *master; /* master this node is currently associated with
450 N.B. not always minor->master */ 458 N.B. not always minor->master */
451 struct list_head fbs; 459 struct list_head fbs;
460
461 wait_queue_head_t event_wait;
462 struct list_head event_list;
463 int event_space;
452}; 464};
453 465
454/** Wait queue */ 466/** Wait queue */
@@ -897,6 +909,12 @@ struct drm_minor {
897 struct drm_mode_group mode_group; 909 struct drm_mode_group mode_group;
898}; 910};
899 911
912struct drm_pending_vblank_event {
913 struct drm_pending_event base;
914 int pipe;
915 struct drm_event_vblank event;
916};
917
900/** 918/**
901 * DRM device structure. This structure represent a complete card that 919 * DRM device structure. This structure represent a complete card that
902 * may contain multiple heads. 920 * may contain multiple heads.
@@ -996,6 +1014,12 @@ struct drm_device {
996 1014
997 u32 max_vblank_count; /**< size of vblank counter register */ 1015 u32 max_vblank_count; /**< size of vblank counter register */
998 1016
1017 /**
1018 * List of events
1019 */
1020 struct list_head vblank_event_list;
1021 spinlock_t event_lock;
1022
999 /*@} */ 1023 /*@} */
1000 cycles_t ctx_start; 1024 cycles_t ctx_start;
1001 cycles_t lck_start; 1025 cycles_t lck_start;
@@ -1132,6 +1156,8 @@ extern int drm_lastclose(struct drm_device *dev);
1132extern int drm_open(struct inode *inode, struct file *filp); 1156extern int drm_open(struct inode *inode, struct file *filp);
1133extern int drm_stub_open(struct inode *inode, struct file *filp); 1157extern int drm_stub_open(struct inode *inode, struct file *filp);
1134extern int drm_fasync(int fd, struct file *filp, int on); 1158extern int drm_fasync(int fd, struct file *filp, int on);
1159extern ssize_t drm_read(struct file *filp, char __user *buffer,
1160 size_t count, loff_t *offset);
1135extern int drm_release(struct inode *inode, struct file *filp); 1161extern int drm_release(struct inode *inode, struct file *filp);
1136 1162
1137 /* Mapping support (drm_vm.h) */ 1163 /* Mapping support (drm_vm.h) */