drm/i915: Add engine scratch register to live_lrc_fixed
Subsystems (2)
PATCH 1/4 drm/i915: Add engine scratch register to live_lrc_fixed
General purpose registers are per engine and
in a fixed location. Add to live_lrc_fixed.
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 12 ++++++++++++ drivers/gpu/drm/i915/gt/selftest_lrc.c | 5 +++++ 2 files changed, 17 insertions(+)
drivers/gpu/drm/i915/gt/intel_lrc.c +12 -0
@@ -250,6 +250,18 @@ static int lrc_ring_mi_mode(const struct intel_engine_cs *engine)return -1 ; } +static int lrc_ring_gpr0 (const struct intel_engine_cs *engine) +{ +if (INTEL_GEN (engine->i915) >=12 ) +return 0x74 ; +else if (INTEL_GEN (engine->i915) >=9 ) +return 0x68 ; +else if (engine->class ==RENDER_CLASS ) +return 0xd8 ; +else +return -1 ; +} +static int lrc_ring_wa_bb_per_ctx (const struct intel_engine_cs *engine) {if (INTEL_GEN (engine->i915) >=12 )
drivers/gpu/drm/i915/gt/selftest_lrc.c +5 -0
@@ -4613,6 +4613,11 @@ static int live_lrc_fixed(void *arg) CTX_TIMESTAMP - 1, "RING_CTX_TIMESTAMP" }, + { +i915_mmio_reg_offset (GEN8_RING_CS_GPR (engine->mmio_base,0 )), +lrc_ring_gpr0 (engine), +"RING_CS_GPR0" + }, { }, }, *t;u32 *hw;
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Add per ctx batchbuffer wa for timestamp
Restoration of a previous timestamp can collide with updating the timestamp, causing a value corruption.
Combat this issue by using indirect ctx bb to modify the context image during restoring process.
We can preload value into scratch register. From which we then do the actual write with LRR. LRR is faster and thus less error prone as probability of race drops.
v2: tidying (Chris)
v3: lrr for all engines
v4: grp
v5: reg bit
v6: wa_bb_offset, virtual engines (Chris)
References: HSDES#16010904313
Testcase: igt/i915_selftest/gt_lrc
--- drivers/gpu/drm/i915/gt/intel_context_types.h | 2 + drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 3 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 149 ++++++++++++++++-- 3 files changed, 142 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/gt/intel_context_types.h +2 -0
@@ -96,6 +96,8 @@ struct intel_context {/** sseu: Control eu/slice partitioning */ struct intel_sseu sseu; + + u8 wa_bb_page; /* if set, page num reserved for context workarounds */ };#endif /* __INTEL_CONTEXT_TYPES__ */
drivers/gpu/drm/i915/gt/intel_gpu_commands.h +2 -1
@@ -138,7 +138,7 @@*/ #define MI_LOAD_REGISTER_IMM (x) MI_INSTR(0x22, 2*(x)-1)/* Gen11+. addr = base + (ctx_restore ? offset & GENMASK(12,2) : offset) */ -#define MI_LRI_CS_MMIO (1<<19) +#define MI_LRI_LRM_CS_MMIO REG_BIT(19)#define MI_LRI_FORCE_POSTED (1<<12)#define MI_LOAD_REGISTER_IMM_MAX_REGS (126)#define MI_STORE_REGISTER_MEM MI_INSTR(0x24, 1)
@@ -156,6 +156,7 @@#define MI_LOAD_REGISTER_MEM MI_INSTR(0x29, 1)#define MI_LOAD_REGISTER_MEM_GEN8 MI_INSTR(0x29, 2)#define MI_LOAD_REGISTER_REG MI_INSTR(0x2A, 1) +#define MI_LRR_SOURCE_CS_MMIO REG_BIT(18)#define MI_BATCH_BUFFER MI_INSTR(0x30, 1)#define MI_BATCH_NON_SECURE (1)/* for snb/ivb/vlv this also means "batch in ppgtt" when ppgtt is enabled. */
drivers/gpu/drm/i915/gt/intel_lrc.c +138 -11
192 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Add per ctx batchbuffer wa for timestamp
Restoration of a previous timestamp can collide with updating the timestamp, causing a value corruption.
Combat this issue by using indirect ctx bb to modify the context image during restoring process.
We can preload value into scratch register. From which we then do the actual write with LRR. LRR is faster and thus less error prone as probability of race drops.
v2: tidying (Chris)
v3: lrr for all engines
v4: grp
v5: reg bit
v6: wa_bb_offset, virtual engines (Chris)
References: HSDES#16010904313
Testcase: igt/i915_selftest/gt_lrc
--- drivers/gpu/drm/i915/gt/intel_context_types.h | 2 + drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 3 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 150 ++++++++++++++++-- 3 files changed, 143 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/gt/intel_context_types.h +2 -0
@@ -96,6 +96,8 @@ struct intel_context {/** sseu: Control eu/slice partitioning */ struct intel_sseu sseu; + + u8 wa_bb_page; /* if set, page num reserved for context workarounds */ };#endif /* __INTEL_CONTEXT_TYPES__ */
drivers/gpu/drm/i915/gt/intel_gpu_commands.h +2 -1
@@ -138,7 +138,7 @@*/ #define MI_LOAD_REGISTER_IMM (x) MI_INSTR(0x22, 2*(x)-1)/* Gen11+. addr = base + (ctx_restore ? offset & GENMASK(12,2) : offset) */ -#define MI_LRI_CS_MMIO (1<<19) +#define MI_LRI_LRM_CS_MMIO REG_BIT(19)#define MI_LRI_FORCE_POSTED (1<<12)#define MI_LOAD_REGISTER_IMM_MAX_REGS (126)#define MI_STORE_REGISTER_MEM MI_INSTR(0x24, 1)
@@ -156,6 +156,7 @@#define MI_LOAD_REGISTER_MEM MI_INSTR(0x29, 1)#define MI_LOAD_REGISTER_MEM_GEN8 MI_INSTR(0x29, 2)#define MI_LOAD_REGISTER_REG MI_INSTR(0x2A, 1) +#define MI_LRR_SOURCE_CS_MMIO REG_BIT(18)#define MI_BATCH_BUFFER MI_INSTR(0x30, 1)#define MI_BATCH_NON_SECURE (1)/* for snb/ivb/vlv this also means "batch in ppgtt" when ppgtt is enabled. */
drivers/gpu/drm/i915/gt/intel_lrc.c +139 -11
193 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Add live selftests for indirect ctx batchbuffers
In reply to Mika KuoppalaIndirect ctx batchbuffers are a hw feature of which batch can be run, by hardware, during context restoration stage. Driver can setup a batchbuffer and also an offset into the context image. When context image is marshalled from memory to registers, and when the offset from the start of context register state is equal of what driver pre-determined, batch will run. So one can manipulate context restoration process at cacheline granularity, given some limitations, as you need to have rudimentaries in place before you can run a batch.
Add selftest which will write the ring start register to a canary spot. This will test that hardware will run a batchbuffer for the context in question.
v2: request wait fix, naming (Chris)
v3: test order (Chris)
v4: rebase
--- drivers/gpu/drm/i915/gt/selftest_lrc.c | 150 +++++++++++++++++++++++++ 1 file changed, 150 insertions(+)
drivers/gpu/drm/i915/gt/selftest_lrc.c +150 -0
@@ -5710,6 +5710,155 @@ static int live_lrc_isolation(void *arg)return err; } +static int indirect_ctx_submit_req (struct intel_context *ce) +{ +struct i915_request *rq; +int err =0 ; + + rq =intel_context_create_request (ce); +if (IS_ERR (rq)) +return PTR_ERR (rq); + +i915_request_get (rq); +i915_request_add (rq); + +if (i915_request_wait (rq,0 ,HZ /5 ) <0 ) + err = -ETIME ; + +i915_request_put (rq); + +return err; +} + +#define CTX_BB_CANARY_OFFSET (3 * 1024) +#define CTX_BB_CANARY_INDEX (CTX_BB_CANARY_OFFSET / sizeof(u32)) + +static u32 * +emit_indirect_ctx_bb_canary (const struct intel_context *ce,u32 *cs) +{ +const u32 ring_start_reg =i915_mmio_reg_offset (RING_START (0 )); +const u32 srm =MI_STORE_REGISTER_MEM_GEN8 | +MI_SRM_LRM_GLOBAL_GTT |MI_LRI_LRM_CS_MMIO ; + + *cs++ = srm; + *cs++ = ring_start_reg; + *cs++ =i915_ggtt_offset (ce->state) + +context_wa_bb_offset (ce) +CTX_BB_CANARY_OFFSET ; + *cs++ =0 ; + +return cs; +} + +static void +indirect_ctx_bb_setup (struct intel_context *ce) +{ +u32 *cs =context_indirect_bb (ce); + + cs[CTX_BB_CANARY_INDEX ] =0xdeadf00d ; + +setup_indirect_ctx_bb (ce, ce->engine, emit_indirect_ctx_bb_canary); +} + +static bool check_ring_start (struct intel_context *ce) +{ +const u32 *const ctx_bb = (void *)(ce->lrc_reg_state) - +LRC_STATE_OFFSET +context_wa_bb_offset (ce); + +if (ctx_bb[CTX_BB_CANARY_INDEX ] == ce->lrc_reg_state[CTX_RING_START ]) +return true; + +pr_err ("ring start mismatch: canary 0x%08x vs state 0x%08x\n" , + ctx_bb[CTX_BB_CANARY_INDEX ], + ce->lrc_reg_state[CTX_RING_START ]); + +return false; +} + +static int indirect_ctx_bb_check (struct intel_context *ce) +{ +int err; + + err =indirect_ctx_submit_req (ce); +if (err) +return err; + +if (!check_ring_start (ce)) +return -EINVAL ; + +return 0 ; +} + +static int __live_lrc_indirect_ctx_bb (struct intel_engine_cs *engine) +{ +struct intel_context *a, *b; +int err =0 ; + + a =intel_context_create (engine); + b =intel_context_create (engine); + + err =intel_context_pin (a); +if (err) +return err; + + err =intel_context_pin (b); +if (err) { +intel_context_put (a); +return err; + } + +/* We use the already reserved extra page in context state */ +if (!a->wa_bb_page) { +GEM_BUG_ON (b->wa_bb_page); +GEM_BUG_ON (INTEL_GEN (engine->i915) ==12 ); + goto out; + } + +/* In order to test that our per context bb is truly per context, +* and executes at the intended spot on context restoring process, +* make the batch store the ring start value to memory. +* As ring start is restored apriori of starting the indirect ctx bb and +* as it will be different for each context, it fits to this purpose. +*/ +indirect_ctx_bb_setup (a); +indirect_ctx_bb_setup (b); + + err =indirect_ctx_bb_check (a); +if (err) + goto out; + + err =indirect_ctx_bb_check (b); +out: +intel_context_unpin (b); +intel_context_put (b); + +intel_context_unpin (a); +intel_context_put (a); + +return err; +} + +static int live_lrc_indirect_ctx_bb (void *arg) +{ +struct intel_gt *gt = arg; +struct intel_engine_cs *engine; +enum intel_engine_id id; +int err =0 ; + +for_each_engine (engine, gt, id) { +intel_engine_pm_get (engine); + err =__live_lrc_indirect_ctx_bb (engine); +intel_engine_pm_put (engine); + +if (igt_flush_test (gt->i915)) + err = -EIO ; + +if (err) +break ; + } + +return err; +} +static void garbage_reset (struct intel_engine_cs *engine,struct i915_request *rq) {
@@ -5945,6 +6094,7 @@ int intel_lrc_live_selftests(struct drm_i915_private *i915)SUBTEST (live_lrc_timestamp),SUBTEST (live_lrc_garbage),SUBTEST (live_pphwsp_runtime), + SUBTEST(live_lrc_indirect_ctx_bb), };if (!HAS_LOGICAL_RING_CONTEXTS (i915))
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL
In reply to Mika KuoppalaUse indirect ctx bb to load cmd buffer control value from context image to avoid corruption.
v2: add to lrc layout (Chris)
v3: end to a cacheline (Chris)
v4: add to lrc fixed (Chris)
v5: value in offset+1
Testcase: igt/i915_selftest/gt_lrc
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 114 ++++++++++++++++++++++++- drivers/gpu/drm/i915/gt/selftest_lrc.c | 5 ++ drivers/gpu/drm/i915/i915_reg.h | 1 + 3 files changed, 117 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +111 -3
@@ -294,6 +294,19 @@ static int lrc_ring_indirect_offset(const struct intel_engine_cs *engine)return x +2 ; } +static int lrc_ring_cmd_buf_cctl (const struct intel_engine_cs *engine) +{ +if (engine->class !=RENDER_CLASS ) +return -1 ; + +if (INTEL_GEN (engine->i915) >=12 ) +return 0xb6 ; +else if (INTEL_GEN (engine->i915) ==11 ) +return 0xaa ; +else +return -1 ; +} +static u32 lrc_ring_indirect_offset_default (const struct intel_engine_cs *engine) {
@@ -606,7 +619,7 @@ static void set_offsets(u32 *regs,#define REG16 (x) \ (((x) >> 9) | BIT(7) | BUILD_BUG_ON_ZERO(x >= 0x10000)), \ (((x) >> 2) & 0x7f) -#define END (x) 0, (x) +#define END (total_state_size) 0, (total_state_size) {const u32 base = engine->mmio_base;
@@ -1014,8 +1027,63 @@ static const u8 gen12_rcs_offsets[] = {NOP (6 ),LRI (1 ,0 ),REG (0x0c8 ), +NOP (3 +9 +1 ), + +LRI (51 ,POSTED ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG (0x028 ), +REG (0x09c ), +REG (0x0c0 ), +REG (0x178 ), +REG (0x17c ), +REG16 (0x358 ), +REG (0x170 ), +REG (0x150 ), +REG (0x154 ), +REG (0x158 ), +REG16 (0x41c ), +REG16 (0x600 ), +REG16 (0x604 ), +REG16 (0x608 ), +REG16 (0x60c ), +REG16 (0x610 ), +REG16 (0x614 ), +REG16 (0x618 ), +REG16 (0x61c ), +REG16 (0x620 ), +REG16 (0x624 ), +REG16 (0x628 ), +REG16 (0x62c ), +REG16 (0x630 ), +REG16 (0x634 ), +REG16 (0x638 ), +REG16 (0x63c ), +REG16 (0x640 ), +REG16 (0x644 ), +REG16 (0x648 ), +REG16 (0x64c ), +REG16 (0x650 ), +REG16 (0x654 ), +REG16 (0x658 ), +REG16 (0x65c ), +REG16 (0x660 ), +REG16 (0x664 ), +REG16 (0x668 ), +REG16 (0x66c ), +REG16 (0x670 ), +REG16 (0x674 ), +REG16 (0x678 ), +REG16 (0x67c ), +REG (0x068 ), +REG (0x084 ), +NOP (1 ), - END(80) +END (192 ) };#undef END
@@ -3247,6 +3315,39 @@ gen12_emit_restore_scratch(const struct intel_context *ce, u32 *cs)return cs; } +static u32 * +gen12_emit_cmd_buf_wa (const struct intel_context *ce,u32 *cs) +{ +const u32 lrc_offset =i915_ggtt_offset (ce->state) + +LRC_STATE_OFFSET ; +const u32 scratch_reg =i915_mmio_reg_offset (GEN8_RING_CS_GPR (0 ,0 )); + +GEM_BUG_ON (lrc_ring_cmd_buf_cctl (ce->engine) ==-1 ); + + *cs++ =MI_LOAD_REGISTER_MEM_GEN8 | +MI_SRM_LRM_GLOBAL_GTT |MI_LRI_LRM_CS_MMIO ; + *cs++ = scratch_reg; + *cs++ = lrc_offset + (lrc_ring_cmd_buf_cctl (ce->engine) +1 )*sizeof (u32); + *cs++ =0 ; + + *cs++ =MI_LOAD_REGISTER_REG | +MI_LRR_SOURCE_CS_MMIO |MI_LRI_LRM_CS_MMIO ; + *cs++ = scratch_reg; + *cs++ =i915_mmio_reg_offset (RING_CMD_BUF_CCTL (0 )); + +return cs; +} + +static u32 * +gen12_emit_indirect_ctx_rcs (const struct intel_context *ce,u32 *cs) +{ + cs =gen12_emit_timestamp_wa (ce, cs); + cs =gen12_emit_cmd_buf_wa (ce, cs); + cs =gen12_emit_restore_scratch (ce, cs); + +return cs; +} +static u32 *gen12_emit_indirect_ctx_xcs (const struct intel_context *ce,u32 *cs) {
@@ -3334,9 +3435,16 @@ __execlists_update_reg_state(const struct intel_context *ce, }if (ce->wa_bb_page) { +u32 *(*fn)(const struct intel_context *ce,u32 *cs); + +if (ce->engine->class ==RENDER_CLASS ) + fn = gen12_emit_indirect_ctx_rcs; +else + fn = gen12_emit_indirect_ctx_xcs; +/* Mutually exclusive wrt to global indirect bb */ GEM_BUG_ON (engine->wa_ctx.indirect_ctx.size); -setup_indirect_ctx_bb (ce, engine, gen12_emit_indirect_ctx_xcs); +setup_indirect_ctx_bb (ce, engine, fn); } }
drivers/gpu/drm/i915/gt/selftest_lrc.c +5 -0
@@ -4618,6 +4618,11 @@ static int live_lrc_fixed(void *arg) lrc_ring_gpr0(engine), "RING_CS_GPR0" }, + { +i915_mmio_reg_offset (RING_CMD_BUF_CCTL (engine->mmio_base)), +lrc_ring_cmd_buf_cctl (engine), +"RING_CMD_BUF_CCTL" + }, { }, }, *t;u32 *hw;
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2657,6 +2657,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define RING_DMA_FADD_UDW (base) _MMIO((base) + 0x60)/* gen8+ */ #define RING_INSTPM (base) _MMIO((base) + 0xc0)#define RING_MI_MODE (base) _MMIO((base) + 0x9c) +#define RING_CMD_BUF_CCTL (base) _MMIO((base) + 0x84)#define INSTPS _MMIO(0x2070)/* 965+ only */ #define GEN4_INSTDONE1 _MMIO(0x207c)/* 965+ only, aka INSTDONE_2 on SNB */ #define ACTHD_I965 _MMIO(0x2074)
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL
Use indirect ctx bb to load cmd buffer control value from context image to avoid corruption.
v2: add to lrc layout (Chris)
v3: end to a cacheline (Chris)
v4: add to lrc fixed (Chris)
v5: value in offset+1
Testcase: igt/i915_selftest/gt_lrc
--- drivers/gpu/drm/i915/gt/intel_lrc.c | 114 ++++++++++++++++++++++++- drivers/gpu/drm/i915/gt/selftest_lrc.c | 5 ++ drivers/gpu/drm/i915/i915_reg.h | 1 + 3 files changed, 117 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_lrc.c +111 -3
@@ -294,6 +294,19 @@ static int lrc_ring_indirect_offset(const struct intel_engine_cs *engine)return x +2 ; } +static int lrc_ring_cmd_buf_cctl (const struct intel_engine_cs *engine) +{ +if (engine->class !=RENDER_CLASS ) +return -1 ; + +if (INTEL_GEN (engine->i915) >=12 ) +return 0xb6 ; +else if (INTEL_GEN (engine->i915) ==11 ) +return 0xaa ; +else +return -1 ; +} +static u32 lrc_ring_indirect_offset_default (const struct intel_engine_cs *engine) {
@@ -607,7 +620,7 @@ static void set_offsets(u32 *regs,#define REG16 (x) \ (((x) >> 9) | BIT(7) | BUILD_BUG_ON_ZERO(x >= 0x10000)), \ (((x) >> 2) & 0x7f) -#define END (x) 0, (x) +#define END (total_state_size) 0, (total_state_size) {const u32 base = engine->mmio_base;
@@ -1015,8 +1028,63 @@ static const u8 gen12_rcs_offsets[] = {NOP (6 ),LRI (1 ,0 ),REG (0x0c8 ), +NOP (3 +9 +1 ), + +LRI (51 ,POSTED ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG16 (0x588 ), +REG (0x028 ), +REG (0x09c ), +REG (0x0c0 ), +REG (0x178 ), +REG (0x17c ), +REG16 (0x358 ), +REG (0x170 ), +REG (0x150 ), +REG (0x154 ), +REG (0x158 ), +REG16 (0x41c ), +REG16 (0x600 ), +REG16 (0x604 ), +REG16 (0x608 ), +REG16 (0x60c ), +REG16 (0x610 ), +REG16 (0x614 ), +REG16 (0x618 ), +REG16 (0x61c ), +REG16 (0x620 ), +REG16 (0x624 ), +REG16 (0x628 ), +REG16 (0x62c ), +REG16 (0x630 ), +REG16 (0x634 ), +REG16 (0x638 ), +REG16 (0x63c ), +REG16 (0x640 ), +REG16 (0x644 ), +REG16 (0x648 ), +REG16 (0x64c ), +REG16 (0x650 ), +REG16 (0x654 ), +REG16 (0x658 ), +REG16 (0x65c ), +REG16 (0x660 ), +REG16 (0x664 ), +REG16 (0x668 ), +REG16 (0x66c ), +REG16 (0x670 ), +REG16 (0x674 ), +REG16 (0x678 ), +REG16 (0x67c ), +REG (0x068 ), +REG (0x084 ), +NOP (1 ), - END(80) +END (192 ) };#undef END
@@ -3248,6 +3316,39 @@ gen12_emit_restore_scratch(const struct intel_context *ce, u32 *cs)return cs; } +static u32 * +gen12_emit_cmd_buf_wa (const struct intel_context *ce,u32 *cs) +{ +const u32 lrc_offset =i915_ggtt_offset (ce->state) + +LRC_STATE_OFFSET ; +const u32 scratch_reg =i915_mmio_reg_offset (GEN8_RING_CS_GPR (0 ,0 )); + +GEM_BUG_ON (lrc_ring_cmd_buf_cctl (ce->engine) ==-1 ); + + *cs++ =MI_LOAD_REGISTER_MEM_GEN8 | +MI_SRM_LRM_GLOBAL_GTT |MI_LRI_LRM_CS_MMIO ; + *cs++ = scratch_reg; + *cs++ = lrc_offset + (lrc_ring_cmd_buf_cctl (ce->engine) +1 ) *sizeof (u32); + *cs++ =0 ; + + *cs++ =MI_LOAD_REGISTER_REG | +MI_LRR_SOURCE_CS_MMIO |MI_LRI_LRM_CS_MMIO ; + *cs++ = scratch_reg; + *cs++ =i915_mmio_reg_offset (RING_CMD_BUF_CCTL (0 )); + +return cs; +} + +static u32 * +gen12_emit_indirect_ctx_rcs (const struct intel_context *ce,u32 *cs) +{ + cs =gen12_emit_timestamp_wa (ce, cs); + cs =gen12_emit_cmd_buf_wa (ce, cs); + cs =gen12_emit_restore_scratch (ce, cs); + +return cs; +} +static u32 *gen12_emit_indirect_ctx_xcs (const struct intel_context *ce,u32 *cs) {
@@ -3335,9 +3436,16 @@ __execlists_update_reg_state(const struct intel_context *ce, }if (ce->wa_bb_page) { +u32 *(*fn)(const struct intel_context *ce,u32 *cs); + +if (ce->engine->class ==RENDER_CLASS ) + fn = gen12_emit_indirect_ctx_rcs; +else + fn = gen12_emit_indirect_ctx_xcs; +/* Mutually exclusive wrt to global indirect bb */ GEM_BUG_ON (engine->wa_ctx.indirect_ctx.size); -setup_indirect_ctx_bb (ce, engine, gen12_emit_indirect_ctx_xcs); +setup_indirect_ctx_bb (ce, engine, fn); } }
drivers/gpu/drm/i915/gt/selftest_lrc.c +5 -0
@@ -4618,6 +4618,11 @@ static int live_lrc_fixed(void *arg) lrc_ring_gpr0(engine), "RING_CS_GPR0" }, + { +i915_mmio_reg_offset (RING_CMD_BUF_CCTL (engine->mmio_base)), +lrc_ring_cmd_buf_cctl (engine), +"RING_CMD_BUF_CCTL" + }, { }, }, *t;u32 *hw;
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2657,6 +2657,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define RING_DMA_FADD_UDW (base) _MMIO((base) + 0x60)/* gen8+ */ #define RING_INSTPM (base) _MMIO((base) + 0xc0)#define RING_MI_MODE (base) _MMIO((base) + 0x9c) +#define RING_CMD_BUF_CCTL (base) _MMIO((base) + 0x84)#define INSTPS _MMIO(0x2070)/* 965+ only */ #define GEN4_INSTDONE1 _MMIO(0x207c)/* 965+ only, aka INSTDONE_2 on SNB */ #define ACTHD_I965 _MMIO(0x2074)
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed
URL : https://patchwork.freedesktop.org/series/76460/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip d5008c5aac16 drm/i915: Add engine scratch register to live_lrc_fixed 70ee6bcc1e36 drm/i915: Add per ctx batchbuffer wa for timestamp -:259: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #259: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:5029: + ce->wa_bb_page = context_size/PAGE_SIZE; ^
total: 0 errors, 0 warnings, 1 checks, 215 lines checked4c47318cc563 drm/i915: Add live selftests for indirect ctx batchbuffers 5a28ec4512da drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL
-:47: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #47: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:622:
+#define END(total_state_size) 0, (total_state_size)
-:132: CHECK:SPACING: spaces preferred around that '*' (ctx:VxW) #132: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:3330:
+ *cs++ = lrc_offset + (lrc_ring_cmd_buf_cctl(ce->engine) + 1)* sizeof(u32);
^
total: 1 errors, 0 warnings, 1 checks, 165 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed
URL : https://patchwork.freedesktop.org/series/76460/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8363 -> Patchwork_17460
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17460 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_17460, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17460:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gt_pm:
- fi-cml-s: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-cml-s/igt@i915_selftest@live@gt_pm.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-cml-s/igt@i915_selftest@live@gt_pm.html
- fi-kbl-x1275: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-kbl-x1275/igt@i915_selftest@live@gt_pm.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-kbl-x1275/igt@i915_selftest@live@gt_pm.html
- fi-snb-2520m: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-snb-2520m/igt@i915_selftest@live@gt_pm.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-snb-2520m/igt@i915_selftest@live@gt_pm.html
- fi-kbl-r: [PASS][7] -> [DMESG-FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-kbl-r/igt@i915_selftest@live@gt_pm.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-kbl-r/igt@i915_selftest@live@gt_pm.html
- fi-kbl-7500u: [PASS][9] -> [DMESG-FAIL][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-kbl-7500u/igt@i915_selftest@live@gt_pm.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-kbl-7500u/igt@i915_selftest@live@gt_pm.html
Known issues
------------
Here are the changes found in Patchwork_17460 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@basic-rte:
- fi-hsw-4770: [PASS][11] -> [SKIP][12] ([fdo#109271]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-hsw-4770/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-hsw-4770/igt@[email protected]
#### Possible fixes ####
* igt@i915_selftest@live@gt_pm:
- fi-bsw-kefka: [DMESG-FAIL][13] -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-bsw-kefka/igt@i915_selftest@live@gt_pm.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-bsw-kefka/igt@i915_selftest@live@gt_pm.html
- fi-bdw-5557u: [DMESG-FAIL][15] -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-bdw-5557u/igt@i915_selftest@live@gt_pm.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/fi-bdw-5557u/igt@i915_selftest@live@gt_pm.html
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
Participating hosts (50 -> 44)
------------------------------
Missing (6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8363 -> Patchwork_17460
CI-20190529: 20190529
CI_DRM_8363: dbfcd301433f070fbf416772817fcec778c8e5d0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5610: 71fed15724898a8f914666093352a964b70a62fc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17460: 5a28ec4512da0730446edcd1dd6fb77f12d53390 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
5a28ec4512da drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL 4c47318cc563 drm/i915: Add live selftests for indirect ctx batchbuffers 70ee6bcc1e36 drm/i915: Add per ctx batchbuffer wa for timestamp d5008c5aac16 drm/i915: Add engine scratch register to live_lrc_fixed
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17460/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed (rev3)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed (rev3)
URL : https://patchwork.freedesktop.org/series/76460/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 987eaf2a4f2c drm/i915: Add engine scratch register to live_lrc_fixed 32e6e8c83a82 drm/i915: Add per ctx batchbuffer wa for timestamp b586ec9ed8ea drm/i915: Add live selftests for indirect ctx batchbuffers f36c4e38e7aa drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL -:47: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #47: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:623: +#define END(total_state_size) 0, (total_state_size)
total: 1 errors, 0 warnings, 0 checks, 165 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed (rev3)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Add engine scratch register to live_lrc_fixed (rev3)
URL : https://patchwork.freedesktop.org/series/76460/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8363 -> Patchwork_17461
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17461 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_17461, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17461:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@gt_pm:
- fi-skl-lmem: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-skl-lmem/igt@i915_selftest@live@gt_pm.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/fi-skl-lmem/igt@i915_selftest@live@gt_pm.html
- fi-hsw-4770: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-hsw-4770/igt@i915_selftest@live@gt_pm.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/fi-hsw-4770/igt@i915_selftest@live@gt_pm.html
- fi-whl-u: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-whl-u/igt@i915_selftest@live@gt_pm.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/fi-whl-u/igt@i915_selftest@live@gt_pm.html
Known issues
------------
Here are the changes found in Patchwork_17461 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@i915_selftest@live@gt_pm:
- fi-bsw-kefka: [DMESG-FAIL][7] -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-bsw-kefka/igt@i915_selftest@live@gt_pm.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/fi-bsw-kefka/igt@i915_selftest@live@gt_pm.html
- fi-bdw-5557u: [DMESG-FAIL][9] -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8363/fi-bdw-5557u/igt@i915_selftest@live@gt_pm.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/fi-bdw-5557u/igt@i915_selftest@live@gt_pm.html
Participating hosts (50 -> 43)
------------------------------
Missing (7): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8363 -> Patchwork_17461
CI-20190529: 20190529
CI_DRM_8363: dbfcd301433f070fbf416772817fcec778c8e5d0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5610: 71fed15724898a8f914666093352a964b70a62fc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17461: f36c4e38e7aaac49e129655a59412b0b4f49baf6 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
f36c4e38e7aa drm/i915: Use indirect ctx bb to mend CMD_BUF_CCTL b586ec9ed8ea drm/i915: Add live selftests for indirect ctx batchbuffers 32e6e8c83a82 drm/i915: Add per ctx batchbuffer wa for timestamp 987eaf2a4f2c drm/i915: Add engine scratch register to live_lrc_fixed
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17461/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx