File tree Expand file tree Collapse file tree 9 files changed +450
-73
lines changed Expand file tree Collapse file tree 9 files changed +450
-73
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,17 @@ struct intel_context {
273
273
u8 child_index ;
274
274
/** @guc: GuC specific members for parallel submission */
275
275
struct {
276
- /** @wqi_head: head pointer in work queue */
276
+ /** @wqi_head: cached head pointer in work queue */
277
277
u16 wqi_head ;
278
- /** @wqi_tail: tail pointer in work queue */
278
+ /** @wqi_tail: cached tail pointer in work queue */
279
279
u16 wqi_tail ;
280
+ /** @wq_head: pointer to the actual head in work queue */
281
+ u32 * wq_head ;
282
+ /** @wq_tail: pointer to the actual head in work queue */
283
+ u32 * wq_tail ;
284
+ /** @wq_status: pointer to the status in work queue */
285
+ u32 * wq_status ;
286
+
280
287
/**
281
288
* @parent_page: page in context state (ce->state) used
282
289
* by parent for work queue, process descriptor
Original file line number Diff line number Diff line change @@ -661,6 +661,16 @@ static inline void execlists_schedule_out(struct i915_request *rq)
661
661
i915_request_put (rq );
662
662
}
663
663
664
+ static u32 map_i915_prio_to_lrc_desc_prio (int prio )
665
+ {
666
+ if (prio > I915_PRIORITY_NORMAL )
667
+ return GEN12_CTX_PRIORITY_HIGH ;
668
+ else if (prio < I915_PRIORITY_NORMAL )
669
+ return GEN12_CTX_PRIORITY_LOW ;
670
+ else
671
+ return GEN12_CTX_PRIORITY_NORMAL ;
672
+ }
673
+
664
674
static u64 execlists_update_context (struct i915_request * rq )
665
675
{
666
676
struct intel_context * ce = rq -> context ;
@@ -669,7 +679,7 @@ static u64 execlists_update_context(struct i915_request *rq)
669
679
670
680
desc = ce -> lrc .desc ;
671
681
if (rq -> engine -> flags & I915_ENGINE_HAS_EU_PRIORITY )
672
- desc |= lrc_desc_priority (rq_prio (rq ));
682
+ desc |= map_i915_prio_to_lrc_desc_prio (rq_prio (rq ));
673
683
674
684
/*
675
685
* WaIdleLiteRestore:bdw,skl
Original file line number Diff line number Diff line change @@ -111,16 +111,6 @@ enum {
111
111
#define XEHP_SW_COUNTER_SHIFT 58
112
112
#define XEHP_SW_COUNTER_WIDTH 6
113
113
114
- static inline u32 lrc_desc_priority (int prio )
115
- {
116
- if (prio > I915_PRIORITY_NORMAL )
117
- return GEN12_CTX_PRIORITY_HIGH ;
118
- else if (prio < I915_PRIORITY_NORMAL )
119
- return GEN12_CTX_PRIORITY_LOW ;
120
- else
121
- return GEN12_CTX_PRIORITY_NORMAL ;
122
- }
123
-
124
114
static inline void lrc_runtime_start (struct intel_context * ce )
125
115
{
126
116
struct intel_context_stats * stats = & ce -> stats ;
Original file line number Diff line number Diff line change @@ -122,6 +122,9 @@ enum intel_guc_action {
122
122
INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE = 0x1002 ,
123
123
INTEL_GUC_ACTION_SCHED_ENGINE_MODE_SET = 0x1003 ,
124
124
INTEL_GUC_ACTION_SCHED_ENGINE_MODE_DONE = 0x1004 ,
125
+ INTEL_GUC_ACTION_V69_SET_CONTEXT_PRIORITY = 0x1005 ,
126
+ INTEL_GUC_ACTION_V69_SET_CONTEXT_EXECUTION_QUANTUM = 0x1006 ,
127
+ INTEL_GUC_ACTION_V69_SET_CONTEXT_PREEMPTION_TIMEOUT = 0x1007 ,
125
128
INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION = 0x1008 ,
126
129
INTEL_GUC_ACTION_ENGINE_FAILURE_NOTIFICATION = 0x1009 ,
127
130
INTEL_GUC_ACTION_HOST2GUC_UPDATE_CONTEXT_POLICIES = 0x100B ,
Original file line number Diff line number Diff line change @@ -170,6 +170,11 @@ struct intel_guc {
170
170
/** @ads_engine_usage_size: size of engine usage in the ADS */
171
171
u32 ads_engine_usage_size ;
172
172
173
+ /** @lrc_desc_pool_v69: object allocated to hold the GuC LRC descriptor pool */
174
+ struct i915_vma * lrc_desc_pool_v69 ;
175
+ /** @lrc_desc_pool_vaddr_v69: contents of the GuC LRC descriptor pool */
176
+ void * lrc_desc_pool_vaddr_v69 ;
177
+
173
178
/**
174
179
* @context_lookup: used to resolve intel_context from guc_id, if a
175
180
* context is present in this structure it is registered with the GuC
Original file line number Diff line number Diff line change @@ -203,6 +203,20 @@ struct guc_wq_item {
203
203
u32 fence_id ;
204
204
} __packed ;
205
205
206
+ struct guc_process_desc_v69 {
207
+ u32 stage_id ;
208
+ u64 db_base_addr ;
209
+ u32 head ;
210
+ u32 tail ;
211
+ u32 error_offset ;
212
+ u64 wq_base_addr ;
213
+ u32 wq_size_bytes ;
214
+ u32 wq_status ;
215
+ u32 engine_presence ;
216
+ u32 priority ;
217
+ u32 reserved [36 ];
218
+ } __packed ;
219
+
206
220
struct guc_sched_wq_desc {
207
221
u32 head ;
208
222
u32 tail ;
@@ -227,6 +241,37 @@ struct guc_ctxt_registration_info {
227
241
};
228
242
#define CONTEXT_REGISTRATION_FLAG_KMD BIT(0)
229
243
244
+ /* Preempt to idle on quantum expiry */
245
+ #define CONTEXT_POLICY_FLAG_PREEMPT_TO_IDLE_V69 BIT(0)
246
+
247
+ /*
248
+ * GuC Context registration descriptor.
249
+ * FIXME: This is only required to exist during context registration.
250
+ * The current 1:1 between guc_lrc_desc and LRCs for the lifetime of the LRC
251
+ * is not required.
252
+ */
253
+ struct guc_lrc_desc_v69 {
254
+ u32 hw_context_desc ;
255
+ u32 slpm_perf_mode_hint ; /* SPLC v1 only */
256
+ u32 slpm_freq_hint ;
257
+ u32 engine_submit_mask ; /* In logical space */
258
+ u8 engine_class ;
259
+ u8 reserved0 [3 ];
260
+ u32 priority ;
261
+ u32 process_desc ;
262
+ u32 wq_addr ;
263
+ u32 wq_size ;
264
+ u32 context_flags ; /* CONTEXT_REGISTRATION_* */
265
+ /* Time for one workload to execute. (in micro seconds) */
266
+ u32 execution_quantum ;
267
+ /* Time to wait for a preemption request to complete before issuing a
268
+ * reset. (in micro seconds).
269
+ */
270
+ u32 preemption_timeout ;
271
+ u32 policy_flags ; /* CONTEXT_POLICY_* */
272
+ u32 reserved1 [19 ];
273
+ } __packed ;
274
+
230
275
/* 32-bit KLV structure as used by policy updates and others */
231
276
struct guc_klv_generic_dw_t {
232
277
u32 kl ;
You can’t perform that action at this time.
0 commit comments