[Intel-gfx] [PATCH v2 1/8] drm/i915: make local-memory probing a GT operation

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 26 15:28:32 UTC 2021


Quoting Chris Wilson (2021-01-26 15:22:15)
> Quoting Matthew Auld (2021-01-26 15:12:52)
> > Device local memory is very much a GT thing, therefore it should be the
> > responsibility of the GT to setup the device local memory region.
> > 
> > Suggested-by: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> > Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_gt.c          | 29 +++++++++++++++++++++
> >  drivers/gpu/drm/i915/gt/intel_gt.h          |  1 +
> >  drivers/gpu/drm/i915/gt/intel_region_lmem.c |  3 ++-
> >  drivers/gpu/drm/i915/gt/intel_region_lmem.h |  4 +--
> >  drivers/gpu/drm/i915/i915_drv.c             |  4 +++
> >  drivers/gpu/drm/i915/intel_memory_region.c  |  5 ++--
> >  6 files changed, 40 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> > index d8e1ab412634..989cd2106b09 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> > @@ -39,6 +39,35 @@ void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915)
> >         intel_uc_init_early(&gt->uc);
> >  }
> >  
> > +int intel_gt_probe_lmem(struct intel_gt *gt)
> > +{
> > +       struct drm_i915_private *i915 = gt->i915;
> > +       struct intel_memory_region *mem;
> > +       int id;
> > +       int err;
> > +
> > +       id = INTEL_REGION_LMEM;
> > +       if (!HAS_REGION(i915, id))
> 
> GEM_WARN_ON() for CI checking?
> 
> Feels like something that should only be duplicated by programming
> error, so worth the feedback.

Wait this is !HAS_REGION(). That's even odder.

Surely that we have a region is defined first by HW then by mockery. So
the platform mask check is not required at this point.

What we don't want to do is overwrite an existing i915->mm.regions[id].
-Chris


More information about the Intel-gfx mailing list