On Mon, 28 Nov 2011 21:35:30 +0100 Daniel Vetter <daniel.vetter at ffwll.ch> wrote: > This just adds the setup and teardown code for the ppgtt PDE and the > last-level pagetables, which are fixed for the entire lifetime, at > least for the moment. > > v2: Kill the stray debug printk noted by and improve the pte > definitions as suggested by Chris Wilson. > > Signed-Off-by: Daniel Vetter <daniel.vetter at ffwll.ch> > --- > drivers/gpu/drm/i915/i915_dma.c | 14 +++- > drivers/gpu/drm/i915/i915_drv.h | 18 +++++ > drivers/gpu/drm/i915/i915_gem_gtt.c | 133 +++++++++++++++++++++++++++++++++++ > drivers/gpu/drm/i915/i915_reg.h | 18 +++++ > 4 files changed, 181 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c > index fd617fb..9d9a92c 100644 > --- a/drivers/gpu/drm/i915/i915_dma.c > +++ b/drivers/gpu/drm/i915/i915_dma.c > @@ -1199,13 +1199,21 @@ static int i915_load_gem_init(struct drm_device *dev) > * at the last page of the aperture. One page should be enough to > * keep any prefetching inside of the aperture. > */ > - i915_gem_do_init(dev, 0, mappable_size, gtt_size - PAGE_SIZE); > + i915_gem_do_init(dev, 0, mappable_size, gtt_size - PAGE_SIZE - 512*PAGE_SIZE); > + > + if (HAS_ALIASING_PPGTT(dev)) { > + ret = i915_gem_init_aliasing_ppgtt(dev); > + if (ret) > + return ret; > + } Not sure if you fixed this based on our IRC conversation. The size belongs in the HAS_ALIASING block. Also, I'd prefer NUM_PDEs or something similar. Finally, if you put the PDEs at the top, couldn't we get rid of the scratch page? Ben