[Intel-gfx] [PATCH 2/2] drm/i915/mtl: Add initial gt workarounds

Lucas De Marchi lucas.demarchi at intel.com
Thu Dec 1 17:25:13 UTC 2022


On Thu, Dec 01, 2022 at 01:15:35PM +0000, Tvrtko Ursulin wrote:
>
>On 30/11/2022 23:17, Matt Atwood wrote:
>>From: Matt Roper <matthew.d.roper at intel.com>
>>
>>This patch introduces initial workarounds for mtl platform
>>
>>Bspec:66622
>>
>>Signed-off-by: Matt Atwood <matthew.s.atwood at intel.com>
>>Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
>>---
>>  drivers/gpu/drm/i915/gt/intel_engine_cs.c     |   4 +-
>>  .../drm/i915/gt/intel_execlists_submission.c  |   4 +-
>>  drivers/gpu/drm/i915/gt/intel_gt_mcr.c        |  11 +-
>>  drivers/gpu/drm/i915/gt/intel_gt_regs.h       |   5 +
>>  drivers/gpu/drm/i915/gt/intel_workarounds.c   | 105 +++++++++++++-----
>>  drivers/gpu/drm/i915/gt/uc/intel_guc.c        |   9 +-
>>  .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  10 +-
>>  drivers/gpu/drm/i915/i915_drv.h               |   4 +
>>  drivers/gpu/drm/i915/intel_device_info.c      |   6 +
>>  9 files changed, 121 insertions(+), 37 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
>>index c33e0d72d670..af88d8ab61c1 100644
>>--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
>>+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
>>@@ -1479,7 +1479,9 @@ static int __intel_engine_stop_cs(struct intel_engine_cs *engine,
>>  	 * Wa_22011802037 : gen11, gen12, Prior to doing a reset, ensure CS is
>>  	 * stopped, set ring stop bit and prefetch disable bit to halt CS
>>  	 */
>>-	if (IS_GRAPHICS_VER(engine->i915, 11, 12))
>>+	if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) ||
>>+	    (GRAPHICS_VER(engine->i915) >= 11 &&
>>+	    GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 70)))
>
>Does comment need updating to reflect the workaround applicability? 
>Elsewhere as well. Some are left as dg2 only. Some gen11,gen12 only.

We've been removing these comments as they are redundant with the code
and only ever get out of sync. So I'd say to remove "gen11, gen12".

>
>Then there's a few of this same change logic throught the patch, so I 
>assume a general situation of workarounds applying to only early MTL.
>
> if ((IS_GRAPHICS_VER(engine->i915, 11, 12)) &&
>     !IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_B1, STEP_FOREVER)
>
>Would this be correct and simpler? Not sure about STEP_B1 for start of 
>range, if it is possible to define it. Don't know.. One could perhaps 
>even suggest a new macro to avoid repeated whatever patterna lot.
>
>>  		intel_uncore_write_fw(uncore, RING_MODE_GEN7(engine->mmio_base),
>>  				      _MASKED_BIT_ENABLE(GEN12_GFX_PREFETCH_DISABLE));
>>diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
>>index 49a8f10d76c7..a91c912e35d6 100644
>>--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
>>+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
>>@@ -2992,7 +2992,9 @@ static void execlists_reset_prepare(struct intel_engine_cs *engine)
>>  	 * Wa_22011802037:gen11/gen12: In addition to stopping the cs, we need
>>  	 * to wait for any pending mi force wakeups
>>  	 */
>>-	if (IS_GRAPHICS_VER(engine->i915, 11, 12))
>>+	if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) ||
>>+	    (GRAPHICS_VER(engine->i915) >= 11 &&
>>+	    GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 70)))
>>  		intel_engine_wait_for_pending_mi_fw(engine);
>>  	engine->execlists.reset_ccid = active_ccid(engine);
>>diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
>>index aa070ae57f11..0e90a8f86b27 100644
>>--- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
>>+++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c
>>@@ -164,8 +164,15 @@ void intel_gt_mcr_init(struct intel_gt *gt)
>>  	if (MEDIA_VER(i915) >= 13 && gt->type == GT_MEDIA) {
>>  		gt->steering_table[OADDRM] = xelpmp_oaddrm_steering_table;
>>  	} else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)) {
>>-		fuse = REG_FIELD_GET(GT_L3_EXC_MASK,
>>-				     intel_uncore_read(gt->uncore, XEHP_FUSE4));
>>+		/* Wa_14016747170:mtl-m[a0], mtl-p[a0] */

and here and in other places.

Lucas De Marchi


More information about the Intel-gfx mailing list