[Intel-gfx] [PATCH 02/11] drm/i915/gtt: Wrap page_table with page_directory

Chris Wilson chris at chris-wilson.co.uk
Tue Jul 9 14:46:56 UTC 2019


Quoting Mika Kuoppala (2019-07-09 15:43:15)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> >  static struct i915_page_directory *__alloc_pd(void)
> >  {
> >       struct i915_page_directory *pd;
> >  
> >       pd = kmalloc(sizeof(*pd), I915_GFP_ALLOW_FAIL);
> > -
> >       if (unlikely(!pd))
> >               return NULL;
> >  
> > -     memset(&pd->base, 0, sizeof(pd->base));
> > -     atomic_set(&pd->used, 0);
> > +     atomic_set(px_used(pd), 0);
> >       spin_lock_init(&pd->lock);
> >  
> > -     /* for safety */
> > -     pd->entry[0] = NULL;
> 
> Perhaps yes this is superfluous as we (almost) always init after this,
> or in the next call to vm. The blowout would be clearer if we forget,
> but can live without.

Further down the line, we don't even allocate it if we don't use it :)
-Chris


More information about the Intel-gfx mailing list