1
2
3
4
5
6
7 #ifndef _I915_ACTIVE_TYPES_H_
8 #define _I915_ACTIVE_TYPES_H_
9
10 #include <linux/atomic.h>
11 #include <linux/llist.h>
12 #include <linux/mutex.h>
13 #include <linux/rbtree.h>
14 #include <linux/rcupdate.h>
15
16 struct drm_i915_private;
17 struct i915_active_request;
18 struct i915_request;
19
20 typedef void (*i915_active_retire_fn)(struct i915_active_request *,
21 struct i915_request *);
22
23 struct i915_active_request {
24 struct i915_request __rcu *request;
25 struct list_head link;
26 i915_active_retire_fn retire;
27 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
28
29
30
31
32
33
34
35
36
37
38
39
40 struct mutex *lock;
41 #endif
42 };
43
44 struct active_node;
45
46 struct i915_active {
47 struct drm_i915_private *i915;
48
49 struct active_node *cache;
50 struct rb_root tree;
51 struct mutex mutex;
52 atomic_t count;
53
54 unsigned long flags;
55 #define I915_ACTIVE_GRAB_BIT 0
56
57 int (*active)(struct i915_active *ref);
58 void (*retire)(struct i915_active *ref);
59
60 struct llist_head preallocated_barriers;
61 };
62
63 #endif