Skip to content

Commit f673d59

Browse files
drm/i915: Enable Wa_16019325821
Some platforms require holding RCS context switches until CCS is idle (the reverse w/a of Wa_14014475959). Some platforms require both versions. Signed-off-by: John Harrison <[email protected]> Reviewed-by: Vinay Belgaumkar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent cec8281 commit f673d59

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -743,21 +743,23 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *rq, u32 *cs)
743743
}
744744

745745
/* Wa_14014475959:dg2 */
746-
#define CCS_SEMAPHORE_PPHWSP_OFFSET 0x540
747-
static u32 ccs_semaphore_offset(struct i915_request *rq)
746+
/* Wa_16019325821 */
747+
#define HOLD_SWITCHOUT_SEMAPHORE_PPHWSP_OFFSET 0x540
748+
static u32 hold_switchout_semaphore_offset(struct i915_request *rq)
748749
{
749750
return i915_ggtt_offset(rq->context->state) +
750-
(LRC_PPHWSP_PN * PAGE_SIZE) + CCS_SEMAPHORE_PPHWSP_OFFSET;
751+
(LRC_PPHWSP_PN * PAGE_SIZE) + HOLD_SWITCHOUT_SEMAPHORE_PPHWSP_OFFSET;
751752
}
752753

753754
/* Wa_14014475959:dg2 */
754-
static u32 *ccs_emit_wa_busywait(struct i915_request *rq, u32 *cs)
755+
/* Wa_16019325821 */
756+
static u32 *hold_switchout_emit_wa_busywait(struct i915_request *rq, u32 *cs)
755757
{
756758
int i;
757759

758760
*cs++ = MI_ATOMIC_INLINE | MI_ATOMIC_GLOBAL_GTT | MI_ATOMIC_CS_STALL |
759761
MI_ATOMIC_MOVE;
760-
*cs++ = ccs_semaphore_offset(rq);
762+
*cs++ = hold_switchout_semaphore_offset(rq);
761763
*cs++ = 0;
762764
*cs++ = 1;
763765

@@ -773,7 +775,7 @@ static u32 *ccs_emit_wa_busywait(struct i915_request *rq, u32 *cs)
773775
MI_SEMAPHORE_POLL |
774776
MI_SEMAPHORE_SAD_EQ_SDD;
775777
*cs++ = 0;
776-
*cs++ = ccs_semaphore_offset(rq);
778+
*cs++ = hold_switchout_semaphore_offset(rq);
777779
*cs++ = 0;
778780

779781
return cs;
@@ -790,8 +792,9 @@ gen12_emit_fini_breadcrumb_tail(struct i915_request *rq, u32 *cs)
790792
cs = gen12_emit_preempt_busywait(rq, cs);
791793

792794
/* Wa_14014475959:dg2 */
793-
if (intel_engine_uses_wa_hold_ccs_switchout(rq->engine))
794-
cs = ccs_emit_wa_busywait(rq, cs);
795+
/* Wa_16019325821 */
796+
if (intel_engine_uses_wa_hold_switchout(rq->engine))
797+
cs = hold_switchout_emit_wa_busywait(rq, cs);
795798

796799
rq->tail = intel_ring_offset(rq, cs);
797800
assert_ring_tail_valid(rq->ring, rq->tail);

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ struct intel_engine_cs {
586586
#define I915_ENGINE_HAS_RCS_REG_STATE BIT(9)
587587
#define I915_ENGINE_HAS_EU_PRIORITY BIT(10)
588588
#define I915_ENGINE_FIRST_RENDER_COMPUTE BIT(11)
589-
#define I915_ENGINE_USES_WA_HOLD_CCS_SWITCHOUT BIT(12)
589+
#define I915_ENGINE_USES_WA_HOLD_SWITCHOUT BIT(12)
590590
unsigned int flags;
591591

592592
/*
@@ -696,10 +696,11 @@ intel_engine_has_relative_mmio(const struct intel_engine_cs * const engine)
696696
}
697697

698698
/* Wa_14014475959:dg2 */
699+
/* Wa_16019325821 */
699700
static inline bool
700-
intel_engine_uses_wa_hold_ccs_switchout(struct intel_engine_cs *engine)
701+
intel_engine_uses_wa_hold_switchout(struct intel_engine_cs *engine)
701702
{
702-
return engine->flags & I915_ENGINE_USES_WA_HOLD_CCS_SWITCHOUT;
703+
return engine->flags & I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
703704
}
704705

705706
#endif /* __INTEL_ENGINE_TYPES_H__ */

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
294294
IS_DG2(gt->i915))
295295
flags |= GUC_WA_HOLD_CCS_SWITCHOUT;
296296

297+
/* Wa_16019325821 */
298+
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
299+
flags |= GUC_WA_RCS_CCS_SWITCHOUT;
300+
297301
/*
298302
* Wa_14012197797
299303
* Wa_22011391025

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@
9696
#define GUC_WA_GAM_CREDITS BIT(10)
9797
#define GUC_WA_DUAL_QUEUE BIT(11)
9898
#define GUC_WA_RCS_RESET_BEFORE_RC6 BIT(13)
99-
#define GUC_WA_CONTEXT_ISOLATION BIT(15)
10099
#define GUC_WA_PRE_PARSER BIT(14)
100+
#define GUC_WA_CONTEXT_ISOLATION BIT(15)
101+
#define GUC_WA_RCS_CCS_SWITCHOUT BIT(16)
101102
#define GUC_WA_HOLD_CCS_SWITCHOUT BIT(17)
102103
#define GUC_WA_POLLCS BIT(18)
103104
#define GUC_WA_RCS_REGS_IN_CCS_REGS_LIST BIT(21)

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4502,7 +4502,12 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
45024502
if (engine->class == COMPUTE_CLASS)
45034503
if (IS_GFX_GT_IP_STEP(engine->gt, IP_VER(12, 70), STEP_A0, STEP_B0) ||
45044504
IS_DG2(engine->i915))
4505-
engine->flags |= I915_ENGINE_USES_WA_HOLD_CCS_SWITCHOUT;
4505+
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
4506+
4507+
/* Wa_16019325821 */
4508+
if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) &&
4509+
IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71)))
4510+
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
45064511

45074512
/*
45084513
* TODO: GuC supports timeslicing and semaphores as well, but they're

0 commit comments

Comments
 (0)