Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vmwgfx_fence.h
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright © 2011 VMware, Inc., Palo Alto, CA., USA
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sub license, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial portions
16  * of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21  * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24  * USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  **************************************************************************/
27 
28 #ifndef _VMWGFX_FENCE_H_
29 
30 #define VMW_FENCE_WAIT_TIMEOUT (5*HZ)
31 
32 struct vmw_private;
33 
34 struct vmw_fence_manager;
35 
43 };
44 
46  struct list_head head;
50 };
51 
52 struct vmw_fence_obj {
53  struct kref kref;
55 
57  struct list_head head;
61  void (*destroy)(struct vmw_fence_obj *fence);
63 };
64 
65 extern struct vmw_fence_manager *
67 
68 extern void vmw_fence_manager_takedown(struct vmw_fence_manager *fman);
69 
70 extern void vmw_fence_obj_unreference(struct vmw_fence_obj **fence_p);
71 
72 extern struct vmw_fence_obj *
74 
75 extern void vmw_fences_update(struct vmw_fence_manager *fman);
76 
77 extern bool vmw_fence_obj_signaled(struct vmw_fence_obj *fence,
78  uint32_t flags);
79 
80 extern int vmw_fence_obj_wait(struct vmw_fence_obj *fence, uint32_t flags,
81  bool lazy,
82  bool interruptible, unsigned long timeout);
83 
84 extern void vmw_fence_obj_flush(struct vmw_fence_obj *fence);
85 
86 extern int vmw_fence_create(struct vmw_fence_manager *fman,
88  uint32_t mask,
89  struct vmw_fence_obj **p_fence);
90 
91 extern int vmw_user_fence_create(struct drm_file *file_priv,
92  struct vmw_fence_manager *fman,
94  uint32_t mask,
95  struct vmw_fence_obj **p_fence,
96  uint32_t *p_handle);
97 
98 extern void vmw_fence_fifo_up(struct vmw_fence_manager *fman);
99 
100 extern void vmw_fence_fifo_down(struct vmw_fence_manager *fman);
101 
102 extern int vmw_fence_obj_wait_ioctl(struct drm_device *dev, void *data,
103  struct drm_file *file_priv);
104 
105 extern int vmw_fence_obj_signaled_ioctl(struct drm_device *dev, void *data,
106  struct drm_file *file_priv);
107 
108 extern int vmw_fence_obj_unref_ioctl(struct drm_device *dev, void *data,
109  struct drm_file *file_priv);
110 extern int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
111  struct drm_file *file_priv);
113  struct list_head *event_list);
114 extern int vmw_event_fence_action_queue(struct drm_file *filee_priv,
115  struct vmw_fence_obj *fence,
116  struct drm_pending_event *event,
117  uint32_t *tv_sec,
118  uint32_t *tv_usec,
119  bool interruptible);
120 #endif /* _VMWGFX_FENCE_H_ */