intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Eric Anholt <eric@anholt.net>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/i915: Add an interface to dynamically change the cache level
Date: Wed, 30 Mar 2011 18:16:11 +0100	[thread overview]
Message-ID: <849307$c839fg@azsmga001.ch.intel.com> (raw)
In-Reply-To: <87wrjg4k8k.fsf@pollan.anholt.net>

On Wed, 30 Mar 2011 09:59:55 -0700, Eric Anholt <eric@anholt.net> wrote:
> On Wed, 30 Mar 2011 08:09:47 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > The series looks really good, only one quibble below.
> > 
> > On Tue, 29 Mar 2011 16:59:53 -0700, Eric Anholt <eric@anholt.net> wrote:
> > > +int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
> > > +				    enum i915_cache_level cache_level)
> > > +	if (cache_level == I915_CACHE_NONE) {
> > > +		/* If we're coming frm LLC cached, then we haven't
> > > +		 * actually been tracking whether the data is in the
> > > +		 * CPU cache or not, since we only allow one bit set
> > > +		 * in obj->write_domain.  Just set it to the CPU cache
> > > +		 * for now.
> > > +		 */
> > > +		BUG_ON(obj->base.write_domain & I915_GEM_GPU_DOMAINS);
> > > +		obj->base.write_domain = I915_GEM_DOMAIN_CPU;
> > > +	}
> > 
> > [We can rearrange the code to convert the BUG_ON into a
> >  if (WARN_ON()) return -EBUSY;.]
> > 
> > I think this is overkill, at least by my interpretation of the old BLT
> > docs which imply that cache line invalidation (both CPU and GPU) is done
> > for snooped PTEs on MI_FLUSH.
> 
> And what about a CPU write through the GTT?

Even on SNB these are still UC. And we should try hard not to, as the
specs give dire warnings about writing to snooped PTEs through the GTT.
(Since we will bypass the caches with the write, aiui, and cause
confusion.)

> Or the CPU writes to the
> pages before we turned them into a BO and cleared their CPU write domain
> flag without actually clflushing them?

That's a valid argument. Just frustrated by the necessity.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2011-03-30 17:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 23:59 reduced LLC caching series Eric Anholt
2011-03-29 23:59 ` [PATCH 1/6] drm/i915: Rename agp_type to cache_level Eric Anholt
2011-03-29 23:59 ` [PATCH 2/6] drm/i915: Mark the cursor and the overlay as being part of the display planes Eric Anholt
2011-03-29 23:59 ` [PATCH 3/6] drm/i915: Do not clflush snooped objects Eric Anholt
2011-03-29 23:59 ` [PATCH 4/6] drm/i915: Add an interface to dynamically change the cache level Eric Anholt
2011-03-30  7:09   ` Chris Wilson
2011-03-30 16:59     ` Eric Anholt
2011-03-30 17:16       ` Chris Wilson [this message]
2011-03-30 21:45         ` Eric Anholt
2011-03-31  7:29           ` Chris Wilson
2011-03-31 20:10             ` Eric Anholt
2011-03-29 23:59 ` [PATCH 5/6] drm/i915: Use the uncached domain for the display planes v2 Eric Anholt
2011-03-29 23:59 ` [PATCH 6/6] drm/i915: Use the LLC mode on gen6 for everything but display Eric Anholt
2011-03-30 22:35 ` reduced LLC caching series Michael Larabel

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='849307$c839fg@azsmga001.ch.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=eric@anholt.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).