From: Ben Widawsky <ben@bwidawsk.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/11] drm/i915: initialization/teardown for the aliasing ppgtt
Date: Wed, 30 Nov 2011 17:35:33 +0000 [thread overview]
Message-ID: <20111130173533.GA11906@cloud01> (raw)
In-Reply-To: <20111130080920.GC3823@phenom.ffwll.local>
On Wed, Nov 30, 2011 at 09:09:20AM +0100, Daniel Vetter wrote:
> On Tue, Nov 29, 2011 at 03:41:40PM -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@ffwll.ch>
> > Crap... one more point
> >
> > > +/* 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);
> > > + }
> > > +
> > > +}
> >
> > Don't you want to clflush here (unless I missed it somewhere else).
> > Ideally I think you'd also flush the TLB with a PIPE_CONTROL, but I
> > guess so long as we have that bit set that always flushes we're okay on
> > that one... Still feel we need a clflush though.
>
> Afaics ppgtt pte fetches are coherent with the cpu irrespective of the pte
> cacheability control setting. So like for llc cached buffers, no flushing
> needed at all. We also have a fair share of tests that trash mappings like
> crazy (and easily hit all the historical tlb issues we've had), so I'm
> fairly sure it works.
Well that's convenient. In that case, given how often we invalidate
TLBs, it'd be really nice if we could be smart about managing these
cache lines. Perhaps as part of execbuf we could warm up the the ptes?
next prev parent reply other threads:[~2011-11-30 17:35 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-28 20:35 [PATCH 00/11] aliasing ppgtt support v2 Daniel Vetter
2011-11-28 20:35 ` [PATCH 01/11] agp/intel-gtt: export the scratch page dma address Daniel Vetter
2011-11-29 23:52 ` Ben Widawsky
2011-11-28 20:35 ` [PATCH 02/11] agp/intel-gtt: export the gtt pagetable iomapping Daniel Vetter
2011-11-29 23:53 ` Ben Widawsky
2011-11-28 20:35 ` [PATCH 03/11] drm/i915: initialization/teardown for the aliasing ppgtt Daniel Vetter
2011-11-29 18:50 ` Ben Widawsky
2011-11-29 19:06 ` Daniel Vetter
2011-11-29 19:09 ` [PATCH] " Daniel Vetter
2011-11-29 19:54 ` Daniel Vetter
2011-11-29 20:55 ` Daniel Vetter
2011-11-29 23:29 ` [PATCH 03/11] " Ben Widawsky
2011-11-30 8:07 ` Daniel Vetter
2011-11-29 23:41 ` Ben Widawsky
2011-11-30 8:09 ` Daniel Vetter
2011-11-30 17:35 ` Ben Widawsky [this message]
2011-11-29 23:49 ` Ben Widawsky
2011-11-30 9:55 ` Daniel Vetter
2011-11-28 20:35 ` [PATCH 04/11] drm/i915: ppgtt binding/unbinding support Daniel Vetter
2011-11-29 23:46 ` Ben Widawsky
2011-11-28 20:35 ` [PATCH 05/11] drm/i915: ppgtt register definitions Daniel Vetter
2011-11-29 23:57 ` Ben Widawsky
2011-11-30 7:57 ` Daniel Vetter
2011-11-28 20:35 ` [PATCH 06/11] drm/i915: ppgtt debugfs info Daniel Vetter
2011-11-30 0:02 ` Ben Widawsky
2011-11-28 20:35 ` [PATCH 07/11] drm/i915: per-ring fault reg Daniel Vetter
2011-11-30 0:13 ` Eugeni Dodonov
2011-11-30 9:41 ` Daniel Vetter
2011-11-29 9:42 ` [PATCH 00/11] aliasing ppgtt support v2 Chris Wilson
2011-11-30 0:11 ` Eugeni Dodonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111130173533.GA11906@cloud01 \
--to=ben@bwidawsk.net \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.