vmwgfx: Break out and comment vmw_execbuf_copy_fence_user
[deliverable/linux.git] / drivers / gpu / drm / vmwgfx / vmwgfx_fence.h
CommitLineData
ae2a1040
TH
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
32struct vmw_private;
33
34struct vmw_fence_manager;
35
36/**
37 *
38 *
39 */
40struct vmw_fence_action {
41 struct list_head head;
42 void (*seq_passed) (struct vmw_fence_action *action);
43 void (*cleanup) (struct vmw_fence_action *action);
44};
45
46struct vmw_fence_obj {
47 struct kref kref;
48 u32 seqno;
49
50 struct vmw_fence_manager *fman;
51 struct list_head head;
52 uint32_t signaled;
53 uint32_t signal_mask;
54 struct list_head seq_passed_actions;
55 void (*destroy)(struct vmw_fence_obj *fence);
56 wait_queue_head_t queue;
57};
58
59extern struct vmw_fence_manager *
60vmw_fence_manager_init(struct vmw_private *dev_priv);
61
62extern void vmw_fence_manager_takedown(struct vmw_fence_manager *fman);
63
64extern void vmw_fence_obj_unreference(struct vmw_fence_obj **fence_p);
65
66extern struct vmw_fence_obj *
67vmw_fence_obj_reference(struct vmw_fence_obj *fence);
68
69extern void vmw_fences_update(struct vmw_fence_manager *fman,
70 u32 sequence);
71
72extern bool vmw_fence_obj_signaled(struct vmw_fence_obj *fence,
73 uint32_t flags);
74
75extern int vmw_fence_obj_wait(struct vmw_fence_obj *fence, uint32_t flags,
76 bool lazy,
77 bool interruptible, unsigned long timeout);
78
79extern void vmw_fence_obj_flush(struct vmw_fence_obj *fence);
80
81extern int vmw_fence_create(struct vmw_fence_manager *fman,
82 uint32_t seqno,
83 uint32_t mask,
84 struct vmw_fence_obj **p_fence);
85
86extern int vmw_user_fence_create(struct drm_file *file_priv,
87 struct vmw_fence_manager *fman,
88 uint32_t sequence,
89 uint32_t mask,
90 struct vmw_fence_obj **p_fence,
91 uint32_t *p_handle);
92
93extern void vmw_fence_fifo_up(struct vmw_fence_manager *fman);
94
95extern void vmw_fence_fifo_down(struct vmw_fence_manager *fman);
96
97extern int vmw_fence_obj_wait_ioctl(struct drm_device *dev, void *data,
98 struct drm_file *file_priv);
99
100extern int vmw_fence_obj_signaled_ioctl(struct drm_device *dev, void *data,
101 struct drm_file *file_priv);
102
103extern int vmw_fence_obj_unref_ioctl(struct drm_device *dev, void *data,
104 struct drm_file *file_priv);
105#endif /* _VMWGFX_FENCE_H_ */
This page took 0.028131 seconds and 5 git commands to generate.