[Intel-gfx] [PATCH 2/5] drm/i915/gtt: Add some range asserts

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 21 16:53:38 UTC 2019


Quoting Mika Kuoppala (2019-08-21 17:24:05)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > These should have been validated in the upper layers, but for sanity's
> > sake, repeat them.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_gtt.c | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index b06d1d9054ba..0b81e0b64393 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -965,8 +965,10 @@ static u64 __gen8_ppgtt_clear(struct i915_address_space * const vm,
> >       const struct i915_page_scratch * const scratch = &vm->scratch[lvl];
> >       unsigned int idx, len;
> >  
> > +     GEM_BUG_ON(end > vm->total >> GEN8_PTE_SHIFT);
> 
> I am having thoughts to clean all underlying handling to
> use page indexes consistently...

I would agree, pfn throughout does make a certain sense for the page
directory trees.
-Chris


More information about the Intel-gfx mailing list