[Intel-xe] [PATCH 07/19] drm/xe/rtp: Add match helper for gslice fused off

Matt Roper matthew.d.roper at intel.com
Wed Mar 8 22:48:36 UTC 2023


On Wed, Mar 08, 2023 at 02:29:14PM -0800, Lucas De Marchi wrote:
> On Wed, Mar 08, 2023 at 02:07:07PM -0800, Matt Roper wrote:
> > On Tue, Mar 07, 2023 at 01:24:34AM -0800, Lucas De Marchi wrote:
> > > Add match helper to detect when the first gslice is fused off, as needed
> > > by future workarounds.
> > > 
> > > Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/xe_rtp.c | 10 ++++++++++
> > >  drivers/gpu/drm/xe/xe_rtp.h | 11 +++++++++++
> > >  2 files changed, 21 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
> > > index 0d2f51bb06e8..dc5a1c62d531 100644
> > > --- a/drivers/gpu/drm/xe/xe_rtp.c
> > > +++ b/drivers/gpu/drm/xe/xe_rtp.c
> > > @@ -8,6 +8,7 @@
> > >  #include <drm/xe_drm.h>
> > > 
> > >  #include "xe_gt.h"
> > > +#include "xe_gt_topology.h"
> > >  #include "xe_macros.h"
> > >  #include "xe_reg_sr.h"
> > > 
> > > @@ -170,3 +171,12 @@ bool xe_rtp_match_first_render_or_compute(const struct xe_gt *gt,
> > >  	return render_compute_mask &&
> > >  		hwe->engine_id == __ffs(render_compute_mask);
> > >  }
> > > +
> > > +bool xe_rtp_match_first_gslice_fused_off(const struct xe_gt *gt,
> > > +					 const struct xe_hw_engine *hwe)
> > > +{
> > > +	unsigned int dss = xe_dss_mask_group_ffs(gt->fuse_topo.g_dss_mask, 0, 0);
> > > +	unsigned int dss_per_grp = gt_to_xe(gt)->info.platform == XE_PVC ? 8 : 4;
> > 
> > As an Xe_HPC platform, PVC doesn't have a geometry pipeline, so there's
> > no such thing as a gslice here.  It looks like this would be trying to
> > check the first cslice for PVC, which is confusing.  Should we just have
> > an XE_WARN_ON() if something is trying to check gslices on a platform
> > without geometry?
> 
> humn.. I thought it would be fine to just return false like we are doing
> here, meaning it's not that the gslice is fused off, it's that this
> platform doesn't contain geometry at all. Note we are using
> gt->fuse_topo.g_dss_mask above.
> 
> This is for Wa_1308578152 on DG2.

Yeah, we're doing the right thing on DG2.  But if someone tries to use
this match function for a PVC workaround in the future, it means they've
definitely made a mistake, so we should probably warn them about that.
Silently returning cslice information when they asked for gslice may not
actually be the right thing (maybe they actually intended mslice or
bslice instead?).


Matt

> 
> Lucas De Marchi
> 
> > 
> > 
> > Matt
> > 
> > > +
> > > +	return dss >= dss_per_grp;
> > > +}
> > > diff --git a/drivers/gpu/drm/xe/xe_rtp.h b/drivers/gpu/drm/xe/xe_rtp.h
> > > index 433f0cbff57f..4140ef507fa0 100644
> > > --- a/drivers/gpu/drm/xe/xe_rtp.h
> > > +++ b/drivers/gpu/drm/xe/xe_rtp.h
> > > @@ -427,4 +427,15 @@ bool xe_rtp_match_even_instance(const struct xe_gt *gt,
> > >  bool xe_rtp_match_first_render_or_compute(const struct xe_gt *gt,
> > >  					  const struct xe_hw_engine *hwe);
> > > 
> > > +/*
> > > + * xe_rtp_match_first_gslice_fused_off - Match when first gslice is fused off
> > > + *
> > > + * @gt: GT structure
> > > + * @hwe: Engine instance
> > > + *
> > > + * Returns: true if first gslice is fused off, false otherwise.
> > > + */
> > > +bool xe_rtp_match_first_gslice_fused_off(const struct xe_gt *gt,
> > > +					 const struct xe_hw_engine *hwe);
> > > +
> > >  #endif
> > > --
> > > 2.39.0
> > > 
> > 
> > -- 
> > Matt Roper
> > Graphics Software Engineer
> > Linux GPU Platform Enablement
> > Intel Corporation

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


More information about the Intel-xe mailing list