intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/selftests: Measure dispatch latency
Date: Mon, 18 May 2020 16:17:15 +0100	[thread overview]
Message-ID: <158981503574.7442.18064081457237643535@build.alporthouse.com> (raw)
In-Reply-To: <158981488331.7442.6623043854034622709@build.alporthouse.com>

Quoting Chris Wilson (2020-05-18 16:14:43)
> Quoting Mika Kuoppala (2020-05-18 16:07:47)
> > Chris Wilson <chris@chris-wilson.co.uk> writes:
> > > +             cs = emit_timestamp_store(cs, ce, offset + i * sizeof(u32));
> > 
> > Is the dual writes here so that when you kick the semaphore, you get the
> > latest no matter which side you were on?
> 
> We wait on the first write in the CPU before releasing the semaphore. It
> was easier to copy the code, but now it can be an emit_store_dw() to
> make it clearer that we are not using it as timestamp -- and avoid the
> infinite wait if we hit CS_TIMESTAMP == 0.

diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index c6dff5145a3c..887171ff21a0 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -1779,7 +1779,7 @@ static int measure_busy_dispatch(struct intel_context *ce)
                        return PTR_ERR(cs);
                }

-               cs = emit_timestamp_store(cs, ce, offset + i * sizeof(u32));
+               cs = emit_store_dw(cs, offset + i * sizeof(u32), -1);
                cs = emit_semaphore_poll_until(cs, offset, i);
                cs = emit_timestamp_store(cs, ce, offset + i * sizeof(u32));

@@ -1802,8 +1802,10 @@ static int measure_busy_dispatch(struct intel_context *ce)
        wait_for(READ_ONCE(sema[i - 1]), 500);
        semaphore_set(sema, i - 1);

-       for (i = 1; i <= COUNT; i++)
+       for (i = 1; i <= COUNT; i++) {
+               GEM_BUG_ON(sema[i] == -1);
                elapsed[i - 1] = (sema[i] - elapsed[i]) << COUNT;
+       }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-05-18 15:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 14:39 [Intel-gfx] [PATCH v2] drm/i915/selftests: Measure dispatch latency Chris Wilson
2020-05-18 15:07 ` Mika Kuoppala
2020-05-18 15:14   ` Chris Wilson
2020-05-18 15:17     ` Chris Wilson [this message]
2020-05-18 16:19 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/selftests: Measure dispatch latency (rev7) Patchwork
2020-05-18 16:22 ` [Intel-gfx] [PATCH] drm/i915/selftests: Measure dispatch latency Chris Wilson
2020-05-18 18:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: Measure dispatch latency (rev8) Patchwork
2020-05-18 20:02 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-05-19 11:41 ` [Intel-gfx] [PATCH] drm/i915/selftests: Measure dispatch latency Chris Wilson
2020-05-19 12:47   ` Mika Kuoppala
2020-05-19 12:56     ` Chris Wilson
2020-05-19 13:25 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: Measure dispatch latency (rev9) 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=158981503574.7442.18064081457237643535@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@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;
as well as URLs for NNTP newsgroup(s).