[PATCH 1/5] drm/xe: Fix GT workaround handling

Tvrtko Ursulin tvrtko.ursulin at igalia.com
Thu Jan 30 08:59:25 UTC 2025


On 29/01/2025 17:46, Lucas De Marchi wrote:
> On Wed, Jan 29, 2025 at 03:56:23PM +0000, Tvrtko Ursulin wrote:
>> Any rules using engine matching are currently broken due RTP
>> processing happening in early init before the list of hardware
>> engines has been initialised.
> 
> for *gt* workarounds, it only makes sense to have an engine check
> if it's something like
>      XE_RTP_ENTRY_FLAG(FOREACH_ENGINE)
> 
> ... as it doesn't have an engine context. It will loop through all the
> engines on that gt and add the entry for that register and it should be
> able to do that before the complete engine setup. But indeed, a
> quick look on my tgl doesn't show e.g. 14011060649 as being used:
> 
> cat /sys/kernel/debug/dri/0/gt0/workarounds

Exactly.

> I will have to take another look.
> 
> It would be useful to dump gt0/workarounds and gt0/register-save-restore
> and check for not having a setting that should be there, adding it to
> the commit message.

Ok. I did not stop gt0/register-save-restore.

>> Fix it my moving the processing to later in the init phase.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
>> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>> Cc: Matt Roper <matthew.d.roper at intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_gt.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
>> index 01a4a852b8f4..7feb4b6fb976 100644
>> --- a/drivers/gpu/drm/xe/xe_gt.c
>> +++ b/drivers/gpu/drm/xe/xe_gt.c
>> @@ -380,10 +380,6 @@ int xe_gt_init_early(struct xe_gt *gt)
>>     if (err)
>>         return err;
>>
>> -    xe_wa_process_gt(gt);
>> -    xe_wa_process_oob(gt);
>> -    xe_tuning_process_gt(gt);
>> -
>>     xe_force_wake_init_gt(gt, gt_to_fw(gt));
>>     spin_lock_init(&gt->global_invl_lock);
>>
>> @@ -616,6 +612,10 @@ int xe_gt_init(struct xe_gt *gt)
>>     if (err)
>>         return err;
>>
>> +    xe_wa_process_gt(gt);
>> +    xe_wa_process_oob(gt);
>> +    xe_tuning_process_gt(gt);
> 
> that is too late as we need the gt WAs in place before initializing GuC.

Yeah it was a fumble. I did find the code paths where engines are 
initialised:

xe_gt_init						
   gt_fw_domain_init
     xe_hw_engines_init_early
       hw_engine_init_early
       	  hwe->name = ...

And then for some reason moved the calls to not straight after 
gt_fw_domain_init. Will re-check and respin.

Regards,

Tvrtko

> 
> Lucas De Marchi
> 
>> +
>>     xe_force_wake_init_engines(gt, gt_to_fw(gt));
>>
>>     err = all_fw_domain_init(gt);
>> -- 
>> 2.48.0
>>


More information about the Intel-xe mailing list