Skip to content

Commit 7ad6a8f

Browse files
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: John Harrison <[email protected]> Reviewed-by: Vinay Belgaumkar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6cc7a5c commit 7ad6a8f

File tree

6 files changed

+38
-9
lines changed

6 files changed

+38
-9
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *rq, u32 *cs)
744744

745745
/* Wa_14014475959:dg2 */
746746
/* Wa_16019325821 */
747+
/* Wa_14019159160 */
747748
#define HOLD_SWITCHOUT_SEMAPHORE_PPHWSP_OFFSET 0x540
748749
static u32 hold_switchout_semaphore_offset(struct i915_request *rq)
749750
{
@@ -753,6 +754,7 @@ static u32 hold_switchout_semaphore_offset(struct i915_request *rq)
753754

754755
/* Wa_14014475959:dg2 */
755756
/* Wa_16019325821 */
757+
/* Wa_14019159160 */
756758
static u32 *hold_switchout_emit_wa_busywait(struct i915_request *rq, u32 *cs)
757759
{
758760
int i;
@@ -793,6 +795,7 @@ gen12_emit_fini_breadcrumb_tail(struct i915_request *rq, u32 *cs)
793795

794796
/* Wa_14014475959:dg2 */
795797
/* Wa_16019325821 */
798+
/* Wa_14019159160 */
796799
if (intel_engine_uses_wa_hold_switchout(rq->engine))
797800
cs = hold_switchout_emit_wa_busywait(rq, cs);
798801

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ intel_engine_has_relative_mmio(const struct intel_engine_cs * const engine)
697697

698698
/* Wa_14014475959:dg2 */
699699
/* Wa_16019325821 */
700+
/* Wa_14019159160 */
700701
static inline bool
701702
intel_engine_uses_wa_hold_switchout(struct intel_engine_cs *engine)
702703
{

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,11 @@ enum {
101101
GUC_CONTEXT_POLICIES_KLV_NUM_IDS = 5,
102102
};
103103

104+
/*
105+
* Workaround keys:
106+
*/
107+
enum {
108+
GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE = 0x9001,
109+
};
110+
104111
#endif /* _ABI_GUC_KLVS_ABI_H */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
295295
flags |= GUC_WA_HOLD_CCS_SWITCHOUT;
296296

297297
/* Wa_16019325821 */
298+
/* Wa_14019159160 */
298299
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
299300
flags |= GUC_WA_RCS_CCS_SWITCHOUT;
300301

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

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,25 @@ guc_capture_prep_lists(struct intel_guc *guc)
815815
return PAGE_ALIGN(total_size);
816816
}
817817

818+
/* Wa_14019159160 */
819+
static u32 guc_waklv_ra_mode(struct intel_guc *guc, u32 offset, u32 remain)
820+
{
821+
u32 size;
822+
u32 klv_entry[] = {
823+
/* 16:16 key/length */
824+
FIELD_PREP(GUC_KLV_0_KEY, GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE) |
825+
FIELD_PREP(GUC_KLV_0_LEN, 0),
826+
/* 0 dwords data */
827+
};
828+
829+
size = sizeof(klv_entry);
830+
GEM_BUG_ON(remain < size);
831+
832+
iosys_map_memcpy_to(&guc->ads_map, offset, klv_entry, size);
833+
834+
return size;
835+
}
836+
818837
static void guc_waklv_init(struct intel_guc *guc)
819838
{
820839
struct intel_gt *gt = guc_to_gt(guc);
@@ -830,15 +849,12 @@ static void guc_waklv_init(struct intel_guc *guc)
830849
offset = guc_ads_waklv_offset(guc);
831850
remain = guc_ads_waklv_size(guc);
832851

833-
/*
834-
* Add workarounds here:
835-
*
836-
* if (want_wa_<name>) {
837-
* size = guc_waklv_<name>(guc, offset, remain);
838-
* offset += size;
839-
* remain -= size;
840-
* }
841-
*/
852+
/* Wa_14019159160 */
853+
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) {
854+
size = guc_waklv_ra_mode(guc, offset, remain);
855+
offset += size;
856+
remain -= size;
857+
}
842858

843859
size = guc_ads_waklv_size(guc) - remain;
844860
if (!size)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,6 +4505,7 @@ static void guc_default_vfuncs(struct intel_engine_cs *engine)
45054505
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;
45064506

45074507
/* Wa_16019325821 */
4508+
/* Wa_14019159160 */
45084509
if ((engine->class == COMPUTE_CLASS || engine->class == RENDER_CLASS) &&
45094510
IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71)))
45104511
engine->flags |= I915_ENGINE_USES_WA_HOLD_SWITCHOUT;

0 commit comments

Comments
 (0)