Skip to content

Commit 4431488

Browse files
dceraolorodrigovivi
authored andcommitted
drm/i915/guc: support v69 in parallel to v70
This patch re-introduces support for GuC v69 in parallel to v70. As this is a quick fix, v69 has been re-introduced as the single "fallback" guc version in case v70 is not available on disk and only for platforms that are out of force_probe and require the GuC by default. All v69 specific code has been labeled as such for easy identification, and the same was done for all v70 functions for which there is a separate v69 version, to avoid accidentally calling the wrong version via the unlabeled name. When the fallback mode kicks in, a drm_notice message is printed in dmesg to inform the user of the required update. The existing logging of the fetch function has also been updated so that we no longer complain immediately if we can't find a fw and we only throw an error if the fetch of both the base and fallback blobs fails. The plan is to follow this up with a more complex rework to allow for multiple different GuC versions to be supported at the same time. v2: reduce the fallback to platform that require it, switch to firmware_request_nowarn(), improve logs. Fixes: 2584b35 ("drm/i915/guc: Update to GuC version 70.1.1") Link: https://lists.freedesktop.org/archives/intel-gfx/2022-July/301640.html Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: John Harrison <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Matt Roper <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Michal Wajdeczko <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Reviewed-by: John Harrison <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 774ce15) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent e7999fa commit 4431488

File tree

7 files changed

+417
-62
lines changed

7 files changed

+417
-62
lines changed

drivers/gpu/drm/i915/gt/intel_context_types.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,17 @@ struct intel_context {
273273
u8 child_index;
274274
/** @guc: GuC specific members for parallel submission */
275275
struct {
276-
/** @wqi_head: head pointer in work queue */
276+
/** @wqi_head: cached head pointer in work queue */
277277
u16 wqi_head;
278-
/** @wqi_tail: tail pointer in work queue */
278+
/** @wqi_tail: cached tail pointer in work queue */
279279
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+
280287
/**
281288
* @parent_page: page in context state (ce->state) used
282289
* by parent for work queue, process descriptor

drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ enum intel_guc_action {
122122
INTEL_GUC_ACTION_SCHED_CONTEXT_MODE_DONE = 0x1002,
123123
INTEL_GUC_ACTION_SCHED_ENGINE_MODE_SET = 0x1003,
124124
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,
125128
INTEL_GUC_ACTION_CONTEXT_RESET_NOTIFICATION = 0x1008,
126129
INTEL_GUC_ACTION_ENGINE_FAILURE_NOTIFICATION = 0x1009,
127130
INTEL_GUC_ACTION_HOST2GUC_UPDATE_CONTEXT_POLICIES = 0x100B,

drivers/gpu/drm/i915/gt/uc/intel_guc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ struct intel_guc {
170170
/** @ads_engine_usage_size: size of engine usage in the ADS */
171171
u32 ads_engine_usage_size;
172172

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+
173178
/**
174179
* @context_lookup: used to resolve intel_context from guc_id, if a
175180
* context is present in this structure it is registered with the GuC

drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,20 @@ struct guc_wq_item {
203203
u32 fence_id;
204204
} __packed;
205205

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+
206220
struct guc_sched_wq_desc {
207221
u32 head;
208222
u32 tail;
@@ -227,6 +241,37 @@ struct guc_ctxt_registration_info {
227241
};
228242
#define CONTEXT_REGISTRATION_FLAG_KMD BIT(0)
229243

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+
230275
/* 32-bit KLV structure as used by policy updates and others */
231276
struct guc_klv_generic_dw_t {
232277
u32 kl;

0 commit comments

Comments
 (0)