diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.h b/drivers/gpu/drm/i915/i915_gem_context.h index e09673ca731d..08165f6a0a84 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.h +++ b/drivers/gpu/drm/i915/i915_gem_context.h | |||
@@ -117,15 +117,20 @@ struct i915_gem_context { | |||
117 | struct rcu_head rcu; | 117 | struct rcu_head rcu; |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * @user_flags: small set of booleans controlled by the user | ||
121 | */ | ||
122 | unsigned long user_flags; | ||
123 | #define UCONTEXT_NO_ZEROMAP 0 | ||
124 | #define UCONTEXT_NO_ERROR_CAPTURE 1 | ||
125 | #define UCONTEXT_BANNABLE 2 | ||
126 | |||
127 | /** | ||
120 | * @flags: small set of booleans | 128 | * @flags: small set of booleans |
121 | */ | 129 | */ |
122 | unsigned long flags; | 130 | unsigned long flags; |
123 | #define CONTEXT_NO_ZEROMAP BIT(0) | 131 | #define CONTEXT_BANNED 0 |
124 | #define CONTEXT_NO_ERROR_CAPTURE 1 | 132 | #define CONTEXT_CLOSED 1 |
125 | #define CONTEXT_CLOSED 2 | 133 | #define CONTEXT_FORCE_SINGLE_SUBMISSION 2 |
126 | #define CONTEXT_BANNABLE 3 | ||
127 | #define CONTEXT_BANNED 4 | ||
128 | #define CONTEXT_FORCE_SINGLE_SUBMISSION 5 | ||
129 | 134 | ||
130 | /** | 135 | /** |
131 | * @hw_id: - unique identifier for the context | 136 | * @hw_id: - unique identifier for the context |
@@ -209,37 +214,37 @@ static inline bool i915_gem_context_is_closed(const struct i915_gem_context *ctx | |||
209 | static inline void i915_gem_context_set_closed(struct i915_gem_context *ctx) | 214 | static inline void i915_gem_context_set_closed(struct i915_gem_context *ctx) |
210 | { | 215 | { |
211 | GEM_BUG_ON(i915_gem_context_is_closed(ctx)); | 216 | GEM_BUG_ON(i915_gem_context_is_closed(ctx)); |
212 | __set_bit(CONTEXT_CLOSED, &ctx->flags); | 217 | set_bit(CONTEXT_CLOSED, &ctx->flags); |
213 | } | 218 | } |
214 | 219 | ||
215 | static inline bool i915_gem_context_no_error_capture(const struct i915_gem_context *ctx) | 220 | static inline bool i915_gem_context_no_error_capture(const struct i915_gem_context *ctx) |
216 | { | 221 | { |
217 | return test_bit(CONTEXT_NO_ERROR_CAPTURE, &ctx->flags); | 222 | return test_bit(UCONTEXT_NO_ERROR_CAPTURE, &ctx->user_flags); |
218 | } | 223 | } |
219 | 224 | ||
220 | static inline void i915_gem_context_set_no_error_capture(struct i915_gem_context *ctx) | 225 | static inline void i915_gem_context_set_no_error_capture(struct i915_gem_context *ctx) |
221 | { | 226 | { |
222 | __set_bit(CONTEXT_NO_ERROR_CAPTURE, &ctx->flags); | 227 | set_bit(UCONTEXT_NO_ERROR_CAPTURE, &ctx->user_flags); |
223 | } | 228 | } |
224 | 229 | ||
225 | static inline void i915_gem_context_clear_no_error_capture(struct i915_gem_context *ctx) | 230 | static inline void i915_gem_context_clear_no_error_capture(struct i915_gem_context *ctx) |
226 | { | 231 | { |
227 | __clear_bit(CONTEXT_NO_ERROR_CAPTURE, &ctx->flags); | 232 | clear_bit(UCONTEXT_NO_ERROR_CAPTURE, &ctx->user_flags); |
228 | } | 233 | } |
229 | 234 | ||
230 | static inline bool i915_gem_context_is_bannable(const struct i915_gem_context *ctx) | 235 | static inline bool i915_gem_context_is_bannable(const struct i915_gem_context *ctx) |
231 | { | 236 | { |
232 | return test_bit(CONTEXT_BANNABLE, &ctx->flags); | 237 | return test_bit(UCONTEXT_BANNABLE, &ctx->user_flags); |
233 | } | 238 | } |
234 | 239 | ||
235 | static inline void i915_gem_context_set_bannable(struct i915_gem_context *ctx) | 240 | static inline void i915_gem_context_set_bannable(struct i915_gem_context *ctx) |
236 | { | 241 | { |
237 | __set_bit(CONTEXT_BANNABLE, &ctx->flags); | 242 | set_bit(UCONTEXT_BANNABLE, &ctx->user_flags); |
238 | } | 243 | } |
239 | 244 | ||
240 | static inline void i915_gem_context_clear_bannable(struct i915_gem_context *ctx) | 245 | static inline void i915_gem_context_clear_bannable(struct i915_gem_context *ctx) |
241 | { | 246 | { |
242 | __clear_bit(CONTEXT_BANNABLE, &ctx->flags); | 247 | clear_bit(UCONTEXT_BANNABLE, &ctx->user_flags); |
243 | } | 248 | } |
244 | 249 | ||
245 | static inline bool i915_gem_context_is_banned(const struct i915_gem_context *ctx) | 250 | static inline bool i915_gem_context_is_banned(const struct i915_gem_context *ctx) |
@@ -249,7 +254,7 @@ static inline bool i915_gem_context_is_banned(const struct i915_gem_context *ctx | |||
249 | 254 | ||
250 | static inline void i915_gem_context_set_banned(struct i915_gem_context *ctx) | 255 | static inline void i915_gem_context_set_banned(struct i915_gem_context *ctx) |
251 | { | 256 | { |
252 | __set_bit(CONTEXT_BANNED, &ctx->flags); | 257 | set_bit(CONTEXT_BANNED, &ctx->flags); |
253 | } | 258 | } |
254 | 259 | ||
255 | static inline bool i915_gem_context_force_single_submission(const struct i915_gem_context *ctx) | 260 | static inline bool i915_gem_context_force_single_submission(const struct i915_gem_context *ctx) |