summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-06-19 14:49:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-07-06 14:29:35 +0100
commit30201d9fcd2af273733e37ad6514eaf65355b2cc (patch)
tree35b16d6afaa97aeb4cb271eb1aa3a26c863980dd /tests
parent4b57f85b31f01701584190dd2f0adbc9563562be (diff)
lib: Spin fast, retire early
When using the pollable spinner, we often want to use it as a means of ensuring the task is running on the GPU before switching to something else. In which case we don't want to add extra delay inside the spinner, but the current 1000 NOPs add on order of 5us, which is often larger than the target latency. v2: Don't change perf_pmu as that is sensitive to the extra CPU latency from a tight GPU spinner. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com> #v1 Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v1 Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ctx_isolation.c1
-rw-r--r--tests/gem_eio.c1
-rw-r--r--tests/gem_exec_latency.c4
3 files changed, 4 insertions, 2 deletions
diff --git a/tests/gem_ctx_isolation.c b/tests/gem_ctx_isolation.c
index 2e19e8c0..4325e1c2 100644
--- a/tests/gem_ctx_isolation.c
+++ b/tests/gem_ctx_isolation.c
@@ -560,6 +560,7 @@ static void inject_reset_context(int fd, unsigned int engine)
struct igt_spin_factory opts = {
.ctx = gem_context_create(fd),
.engine = engine,
+ .flags = IGT_SPIN_FAST,
};
igt_spin_t *spin;
diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 0ec1aaec..3162a317 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -160,6 +160,7 @@ static igt_spin_t * __spin_poll(int fd, uint32_t ctx, unsigned long flags)
struct igt_spin_factory opts = {
.ctx = ctx,
.engine = flags,
+ .flags = IGT_SPIN_FAST,
};
if (gem_can_store_dword(fd, opts.engine))
diff --git a/tests/gem_exec_latency.c b/tests/gem_exec_latency.c
index 75811f32..de16322a 100644
--- a/tests/gem_exec_latency.c
+++ b/tests/gem_exec_latency.c
@@ -65,7 +65,7 @@ poll_ring(int fd, unsigned ring, const char *name)
{
const struct igt_spin_factory opts = {
.engine = ring,
- .flags = IGT_SPIN_POLL_RUN,
+ .flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FAST,
};
struct timespec tv = {};
unsigned long cycles;
@@ -464,7 +464,7 @@ rthog_latency_on_ring(int fd, unsigned int engine, const char *name, unsigned in
#define MMAP_SZ (64 << 10)
const struct igt_spin_factory opts = {
.engine = engine,
- .flags = IGT_SPIN_POLL_RUN,
+ .flags = IGT_SPIN_POLL_RUN | IGT_SPIN_FAST,
};
struct rt_pkt *results;
unsigned int engines[16];