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

Ben Widawsky ben at bwidawsk.net
Wed Nov 30 00:29:39 CET 2011


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.

Assuming you have a good answer, can you put it in the commit, or as a
comment.

Ben




More information about the Intel-gfx mailing list