[Intel-gfx] [PATCH 03/11] drm/i915: initialization/teardown for the aliasing ppgtt

Daniel Vetter daniel at ffwll.ch
Wed Nov 30 09:07:14 CET 2011


On Tue, Nov 29, 2011 at 03:29:39PM -0800, Ben Widawsky wrote:
> On Mon, Nov 28, 2011 at 09:35:30PM +0100, Daniel Vetter 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>
> The last patch you sent out seems fine to me. Just one final unrelated
> question.
> > ---
> 
> > +/* PPGTT support for Sandybdrige/Gen6 and later */
> > +static void i915_ppgtt_clear_range(struct i915_hw_ppgtt *ppgtt,
> > +				   unsigned first_entry,
> > +				   unsigned num_entries)
> > +{
> > +	int i, j;
> > +	uint32_t *pt_vaddr;
> > +	uint32_t scratch_pte;
> > +
> > +	scratch_pte = GEN6_PTE_ADDR_ENCODE(ppgtt->scratch_page_dma_addr);
> > +	scratch_pte |= GEN6_PTE_VALID | GEN6_PTE_CACHE_LLC;
> > +
> > +	for (i = 0; i < ppgtt->num_pd_entries; i++) {
> > +		pt_vaddr = kmap_atomic(ppgtt->pt_pages[i]);
> > +
> > +		for (j = 0; j < I915_PPGTT_PT_ENTRIES; j++)
> > +			pt_vaddr[j] = scratch_pte;
> > +
> > +		kunmap_atomic(pt_vaddr);
> > +	}
> > +
> > +}
> 
> Why did you make the pages valid and point to scratch? It would seem
> this is a really good opportunity to take advantage of page faults, and
> allow us in the future to give useful info back to userspace.

This patch set sneaks in ppgtt in transparent way an hence we may not
break anything. And it has already some decent potential for breakage, so
I don't want to tempt the dragons too much. I'm fine with trying this as a
later patch (maybe also for the global gtt, because that's now only used
by display and ringbuffers, and these don't prefetch afaik). Honestly
haven't bothered to test it at all.
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list