[Intel-gfx] [PATCH 2/9] drm/i915/gtt: Use a common type for page directories

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 11 19:52:01 UTC 2019


Quoting Chris Wilson (2019-06-11 20:41:59)
> Quoting Mika Kuoppala (2019-06-11 18:27:24)
> >  struct i915_page_table {
> >         struct i915_page_dma base;
> > -       atomic_t used_ptes;
> > +       atomic_t used;
> >  };
> >  
> >  struct i915_page_directory {
> >         struct i915_page_dma base;
> > -
> > -       struct i915_page_table *page_table[I915_PDES]; /* PDEs */
> > -       atomic_t used_pdes;
> > -       spinlock_t lock;
> > -};
> > -
> > -struct i915_page_directory_pointer {
> > -       struct i915_page_dma base;
> > -       struct i915_page_directory **page_directory;
> > -       atomic_t used_pdpes;
> > -       spinlock_t lock;
> > -};
> > -
> > -struct i915_pml4 {
> > -       struct i915_page_dma base;
> > -       struct i915_page_directory_pointer *pdps[GEN8_PML4ES_PER_PML4];
> > +       atomic_t used;
> >         spinlock_t lock;
> > +       void *entry[0];
> >  };
> 
> And always (albeit with a single bsw discrepancy) 512. At the very least
> you can alias a fixed sized variant over the top to remove the extra
> pointer chasing you added.

I would float your make bsw behave identically patch. In the grand
scheme of things, no one will ever notice that bsw alone saved a couple
of pages per GTT.
-Chris


More information about the Intel-gfx mailing list