From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH igt 3/3] igt/perf_pmu: Idle the GPU before starting to measure busyness
Date: Thu, 23 Nov 2017 08:22:37 +0000 [thread overview]
Message-ID: <20171123082237.9733-4-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20171123082237.9733-1-chris@chris-wilson.co.uk>
Make sure the HW is idle before we start sampling the GPU for busyness.
If we do not rest for long enough between tests, we may carry the
sampling over.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tests/perf_pmu.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 7fd1506e..9057a1d7 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -137,6 +137,9 @@ single(int gem_fd, const struct intel_execution_engine2 *e, bool busy)
uint64_t val;
int fd;
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
if (busy) {
@@ -187,6 +190,9 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
igt_spin_t *spin;
unsigned int busy_idx, i;
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
i = 0;
fd[0] = -1;
for_each_engine_class_instance(fd, e_) {
@@ -232,6 +238,9 @@ most_busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
igt_spin_t *spin[num_engines];
unsigned int idle_idx, i;
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
gem_require_engine(gem_fd, e->class, e->instance);
i = 0;
@@ -287,6 +296,9 @@ all_busy_check_all(int gem_fd, const unsigned int num_engines)
igt_spin_t *spin[num_engines];
unsigned int i;
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
i = 0;
fd[0] = -1;
for_each_engine_class_instance(fd, e) {
@@ -624,6 +636,9 @@ multi_client(int gem_fd, const struct intel_execution_engine2 *e)
uint64_t val[2];
int fd[2];
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
fd[0] = open_pmu(config);
/*
@@ -739,6 +754,9 @@ static void cpu_hotplug(int gem_fd)
uint64_t val, ref;
int fd;
+ /* Ensure the HW is idle before being BUSY measurements */
+ gem_quiescent_gpu(gem_fd);
+
igt_require(cpu0_hotplug_support());
fd = perf_i915_open(I915_PMU_ENGINE_BUSY(I915_ENGINE_CLASS_RENDER, 0));
--
2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-23 8:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 8:22 igt/perf_pmu roundup Chris Wilson
2017-11-23 8:22 ` [PATCH igt 1/3] igt/perf_pmu: Reduce arbitrary delays Chris Wilson
2017-11-23 13:35 ` Tvrtko Ursulin
2017-11-23 8:22 ` [PATCH igt 2/3] igt/perf_pmu: Stop peeking at intel_mmio registers Chris Wilson
2017-11-24 8:55 ` Tvrtko Ursulin
2017-11-24 9:20 ` Chris Wilson
2017-11-24 10:47 ` Chris Wilson
2017-11-23 8:22 ` Chris Wilson [this message]
2017-11-23 13:37 ` [PATCH igt 3/3] igt/perf_pmu: Idle the GPU before starting to measure busyness Tvrtko Ursulin
2017-11-23 16:02 ` Chris Wilson
2017-11-23 16:07 ` Chris Wilson
2017-11-24 7:32 ` Tvrtko Ursulin
2017-11-24 9:15 ` Chris Wilson
2017-11-23 18:53 ` ✓ Fi.CI.BAT: success for series starting with [1/3] igt/perf_pmu: Reduce arbitrary delays Patchwork
2017-11-23 22:14 ` ✓ 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=20171123082237.9733-4-chris@chris-wilson.co.uk \
--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.