public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Drop the overzealous warning from i915_gem_set_cache_level
Date: Wed, 14 Aug 2013 10:49:11 +0200	[thread overview]
Message-ID: <20130814084911.GP9296@phenom.ffwll.local> (raw)
In-Reply-To: <20130813123756.GF7159@intel.com>

On Tue, Aug 13, 2013 at 03:37:56PM +0300, Ville Syrjälä wrote:
> On Tue, Aug 13, 2013 at 01:20:13PM +0100, Chris Wilson wrote:
> > On Tue, Aug 13, 2013 at 03:12:59PM +0300, Ville Syrjälä wrote:
> > > Thinking about this stuff a bit, I think I actually came up with a
> > > scenario where we would currently fail to invalidate the CPU cache
> > > between non-snooped GPU/GTT access and CPU access:
> > > 
> > > 1. make bo non-snooped w/ pin_display=true (wd=0, rd|=gtt)
> > > 2. set to CPU read domain (wd=0 rd|=cpu)
> > > 3. set to GTT (or GPU) write domain (wd=gtt, rd=gtt) -> CPU cache is stale after this point
> > > 4. make bo snooped -> pin_display=true still so we directly set (wd=cpu, rd=cpu)
> > > 5. set to CPU domain -> CPU cache is still stale
> > 
> > You will also find the scanout reads stale data as well.
> 
> Well, assuming you actually write something to the bo w/ the CPU. If
> not, then it keeps scanning out the correct data.

I think an if (obj->pin_display) return -EBUSY; in the set_caching ioctl
would be good to fix this.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-08-14  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 10:46 [PATCH] drm/i915: Drop the overzealous warning from i915_gem_set_cache_level Chris Wilson
2013-08-12 21:02 ` Ben Widawsky
2013-08-12 21:29   ` Chris Wilson
2013-08-13  7:54 ` Daniel Vetter
2013-08-13 10:38   ` Daniel Vetter
2013-08-13 12:12 ` Ville Syrjälä
2013-08-13 12:20   ` Chris Wilson
2013-08-13 12:37     ` Ville Syrjälä
2013-08-14  8:49       ` Daniel Vetter [this message]
2013-08-14  8:54         ` Chris Wilson
2013-08-14 10:01           ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2013-08-13 10:08 Sedat Dilek

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=20130814084911.GP9296@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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