aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 2dfa585712c2..8a2270b209b0 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef _INTEL_RINGBUFFER_H_ 2#ifndef _INTEL_RINGBUFFER_H_
3#define _INTEL_RINGBUFFER_H_ 3#define _INTEL_RINGBUFFER_H_
4 4
@@ -93,11 +93,11 @@ hangcheck_action_to_str(const enum intel_engine_hangcheck_action a)
93#define I915_MAX_SUBSLICES 8 93#define I915_MAX_SUBSLICES 8
94 94
95#define instdone_slice_mask(dev_priv__) \ 95#define instdone_slice_mask(dev_priv__) \
96 (INTEL_GEN(dev_priv__) == 7 ? \ 96 (IS_GEN7(dev_priv__) ? \
97 1 : INTEL_INFO(dev_priv__)->sseu.slice_mask) 97 1 : INTEL_INFO(dev_priv__)->sseu.slice_mask)
98 98
99#define instdone_subslice_mask(dev_priv__) \ 99#define instdone_subslice_mask(dev_priv__) \
100 (INTEL_GEN(dev_priv__) == 7 ? \ 100 (IS_GEN7(dev_priv__) ? \
101 1 : INTEL_INFO(dev_priv__)->sseu.subslice_mask[0]) 101 1 : INTEL_INFO(dev_priv__)->sseu.subslice_mask[0])
102 102
103#define for_each_instdone_slice_subslice(dev_priv__, slice__, subslice__) \ 103#define for_each_instdone_slice_subslice(dev_priv__, slice__, subslice__) \
@@ -190,11 +190,22 @@ enum intel_engine_id {
190}; 190};
191 191
192struct i915_priolist { 192struct i915_priolist {
193 struct list_head requests[I915_PRIORITY_COUNT];
193 struct rb_node node; 194 struct rb_node node;
194 struct list_head requests; 195 unsigned long used;
195 int priority; 196 int priority;
196}; 197};
197 198
199#define priolist_for_each_request(it, plist, idx) \
200 for (idx = 0; idx < ARRAY_SIZE((plist)->requests); idx++) \
201 list_for_each_entry(it, &(plist)->requests[idx], sched.link)
202
203#define priolist_for_each_request_consume(it, n, plist, idx) \
204 for (; (idx = ffs((plist)->used)); (plist)->used &= ~BIT(idx - 1)) \
205 list_for_each_entry_safe(it, n, \
206 &(plist)->requests[idx - 1], \
207 sched.link)
208
198struct st_preempt_hang { 209struct st_preempt_hang {
199 struct completion completion; 210 struct completion completion;
200 bool inject_hang; 211 bool inject_hang;
@@ -487,11 +498,10 @@ struct intel_engine_cs {
487 */ 498 */
488 void (*submit_request)(struct i915_request *rq); 499 void (*submit_request)(struct i915_request *rq);
489 500
490 /* Call when the priority on a request has changed and it and its 501 /*
502 * Call when the priority on a request has changed and it and its
491 * dependencies may need rescheduling. Note the request itself may 503 * dependencies may need rescheduling. Note the request itself may
492 * not be ready to run! 504 * not be ready to run!
493 *
494 * Called under the struct_mutex.
495 */ 505 */
496 void (*schedule)(struct i915_request *request, 506 void (*schedule)(struct i915_request *request,
497 const struct i915_sched_attr *attr); 507 const struct i915_sched_attr *attr);