From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Move to CPU domain in pwrite/pread
Date: Wed, 12 Nov 2014 17:10:31 +0200 [thread overview]
Message-ID: <20141112151031.GQ10649@intel.com> (raw)
In-Reply-To: <20141112150130.GP8220@nuc-i3427.alporthouse.com>
On Wed, Nov 12, 2014 at 03:01:30PM +0000, Chris Wilson wrote:
> On Wed, Nov 12, 2014 at 04:57:10PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Currently it's possible to get visible cache dirt on scanout on LLC
> > machines when using pwrite on the future scanout bo if its cache_level
> > is already NONE.
> >
> > pwrite's "does this need clflush?" checks would decide that no clflush
> > is necessary since the bo isn't currently pinned to the display and LLC
> > makes everything else coherent. The subsequent set_cache_level(NONE)
> > would also do nothing since cache_level is already correct. And hence
> > no clflush will be performed and we flip to a bo which can still have
> > dirty data in the caches.
> >
> > To correctly track the cache dirtyness move the object to CPU write
> > domain in pwrite. This cures the cache dirt since we explicitly flush
> > the CPU write domain in the pin_to_display path.
> >
> > Give pread the same treatment simply in the name of symmetry.
> >
> > v2: Use trace_i915_gem_object_change_domain() and provide some kind
> > of commit message
> >
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > v1 was floated on irc.
>
> Doesn't it still suffer the same problem that only accessed cache lines
> are clflushed, but we declare the entire object as valid?
Ah in case there's already dirty stuff in the cache before the pwrite?
Hmm, yeah that would be a problem.
How about about clearing write_domain in the end only if write_domain
was != CPU in the start?
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-12 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 14:57 [PATCH v2] drm/i915: Move to CPU domain in pwrite/pread ville.syrjala
2014-11-12 15:01 ` Chris Wilson
2014-11-12 15:10 ` Ville Syrjälä [this message]
2014-11-12 15:30 ` Daniel Vetter
2014-11-13 4:10 ` shuang.he
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=20141112151031.GQ10649@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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