[PATCH] drm/i915/guc: Enable w/a 14019882105 for DG2 and MTL

John Harrison john.c.harrison at intel.com
Tue May 28 22:36:35 UTC 2024


On 5/28/2024 13:21, Matt Roper wrote:
> On Fri, May 24, 2024 at 06:41:20PM -0700, John.C.Harrison at Intel.com wrote:
>> From: John Harrison <John.C.Harrison at Intel.com>
>>
>> Enable another workaround that is implemented inside the GuC.
>>
>> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h |  1 +
>>   drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c    | 32 ++++++++++++-------
>>   2 files changed, 21 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
>> index 525587cfe1af9..37ff539a6963d 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
>> +++ b/drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
>> @@ -106,6 +106,7 @@ enum {
>>    */
>>   enum {
>>   	GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE				= 0x9001,
>> +	GUC_WORKAROUND_KLV_BLOCK_INTERRUPTS_WHEN_MGSR_BLOCKED		= 0x9002,
>>   };
>>   
>>   #endif /* _ABI_GUC_KLVS_ABI_H */
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
>> index c606bb5e3b7b0..6c382785bc60b 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
>> @@ -815,23 +815,23 @@ guc_capture_prep_lists(struct intel_guc *guc)
>>   	return PAGE_ALIGN(total_size);
>>   }
>>   
>> -/* Wa_14019159160 */
>> -static u32 guc_waklv_ra_mode(struct intel_guc *guc, u32 offset, u32 remain)
>> +static void guc_waklv_enable_simple(struct intel_guc *guc,
>> +				    u32 klv_id, 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_KEY, klv_id) |
>>   		FIELD_PREP(GUC_KLV_0_LEN, 0),
>>   		/* 0 dwords data */
>>   	};
>>   
>>   	size = sizeof(klv_entry);
>> -	GEM_BUG_ON(remain < size);
>> +	GEM_BUG_ON(*remain < size);
>>   
>> -	iosys_map_memcpy_to(&guc->ads_map, offset, klv_entry, size);
>> -
>> -	return size;
>> +	iosys_map_memcpy_to(&guc->ads_map, *offset, klv_entry, size);
>> +	*offset += size;
>> +	*remain -= size;
>>   }
>>   
>>   static void guc_waklv_init(struct intel_guc *guc)
>> @@ -850,11 +850,19 @@ static void guc_waklv_init(struct intel_guc *guc)
>>   	remain = guc_ads_waklv_size(guc);
>>   
>>   	/* Wa_14019159160 */
>> -	if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) {
>> -		size = guc_waklv_ra_mode(guc, offset, remain);
>> -		offset += size;
>> -		remain -= size;
>> -	}
>> +	if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
>> +		guc_waklv_enable_simple(guc,
>> +					GUC_WORKAROUND_KLV_SERIALIZED_RA_MODE,
>> +					&offset, &remain);
>> +
>> +	/* Wa_14019882105 */
> Is this the right number?  When I look up Wa_14019882105 in the
> workaround database, it only lists it as being relevant to A steppings
> of G:20.04.  I don't see entries for 12.70/12.71.  Did it go by a
> different lineage number on the older platforms?
Argh. Copied the wrong number. 2105 is the Xe version, the Gen12 version 
is 16021333562. I think it is two separate actual issues, hence two 
different w/a numbers, but the w/a itself is the same for both. Hmm, 
looks ike 3562 should also be enabled for 12.74. Not sure how I missed 
that, unless that is a recent update?

>
> Also, I notice the Wa_14019159160 we had just above this workaround is
> missing handling for graphics version 12.74.
12.74 is ARL? I think extending that is on my todo list as well. I have 
just been leaving updates to 160 until later because that one is 
horrific. It needs extending to DG2 as well but a whole bunch of tests 
start to fail when it is enabled because they need to be re-written to 
cope with the broken hardware.

John.

>
>
> Matt
>
>> +	if ((GUC_FIRMWARE_VER(guc) >= MAKE_GUC_VER(70, 21, 1)) &&
>> +	    (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) ||
>> +	     IS_MEDIA_GT_IP_RANGE(gt, IP_VER(13, 0), IP_VER(13, 0)) ||
>> +	     IS_DG2(gt->i915)))
>> +		guc_waklv_enable_simple(guc,
>> +					GUC_WORKAROUND_KLV_BLOCK_INTERRUPTS_WHEN_MGSR_BLOCKED,
>> +					&offset, &remain);
>>   
>>   	size = guc_ads_waklv_size(guc) - remain;
>>   	if (!size)
>> -- 
>> 2.43.2
>>



More information about the dri-devel mailing list