All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/gt: Wait for aux invalidation on Tigerlake
Date: Thu, 16 Jul 2020 22:32:44 +0100	[thread overview]
Message-ID: <159493516474.13677.13306364734238378811@build.alporthouse.com> (raw)
In-Reply-To: <20200716203201.11977-2-chris@chris-wilson.co.uk>

Quoting Chris Wilson (2020-07-16 21:32:01)
> Add a SRM read back of the aux invalidation register after poking
> hsdes: 1809175790, as failing to do so leads to writes going astray.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2169
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_lrc.c | 31 ++++++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index e0280a672f1d..c9e46792b976 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -4757,14 +4757,21 @@ static int gen12_emit_flush(struct i915_request *request, u32 mode)
>         intel_engine_mask_t aux_inv = 0;
>         u32 cmd, *cs;
>  
> +       cmd = 4;
> +       if (mode & EMIT_INVALIDATE)
> +               cmd += 2;
>         if (mode & EMIT_INVALIDATE)
>                 aux_inv = request->engine->mask & ~BIT(BCS0);
> +       if (aux_inv)
> +               cmd += 2 * hweight8(aux_inv) + 6;
>  
> -       cs = intel_ring_begin(request,
> -                             4 + (aux_inv ? 2 * hweight8(aux_inv) + 2 : 0));
> +       cs = intel_ring_begin(request, cmd);
>         if (IS_ERR(cs))
>                 return PTR_ERR(cs);
>  
> +       if (mode & EMIT_INVALIDATE)
> +               *cs++ = preparser_disable(true);
> +
>         cmd = MI_FLUSH_DW + 1;
>  
>         /* We always require a command barrier so that subsequent
> @@ -4780,11 +4787,6 @@ static int gen12_emit_flush(struct i915_request *request, u32 mode)
>                         cmd |= MI_INVALIDATE_BSD;
>         }
>  
> -       *cs++ = cmd;
> -       *cs++ = LRC_PPHWSP_SCRATCH_ADDR;
> -       *cs++ = 0; /* upper addr */
> -       *cs++ = 0; /* value */
> -
>         if (aux_inv) { /* hsdes: 1809175790 */
>                 struct intel_engine_cs *engine;
>                 unsigned int tmp;
> @@ -4796,7 +4798,22 @@ static int gen12_emit_flush(struct i915_request *request, u32 mode)
>                         *cs++ = AUX_INV;
>                 }
>                 *cs++ = MI_NOOP;
> +
> +               *cs++ = MI_STORE_REGISTER_MEM | MI_USE_GGTT;

Sigh. So I fixed this to MI_SRM_GEN8 and tgl failed the test again.

> +               *cs++ = i915_mmio_reg_offset(aux_inv_reg(request->engine));
> +               *cs++ = i915_ggtt_offset(engine->status_page.vma) +
> +                       I915_GEM_HWS_SCRATCH * sizeof(u32);
> +               *cs++ = 0;

-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-07-16 21:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 20:32 [Intel-gfx] [PATCH 1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values Chris Wilson
2020-07-16 20:32 ` [Intel-gfx] [PATCH 2/2] drm/i915/gt: Wait for aux invalidation on Tigerlake Chris Wilson
2020-07-16 21:32   ` Chris Wilson [this message]
2020-07-17  8:30   ` Mika Kuoppala
2020-07-17 10:24     ` Chris Wilson
2020-07-16 20:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: Add compiler paranoia for checking HWSP values Patchwork
2020-07-16 20:40 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-07-16 21:02 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-07-17  8:13 ` [Intel-gfx] [PATCH 1/2] " 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=159493516474.13677.13306364734238378811@build.alporthouse.com \
    --to=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 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.