Commit 7ad6a8fa authored by John Harrison's avatar John Harrison

drm/i915/guc: Enable Wa_14019159160

Use the new w/a KLV support to enable a MTL w/a. Note, this w/a is a
super-set of Wa_16019325821, so requires turning that one as well as
setting the new flag for Wa_14019159160 itself.
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarVinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240223205632.1621019-4-John.C.Harrison@Intel.com
parent 6cc7a5c7
...@@ -744,6 +744,7 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *rq, u32 *cs) ...@@ -744,6 +744,7 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *rq, u32 *cs)
/* Wa_14014475959:dg2 */ /* Wa_14014475959:dg2 */
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
#define HOLD_SWITCHOUT_SEMAPHORE_PPHWSP_OFFSET 0x540 #define HOLD_SWITCHOUT_SEMAPHORE_PPHWSP_OFFSET 0x540
static u32 hold_switchout_semaphore_offset(struct i915_request *rq) static u32 hold_switchout_semaphore_offset(struct i915_request *rq)
{ {
...@@ -753,6 +754,7 @@ static u32 hold_switchout_semaphore_offset(struct i915_request *rq) ...@@ -753,6 +754,7 @@ static u32 hold_switchout_semaphore_offset(struct i915_request *rq)
/* Wa_14014475959:dg2 */ /* Wa_14014475959:dg2 */
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
static u32 *hold_switchout_emit_wa_busywait(struct i915_request *rq, u32 *cs) static u32 *hold_switchout_emit_wa_busywait(struct i915_request *rq, u32 *cs)
{ {
int i; int i;
...@@ -793,6 +795,7 @@ gen12_emit_fini_breadcrumb_tail(struct i915_request *rq, u32 *cs) ...@@ -793,6 +795,7 @@ gen12_emit_fini_breadcrumb_tail(struct i915_request *rq, u32 *cs)
/* Wa_14014475959:dg2 */ /* Wa_14014475959:dg2 */
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
if (intel_engine_uses_wa_hold_switchout(rq->engine)) if (intel_engine_uses_wa_hold_switchout(rq->engine))
cs = hold_switchout_emit_wa_busywait(rq, cs); cs = hold_switchout_emit_wa_busywait(rq, cs);
......
...@@ -697,6 +697,7 @@ intel_engine_has_relative_mmio(const struct intel_engine_cs * const engine) ...@@ -697,6 +697,7 @@ intel_engine_has_relative_mmio(const struct intel_engine_cs * const engine)
/* Wa_14014475959:dg2 */ /* Wa_14014475959:dg2 */
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
static inline bool static inline bool
intel_engine_uses_wa_hold_switchout(struct intel_engine_cs *engine) intel_engine_uses_wa_hold_switchout(struct intel_engine_cs *engine)
{ {
......
...@@ -101,4 +101,11 @@ enum { ...@@ -101,4 +101,11 @@ enum {
GUC_CONTEXT_POLICIES_KLV_NUM_IDS = 5, GUC_CONTEXT_POLICIES_KLV_NUM_IDS = 5,
}; };
/*
* Workaround keys:
*/
enum {
GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE = 0x9001,
};
#endif /* _ABI_GUC_KLVS_ABI_H */ #endif /* _ABI_GUC_KLVS_ABI_H */
...@@ -295,6 +295,7 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc) ...@@ -295,6 +295,7 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
flags |= GUC_WA_HOLD_CCS_SWITCHOUT; flags |= GUC_WA_HOLD_CCS_SWITCHOUT;
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
flags |= GUC_WA_RCS_CCS_SWITCHOUT; flags |= GUC_WA_RCS_CCS_SWITCHOUT;
......
...@@ -815,6 +815,25 @@ guc_capture_prep_lists(struct intel_guc *guc) ...@@ -815,6 +815,25 @@ guc_capture_prep_lists(struct intel_guc *guc)
return PAGE_ALIGN(total_size); return PAGE_ALIGN(total_size);
} }
/* Wa_14019159160 */
static u32 guc_waklv_ra_mode(struct intel_guc *guc, u32 offset, u32 remain)
{
u32 size;
u32 klv_entry[] = {
/* 16:16 key/length */
FIELD_PREP(GUC_KLV_0_KEY, GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE) |
FIELD_PREP(GUC_KLV_0_LEN, 0),
/* 0 dwords data */
};
size = sizeof(klv_entry);
GEM_BUG_ON(remain < size);
iosys_map_memcpy_to(&guc->ads_map, offset, klv_entry, size);
return size;
}
static void guc_waklv_init(struct intel_guc *guc) static void guc_waklv_init(struct intel_guc *guc)
{ {
struct intel_gt *gt = guc_to_gt(guc); struct intel_gt *gt = guc_to_gt(guc);
...@@ -830,15 +849,12 @@ static void guc_waklv_init(struct intel_guc *guc) ...@@ -830,15 +849,12 @@ static void guc_waklv_init(struct intel_guc *guc)
offset = guc_ads_waklv_offset(guc); offset = guc_ads_waklv_offset(guc);
remain = guc_ads_waklv_size(guc); remain = guc_ads_waklv_size(guc);
/* /* Wa_14019159160 */
* Add workarounds here: if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) {
* size = guc_waklv_ra_mode(guc, offset, remain);
* if (want_wa_<name>) { offset += size;
* size = guc_waklv_<name>(guc, offset, remain); remain -= size;
* offset += size; }
* remain -= size;
* }
*/
size = guc_ads_waklv_size(guc) - remain; size = guc_ads_waklv_size(guc) - remain;
if (!size) if (!size)
......
...@@ -4505,6 +4505,7 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine) ...@@ -4505,6 +4505,7 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT; engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
/* Wa_16019325821 */ /* Wa_16019325821 */
/* Wa_14019159160 */
if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) && if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) &&
IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71))) IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71)))
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT; engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment