diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_scheduler.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_scheduler.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h index 70a42220358d..dbe9cb7ecd82 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.h +++ b/drivers/gpu/drm/i915/i915_scheduler.h | |||
@@ -8,9 +8,14 @@ | |||
8 | #define _I915_SCHEDULER_H_ | 8 | #define _I915_SCHEDULER_H_ |
9 | 9 | ||
10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
11 | #include <linux/kernel.h> | ||
11 | 12 | ||
12 | #include <uapi/drm/i915_drm.h> | 13 | #include <uapi/drm/i915_drm.h> |
13 | 14 | ||
15 | struct drm_i915_private; | ||
16 | struct i915_request; | ||
17 | struct intel_engine_cs; | ||
18 | |||
14 | enum { | 19 | enum { |
15 | I915_PRIORITY_MIN = I915_CONTEXT_MIN_USER_PRIORITY - 1, | 20 | I915_PRIORITY_MIN = I915_CONTEXT_MIN_USER_PRIORITY - 1, |
16 | I915_PRIORITY_NORMAL = I915_CONTEXT_DEFAULT_PRIORITY, | 21 | I915_PRIORITY_NORMAL = I915_CONTEXT_DEFAULT_PRIORITY, |
@@ -19,6 +24,15 @@ enum { | |||
19 | I915_PRIORITY_INVALID = INT_MIN | 24 | I915_PRIORITY_INVALID = INT_MIN |
20 | }; | 25 | }; |
21 | 26 | ||
27 | #define I915_USER_PRIORITY_SHIFT 2 | ||
28 | #define I915_USER_PRIORITY(x) ((x) << I915_USER_PRIORITY_SHIFT) | ||
29 | |||
30 | #define I915_PRIORITY_COUNT BIT(I915_USER_PRIORITY_SHIFT) | ||
31 | #define I915_PRIORITY_MASK (I915_PRIORITY_COUNT - 1) | ||
32 | |||
33 | #define I915_PRIORITY_WAIT ((u8)BIT(0)) | ||
34 | #define I915_PRIORITY_NEWCLIENT ((u8)BIT(1)) | ||
35 | |||
22 | struct i915_sched_attr { | 36 | struct i915_sched_attr { |
23 | /** | 37 | /** |
24 | * @priority: execution and service priority | 38 | * @priority: execution and service priority |
@@ -69,4 +83,26 @@ struct i915_dependency { | |||
69 | #define I915_DEPENDENCY_ALLOC BIT(0) | 83 | #define I915_DEPENDENCY_ALLOC BIT(0) |
70 | }; | 84 | }; |
71 | 85 | ||
86 | void i915_sched_node_init(struct i915_sched_node *node); | ||
87 | |||
88 | bool __i915_sched_node_add_dependency(struct i915_sched_node *node, | ||
89 | struct i915_sched_node *signal, | ||
90 | struct i915_dependency *dep, | ||
91 | unsigned long flags); | ||
92 | |||
93 | int i915_sched_node_add_dependency(struct drm_i915_private *i915, | ||
94 | struct i915_sched_node *node, | ||
95 | struct i915_sched_node *signal); | ||
96 | |||
97 | void i915_sched_node_fini(struct drm_i915_private *i915, | ||
98 | struct i915_sched_node *node); | ||
99 | |||
100 | void i915_schedule(struct i915_request *request, | ||
101 | const struct i915_sched_attr *attr); | ||
102 | |||
103 | void i915_schedule_bump_priority(struct i915_request *rq, unsigned int bump); | ||
104 | |||
105 | struct list_head * | ||
106 | i915_sched_lookup_priolist(struct intel_engine_cs *engine, int prio); | ||
107 | |||
72 | #endif /* _I915_SCHEDULER_H_ */ | 108 | #endif /* _I915_SCHEDULER_H_ */ |