Skip to content

Commit ff6b19d

Browse files
committed
drm/i915/xehp: Add compute workarounds
Additional workarounds are required once we start exposing CCS engines. Note that we have a number of workarounds that update registers in the shared render/compute reset domain. Historically we've just added such registers to the RCS engine's workaround list. But going forward we should be more careful to place such workarounds on a wa_list for an engine that definitely exists and is not fused off (e.g., a platform with no RCS would never apply the RCS wa_list). We'll keep rcs_engine_wa_init() focused on RCS-specific workarounds that only need to be applied if the RCS engine is present. A separate general_render_compute_wa_init() function will be used to define workarounds that touch registers in the shared render/compute reset domain and that we need to apply regardless of what render and/or compute engines actually exist. Any workarounds defined in this new function will internally be added to the first present RCS or CCS engine's workaround list to ensure they get applied (and only get applied once rather than being needlessly re-applied several times). Co-author: Srinivasan Shanmugam Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-13-matthew.d.roper@intel.com
1 parent 88ed07c commit ff6b19d

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@
10601060
#define FLOW_CONTROL_ENABLE REG_BIT(15)
10611061
#define UGM_BACKUP_MODE REG_BIT(13)
10621062
#define MDQ_ARBITRATION_MODE REG_BIT(12)
1063+
#define SYSTOLIC_DOP_CLOCK_GATING_DIS REG_BIT(10)
10631064
#define PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE REG_BIT(8)
10641065
#define STALL_DOP_GATING_DISABLE REG_BIT(5)
10651066
#define THROTTLE_12_5 REG_GENMASK(4, 2)

drivers/gpu/drm/i915/gt/intel_lrc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,14 @@ gen12_emit_indirect_ctx_xcs(const struct intel_context *ce, u32 *cs)
12171217
cs = gen12_emit_timestamp_wa(ce, cs);
12181218
cs = gen12_emit_restore_scratch(ce, cs);
12191219

1220+
/* Wa_16013000631:dg2 */
1221+
if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_B0, STEP_C0) ||
1222+
IS_DG2_G11(ce->engine->i915))
1223+
if (ce->engine->class == COMPUTE_CLASS)
1224+
cs = gen8_emit_pipe_control(cs,
1225+
PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE,
1226+
0);
1227+
12201228
return cs;
12211229
}
12221230

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,11 @@ static void dg2_whitelist_build(struct intel_engine_cs *engine)
19211921
RING_FORCE_TO_NONPRIV_RANGE_4);
19221922

19231923
break;
1924+
case COMPUTE_CLASS:
1925+
/* Wa_16011157294:dg2_g10 */
1926+
if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_A0, STEP_B0))
1927+
whitelist_reg(w, GEN9_CTX_PREEMPT_REG);
1928+
break;
19241929
default:
19251930
break;
19261931
}
@@ -2581,6 +2586,40 @@ xcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
25812586
}
25822587
}
25832588

2589+
/*
2590+
* The workarounds in this function apply to shared registers in
2591+
* the general render reset domain that aren't tied to a
2592+
* specific engine. Since all render+compute engines get reset
2593+
* together, and the contents of these registers are lost during
2594+
* the shared render domain reset, we'll define such workarounds
2595+
* here and then add them to just a single RCS or CCS engine's
2596+
* workaround list (whichever engine has the XXXX flag).
2597+
*/
2598+
static void
2599+
general_render_compute_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
2600+
{
2601+
struct drm_i915_private *i915 = engine->i915;
2602+
2603+
if (IS_XEHPSDV(i915)) {
2604+
/* Wa_1409954639 */
2605+
wa_masked_en(wal,
2606+
GEN8_ROW_CHICKEN,
2607+
SYSTOLIC_DOP_CLOCK_GATING_DIS);
2608+
2609+
/* Wa_1607196519 */
2610+
wa_masked_en(wal,
2611+
GEN9_ROW_CHICKEN4,
2612+
GEN12_DISABLE_GRF_CLEAR);
2613+
2614+
/* Wa_14010670810:xehpsdv */
2615+
wa_write_or(wal, XEHP_L3NODEARBCFG, XEHP_LNESPARE);
2616+
2617+
/* Wa_14010449647:xehpsdv */
2618+
wa_masked_en(wal, GEN7_HALF_SLICE_CHICKEN1,
2619+
GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE);
2620+
}
2621+
}
2622+
25842623
static void
25852624
engine_init_workarounds(struct intel_engine_cs *engine, struct i915_wa_list *wal)
25862625
{
@@ -2589,6 +2628,14 @@ engine_init_workarounds(struct intel_engine_cs *engine, struct i915_wa_list *wal
25892628

25902629
engine_fake_wa_init(engine, wal);
25912630

2631+
/*
2632+
* These are common workarounds that just need to applied
2633+
* to a single RCS/CCS engine's workaround list since
2634+
* they're reset as part of the general render domain reset.
2635+
*/
2636+
if (engine->class == RENDER_CLASS)
2637+
general_render_compute_wa_init(engine, wal);
2638+
25922639
if (engine->class == RENDER_CLASS)
25932640
rcs_engine_wa_init(engine, wal);
25942641
else

0 commit comments

Comments
 (0)