Subversion Repositories Kolibri OS

Rev

Rev 4075 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4075 Rev 6296
Line 1... Line 1...
1
/**************************************************************************
1
/**************************************************************************
2
 *
2
 *
3
 * Copyright © 2011 VMware, Inc., Palo Alto, CA., USA
3
 * Copyright © 2011-2012 VMware, Inc., Palo Alto, CA., USA
4
 * All Rights Reserved.
4
 * All Rights Reserved.
5
 *
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 * copy of this software and associated documentation files (the
7
 * copy of this software and associated documentation files (the
8
 * "Software"), to deal in the Software without restriction, including
8
 * "Software"), to deal in the Software without restriction, including
Line 25... Line 25...
25
 *
25
 *
26
 **************************************************************************/
26
 **************************************************************************/
Line 27... Line 27...
27
 
27
 
Line -... Line 28...
-
 
28
#ifndef _VMWGFX_FENCE_H_
-
 
29
 
28
#ifndef _VMWGFX_FENCE_H_
30
#include 
Line 29... Line 31...
29
 
31
 
Line 30... Line 32...
30
#define VMW_FENCE_WAIT_TIMEOUT (5*HZ)
32
#define VMW_FENCE_WAIT_TIMEOUT (5*HZ)
Line 48... Line 50...
48
	void (*seq_passed) (struct vmw_fence_action *action);
50
	void (*seq_passed) (struct vmw_fence_action *action);
49
	void (*cleanup) (struct vmw_fence_action *action);
51
	void (*cleanup) (struct vmw_fence_action *action);
50
};
52
};
Line 51... Line 53...
51
 
53
 
52
struct vmw_fence_obj {
54
struct vmw_fence_obj {
53
	struct kref kref;
-
 
Line 54... Line -...
54
	u32 seqno;
-
 
55
 
55
	struct fence base;
56
	struct vmw_fence_manager *fman;
-
 
57
	struct list_head head;
-
 
58
	uint32_t signaled;
56
 
59
	uint32_t signal_mask;
57
	struct list_head head;
60
	struct list_head seq_passed_actions;
-
 
61
	void (*destroy)(struct vmw_fence_obj *fence);
58
	struct list_head seq_passed_actions;
Line 62... Line 59...
62
	wait_queue_head_t queue;
59
	void (*destroy)(struct vmw_fence_obj *fence);
63
};
60
};
Line 64... Line 61...
64
 
61
 
Line -... Line 62...
-
 
62
extern struct vmw_fence_manager *
65
extern struct vmw_fence_manager *
63
vmw_fence_manager_init(struct vmw_private *dev_priv);
-
 
64
 
-
 
65
extern void vmw_fence_manager_takedown(struct vmw_fence_manager *fman);
-
 
66
 
-
 
67
static inline void
-
 
68
vmw_fence_obj_unreference(struct vmw_fence_obj **fence_p)
-
 
69
{
-
 
70
	struct vmw_fence_obj *fence = *fence_p;
66
vmw_fence_manager_init(struct vmw_private *dev_priv);
71
 
67
 
72
	*fence_p = NULL;
68
extern void vmw_fence_manager_takedown(struct vmw_fence_manager *fman);
73
	if (fence)
-
 
74
		fence_put(&fence->base);
-
 
75
}
-
 
76
 
-
 
77
static inline struct vmw_fence_obj *
-
 
78
vmw_fence_obj_reference(struct vmw_fence_obj *fence)
Line 69... Line 79...
69
 
79
{
Line 70... Line 80...
70
extern void vmw_fence_obj_unreference(struct vmw_fence_obj **fence_p);
80
	if (fence)
71
 
-
 
Line 72... Line 81...
72
extern struct vmw_fence_obj *
81
		fence_get(&fence->base);
73
vmw_fence_obj_reference(struct vmw_fence_obj *fence);
82
	return fence;
74
 
83
}
Line 75... Line 84...
75
extern void vmw_fences_update(struct vmw_fence_manager *fman);
84
 
Line 76... Line 85...
76
 
85
extern void vmw_fences_update(struct vmw_fence_manager *fman);
77
extern bool vmw_fence_obj_signaled(struct vmw_fence_obj *fence,
86
 
78
				   uint32_t flags);
-
 
79
 
87
extern bool vmw_fence_obj_signaled(struct vmw_fence_obj *fence);
Line 80... Line 88...
80
extern int vmw_fence_obj_wait(struct vmw_fence_obj *fence, uint32_t flags,
88
 
81
			      bool lazy,
89
extern int vmw_fence_obj_wait(struct vmw_fence_obj *fence,
82
			      bool interruptible, unsigned long timeout);
90
			      bool lazy,
83
 
-
 
84
extern void vmw_fence_obj_flush(struct vmw_fence_obj *fence);
91
			      bool interruptible, unsigned long timeout);
85
 
92
 
Line 86... Line 93...
86
extern int vmw_fence_create(struct vmw_fence_manager *fman,
93
extern void vmw_fence_obj_flush(struct vmw_fence_obj *fence);
Line 109... Line 116...
109
				     struct drm_file *file_priv);
116
				     struct drm_file *file_priv);
110
extern int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
117
extern int vmw_fence_event_ioctl(struct drm_device *dev, void *data,
111
				 struct drm_file *file_priv);
118
				 struct drm_file *file_priv);
112
extern void vmw_event_fence_fpriv_gone(struct vmw_fence_manager *fman,
119
extern void vmw_event_fence_fpriv_gone(struct vmw_fence_manager *fman,
113
				       struct list_head *event_list);
120
				       struct list_head *event_list);
114
/*
-
 
115
extern int vmw_event_fence_action_queue(struct drm_file *filee_priv,
121
extern int vmw_event_fence_action_queue(struct drm_file *filee_priv,
116
					struct vmw_fence_obj *fence,
122
					struct vmw_fence_obj *fence,
117
					struct drm_pending_event *event,
123
					struct drm_pending_event *event,
118
					uint32_t *tv_sec,
124
					uint32_t *tv_sec,
119
					uint32_t *tv_usec,
125
					uint32_t *tv_usec,
120
					bool interruptible);
126
					bool interruptible);
121
*/
-
 
122
 
-
 
123
#endif /* _VMWGFX_FENCE_H_ */
127
#endif /* _VMWGFX_FENCE_H_ */