From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Akash Goel <akash.goel@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] drm/i915: Unconditionally flush any chipset buffers before execbuf
Date: Tue, 16 Aug 2016 17:01:51 +0300 [thread overview]
Message-ID: <87k2fgolrk.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1471349672-9645-1-git-send-email-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> If userspace is asynchronously streaming into the batch or other
> execobjects, we may not flush those writes along with a change in cache
> domain (as there is no change). Therefore those writes may end up in
> internal chipset buffers and not visible to the GPU upon execution. We
> must issue a flush command or otherwise we encounter incoherency in the
> batchbuffers and the GPU executing invalid commands (i.e. hanging) quite
> regularly.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90841
> Fixes: 1816f9236303 ("drm/i915: Support creation of unbound wc user...")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Akash Goel <akash.goel@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Tested-by: Matti Hämäläinen <ccr@tnsp.org>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 699315304748..75957aef6219 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1016,7 +1016,6 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
> const unsigned int other_rings = eb_other_engines(req);
> struct i915_vma *vma;
> uint32_t flush_domains = 0;
You don't need flush_domains, with this version.
> - bool flush_chipset = false;
> int ret;
>
> list_for_each_entry(vma, vmas, exec_list) {
> @@ -1029,16 +1028,13 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
> }
>
> if (obj->base.write_domain & I915_GEM_DOMAIN_CPU)
> - flush_chipset |= i915_gem_clflush_object(obj, false);
> + i915_gem_clflush_object(obj, false);
>
> flush_domains |= obj->base.write_domain;
> }
>
> - if (flush_chipset)
> - i915_gem_chipset_flush(req->engine->i915);
> -
> - if (flush_domains & I915_GEM_DOMAIN_GTT)
> - wmb();
> + /* Unconditionally flush any chipset caches (for streaming writes). */
> + i915_gem_chipset_flush(req->engine->i915);
>
> /* Unconditionally invalidate GPU caches and TLBs. */
> return req->engine->emit_flush(req, EMIT_INVALIDATE);
> --
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Akash Goel <akash.goel@intel.com>,
stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Unconditionally flush any chipset buffers before execbuf
Date: Tue, 16 Aug 2016 17:01:51 +0300 [thread overview]
Message-ID: <87k2fgolrk.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1471349672-9645-1-git-send-email-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> If userspace is asynchronously streaming into the batch or other
> execobjects, we may not flush those writes along with a change in cache
> domain (as there is no change). Therefore those writes may end up in
> internal chipset buffers and not visible to the GPU upon execution. We
> must issue a flush command or otherwise we encounter incoherency in the
> batchbuffers and the GPU executing invalid commands (i.e. hanging) quite
> regularly.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90841
> Fixes: 1816f9236303 ("drm/i915: Support creation of unbound wc user...")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Akash Goel <akash.goel@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Tested-by: Matti Hämäläinen <ccr@tnsp.org>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 699315304748..75957aef6219 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1016,7 +1016,6 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
> const unsigned int other_rings = eb_other_engines(req);
> struct i915_vma *vma;
> uint32_t flush_domains = 0;
You don't need flush_domains, with this version.
> - bool flush_chipset = false;
> int ret;
>
> list_for_each_entry(vma, vmas, exec_list) {
> @@ -1029,16 +1028,13 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
> }
>
> if (obj->base.write_domain & I915_GEM_DOMAIN_CPU)
> - flush_chipset |= i915_gem_clflush_object(obj, false);
> + i915_gem_clflush_object(obj, false);
>
> flush_domains |= obj->base.write_domain;
> }
>
> - if (flush_chipset)
> - i915_gem_chipset_flush(req->engine->i915);
> -
> - if (flush_domains & I915_GEM_DOMAIN_GTT)
> - wmb();
> + /* Unconditionally flush any chipset caches (for streaming writes). */
> + i915_gem_chipset_flush(req->engine->i915);
>
> /* Unconditionally invalidate GPU caches and TLBs. */
> return req->engine->emit_flush(req, EMIT_INVALIDATE);
> --
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-16 14:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 12:14 [PATCH] drm/i915: Unconditionally flush any chipset buffers before execbuf Chris Wilson
2016-08-16 12:14 ` Chris Wilson
2016-08-16 12:41 ` ✗ Ro.CI.BAT: failure for " Patchwork
2016-08-16 14:01 ` Mika Kuoppala [this message]
2016-08-16 14:01 ` [Intel-gfx] [PATCH] " Mika Kuoppala
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=87k2fgolrk.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.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.