[Intel-xe] [PATCH 2/6] drm/xe: Use full_gt batchbuffer allocation for media tiles.

Matt Roper matthew.d.roper at intel.com
Mon Apr 3 20:27:25 UTC 2023


On Fri, Mar 31, 2023 at 12:24:15PM +0200, Maarten Lankhorst wrote:
> This fixes an oops on media tiles, because we don't initialise the
> bb pool.
> ---
>  drivers/gpu/drm/xe/xe_gt.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index bc821f431c45..c7a2e9baabfb 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -237,6 +237,10 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt)
>  		struct xe_engine *e, *nop_e;
>  		struct xe_vm *vm;
>  		void *default_lrc;
> +		struct xe_gt *full_gt = gt;
> +
> +		if (xe_gt_is_media_type(gt))
> +			full_gt = xe_find_full_gt(gt);
>  
>  		if (gt->default_lrc[hwe->class])
>  			continue;
> @@ -262,7 +266,7 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt)
>  		}
>  
>  		/* Prime golden LRC with known good state */
> -		err = emit_wa_job(gt, e);
> +		err = emit_wa_job(full_gt, e);

If we pass the primary GT here, then we'll take the wrong path in
bb_prefetch().  That doesn't actually matter very much (we'll just
overestimate the padding needed for media engines, which is safe and
something we already do for BCS engines), but we should probably just
drop !xe_gt_is_media_type(gt) condition there as part of this patch
since it will always be true now.


Matt

>  		if (err) {
>  			drm_err(&xe->drm, "gt%d, hwe %s, guc_id=%d, emit_wa_job,e failed=%d",
>  				gt->info.id, hwe->name, e->guc->id, err);
> @@ -279,7 +283,7 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt)
>  		}
>  
>  		/* Switch to different LRC */
> -		err = emit_nop_job(gt, nop_e);
> +		err = emit_nop_job(full_gt, nop_e);
>  		if (err) {
>  			drm_err(&xe->drm, "gt%d, hwe %s, guc_id=%d, emit_nop_job,nop_e failed=%d",
>  				gt->info.id, hwe->name, nop_e->guc->id, err);
> @@ -287,7 +291,7 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt)
>  		}
>  
>  		/* Reload golden LRC to record the effect of any indirect W/A */
> -		err = emit_nop_job(gt, e);
> +		err = emit_nop_job(full_gt, e);
>  		if (err) {
>  			drm_err(&xe->drm, "gt%d, hwe %s, guc_id=%d, emit_nop_job,e failed=%d",
>  				gt->info.id, hwe->name, e->guc->id, err);
> -- 
> 2.34.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list