From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] i915/gem_exec_latency: Normalize results into ns
Date: Tue, 29 Jan 2019 09:55:45 -0800 [thread overview]
Message-ID: <593a1345-917b-3bd4-5b28-0f31fdaba0be@intel.com> (raw)
In-Reply-To: <20190129095514.15524-1-chris@chris-wilson.co.uk>
On 29/01/19 01:55, Chris Wilson wrote:
> Present the latency results in nanoseconds not RCS cycles.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> tests/i915/gem_exec_latency.c | 38 +++++++++++++++++++++++++++++++----
> 1 file changed, 34 insertions(+), 4 deletions(-)
>
> diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c
> index de16322a6..ea44adc14 100644
> --- a/tests/i915/gem_exec_latency.c
> +++ b/tests/i915/gem_exec_latency.c
> @@ -59,6 +59,7 @@
> #define PREEMPT 0x2
>
> static unsigned int ring_size;
> +static double rcs_clock;
>
> static void
> poll_ring(int fd, unsigned ring, const char *name)
> @@ -207,7 +208,7 @@ static void latency_on_ring(int fd,
> igt_cork_unplug(&c);
>
> gem_set_domain(fd, obj[1].handle, I915_GEM_DOMAIN_GTT, 0);
> - gpu_latency = (results[repeats-1] - results[0]) / (double)(repeats-1);
> + gpu_latency = (results[repeats-1] - results[1]) / (double)(repeats-2);
How come you don't like the value at 0? Maybe adding a comment would
make it clearer.
>
> gem_set_domain(fd, obj[2].handle,
> I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> @@ -238,10 +239,11 @@ static void latency_on_ring(int fd,
> igt_assert(offset == obj[2].offset);
>
> gem_set_domain(fd, obj[1].handle, I915_GEM_DOMAIN_GTT, 0);
> - igt_info("%s: dispatch latency: %.2f, execution latency: %.2f (target %.2f)\n",
> + igt_info("%s: dispatch latency: %.1fns, execution latency: %.1fns (target %.1fns)\n",
> name,
> - (end - start) / (double)repeats,
> - gpu_latency, (results[repeats - 1] - results[0]) / (double)(repeats - 1));
> + (end - start) / (double)repeats * rcs_clock,
> + gpu_latency * rcs_clock,
> + (results[repeats - 1] - results[0]) / (double)(repeats - 1) * rcs_clock);
>
> munmap(map, 64*1024);
> munmap(results, 4096);
> @@ -620,6 +622,30 @@ rthog_latency_on_ring(int fd, unsigned int engine, const char *name, unsigned in
> munmap(results, MMAP_SZ);
> }
>
> +static double clockrate(void)
> +{
> + volatile uint32_t *reg;
> + uint32_t r_start, r_end;
> + struct timespec tv;
> + uint64_t t_start, t_end;
> + uint64_t elapsed;
> +
> + reg = (volatile uint32_t *)((volatile char *)igt_global_mmio + RCS_TIMESTAMP);
> +
> + t_start = igt_nsec_elapsed(&tv);
> + r_start = *reg;
> + elapsed = igt_nsec_elapsed(&tv) - t_start;
> +
> + usleep(1000);
> +
> + t_end = igt_nsec_elapsed(&tv);
> + r_end = *reg;
> + elapsed += igt_nsec_elapsed(&tv) - t_end;
> +
> + elapsed = (t_end - t_start) + elapsed / 2;
> + return (r_end - r_start) * 1e9 / elapsed;
> +}
> +
> igt_main
> {
> const struct intel_execution_engine *e;
> @@ -640,6 +666,10 @@ igt_main
> ring_size = 1024;
>
> intel_register_access_init(intel_get_pci_device(), false, device);
> + rcs_clock = clockrate();
> + igt_info("RCS timestamp clock: %.3fKHz, %.1fns\n",
> + rcs_clock / 1e3, 1e9 / rcs_clock);
> + rcs_clock = 1e9 / rcs_clock;
> }
>
> igt_subtest("all-rtidle-submit")
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-01-29 17:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 9:55 [igt-dev] [PATCH i-g-t 1/2] i915/gem_exec_latency: Normalize results into ns Chris Wilson
2019-01-29 9:55 ` [igt-dev] [PATCH i-g-t 2/2] i915/gem_exec_latency: Eliminate the wakeup penalty Chris Wilson
2019-01-29 11:12 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] i915/gem_exec_latency: Normalize results into ns Patchwork
2019-01-29 13:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-29 17:55 ` Antonio Argenziano [this message]
2019-01-29 18:01 ` [igt-dev] [PATCH i-g-t 1/2] " Chris Wilson
2019-02-12 23:06 ` Antonio Argenziano via igt-dev
2019-02-12 23:13 ` Chris Wilson
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=593a1345-917b-3bd4-5b28-0f31fdaba0be@intel.com \
--to=antonio.argenziano@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox