]>
Commit | Line | Data |
---|---|---|
8b74594a CW |
1 | /* |
2 | * SPDX-License-Identifier: MIT | |
3 | * | |
4 | * Copyright © 2018 Intel Corporation | |
5 | */ | |
6 | ||
7 | #ifndef _I915_PRIOLIST_TYPES_H_ | |
8 | #define _I915_PRIOLIST_TYPES_H_ | |
9 | ||
10 | #include <linux/list.h> | |
11 | #include <linux/rbtree.h> | |
12 | ||
13 | #include <uapi/drm/i915_drm.h> | |
14 | ||
15 | enum { | |
16 | I915_PRIORITY_MIN = I915_CONTEXT_MIN_USER_PRIORITY - 1, | |
17 | I915_PRIORITY_NORMAL = I915_CONTEXT_DEFAULT_PRIORITY, | |
18 | I915_PRIORITY_MAX = I915_CONTEXT_MAX_USER_PRIORITY + 1, | |
19 | ||
20 | I915_PRIORITY_INVALID = INT_MIN | |
21 | }; | |
22 | ||
23 | #define I915_USER_PRIORITY_SHIFT 3 | |
24 | #define I915_USER_PRIORITY(x) ((x) << I915_USER_PRIORITY_SHIFT) | |
25 | ||
26 | #define I915_PRIORITY_COUNT BIT(I915_USER_PRIORITY_SHIFT) | |
27 | #define I915_PRIORITY_MASK (I915_PRIORITY_COUNT - 1) | |
28 | ||
29 | #define I915_PRIORITY_WAIT ((u8)BIT(0)) | |
30 | #define I915_PRIORITY_NEWCLIENT ((u8)BIT(1)) | |
31 | #define I915_PRIORITY_NOSEMAPHORE ((u8)BIT(2)) | |
32 | ||
33 | #define __NO_PREEMPTION (I915_PRIORITY_WAIT) | |
34 | ||
35 | struct i915_priolist { | |
36 | struct list_head requests[I915_PRIORITY_COUNT]; | |
37 | struct rb_node node; | |
38 | unsigned long used; | |
39 | int priority; | |
40 | }; | |
41 | ||
42 | #endif /* _I915_PRIOLIST_TYPES_H_ */ |