From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Flush extra hard after writing relocations through the GTT
Date: Thu, 1 Aug 2019 16:33:44 -0400 [thread overview]
Message-ID: <20190801203344.GY3842@intel.com> (raw)
In-Reply-To: <20190730112151.5633-4-chris@chris-wilson.co.uk>
On Tue, Jul 30, 2019 at 12:21:51PM +0100, Chris Wilson wrote:
> Recently discovered in commit bdae33b8b82b ("drm/i915: Use maximum write
> flush for pwrite_gtt") was that we needed to our full write barrier
> before changing the GGTT PTE to ensure that our indirect writes through
> the GTT landed before the PTE changed (and the writes end up in a
> different page). That also applies to our GGTT relocation path.
Chris,
As i understand, changing the GGTT PTE also an indirect write. If so, isn't a wmb()
should be good enough.
Thanks,
Prathap
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: stable@vger.kernel.org
> ---
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 8a2047c4e7c3..01901dad33f7 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -1019,11 +1019,12 @@ static void reloc_cache_reset(struct reloc_cache *cache)
> kunmap_atomic(vaddr);
> i915_gem_object_finish_access((struct drm_i915_gem_object *)cache->node.mm);
> } else {
> - wmb();
> + struct i915_ggtt *ggtt = cache_to_ggtt(cache);
> +
> + intel_gt_flush_ggtt_writes(ggtt->vm.gt);
> io_mapping_unmap_atomic((void __iomem *)vaddr);
> - if (cache->node.allocated) {
> - struct i915_ggtt *ggtt = cache_to_ggtt(cache);
>
> + if (cache->node.allocated) {
> ggtt->vm.clear_range(&ggtt->vm,
> cache->node.start,
> cache->node.size);
> @@ -1078,6 +1079,7 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,
> void *vaddr;
>
> if (cache->vaddr) {
> + intel_gt_flush_ggtt_writes(ggtt->vm.gt);
> io_mapping_unmap_atomic((void __force __iomem *) unmask_page(cache->vaddr));
> } else {
> struct i915_vma *vma;
> @@ -1119,7 +1121,6 @@ static void *reloc_iomap(struct drm_i915_gem_object *obj,
>
> offset = cache->node.start;
> if (cache->node.allocated) {
> - wmb();
> ggtt->vm.insert_page(&ggtt->vm,
> i915_gem_object_get_dma_address(obj, page),
> offset, I915_CACHE_NONE, 0);
> --
> 2.22.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-08-01 20:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 11:21 Short list of hopeful bug fixes Chris Wilson
2019-07-30 11:21 ` [PATCH 1/3] drm/i915/execlists: Always clear pending&inflight requests on reset Chris Wilson
2019-07-30 11:21 ` [PATCH 2/3] drm/i915: Allow sharing the idle-barrier from other kernel requests Chris Wilson
2019-08-01 17:24 ` Tvrtko Ursulin
2019-08-01 17:55 ` Chris Wilson
2019-08-02 8:34 ` [PATCH v2] " Chris Wilson
2019-08-02 10:00 ` [PATCH v3] " Chris Wilson
2019-08-02 10:11 ` Tvrtko Ursulin
2019-07-30 11:21 ` [PATCH 3/3] drm/i915: Flush extra hard after writing relocations through the GTT Chris Wilson
2019-08-01 20:33 ` Kumar Valsan, Prathap [this message]
2019-08-01 20:21 ` [Intel-gfx] " Chris Wilson
2019-08-01 23:08 ` Kumar Valsan, Prathap
2019-07-30 12:39 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/execlists: Always clear pending&inflight requests on reset Patchwork
2019-07-30 13:01 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-30 22:46 ` ✓ Fi.CI.IGT: " Patchwork
2019-08-02 8:44 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/execlists: Always clear pending&inflight requests on reset (rev2) Patchwork
2019-08-02 9:27 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-08-02 10:29 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915/execlists: Always clear pending&inflight requests on reset (rev3) Patchwork
2019-08-02 10:49 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-03 15:26 ` ✓ Fi.CI.IGT: " Patchwork
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=20190801203344.GY3842@intel.com \
--to=prathap.kumar.valsan@intel.com \
--cc=chris@chris-wilson.co.uk \
--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 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).