summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-08-02 12:28:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-08-02 12:36:45 +0100
commitd78c7fd293cb228fe03ccff730202b033e25ff18 (patch)
treeb462103fec4a59460cc37b2f9725db998179224e
parent94f610adabd717867bdbaa6eec6dd64b0a11dfcd (diff)
i915/gem_cs_tlb: Impose a runtime cap
Limit the test to only consume 2s of TLB thrashing, in case we are running on a very slow device with a bunch of workarounds and the umpteen thousand iterations takes a long time. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r--tests/i915/gem_cs_tlb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/i915/gem_cs_tlb.c b/tests/i915/gem_cs_tlb.c
index 3e9d882b..f72879c3 100644
--- a/tests/i915/gem_cs_tlb.c
+++ b/tests/i915/gem_cs_tlb.c
@@ -99,7 +99,6 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
uint32_t *batch;
} obj[2];
unsigned i;
- char buf[100];
gem_require_ring(fd, ring_id);
igt_require(has_softpin(fd));
@@ -123,14 +122,17 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
gem_execbuf(fd, &execbuf);
execobj.flags = EXEC_OBJECT_PINNED;
- sprintf(buf, "Testing %s cs tlb coherency: ", ring_name);
- for (i = 0; i < BATCH_SIZE/64; i++) {
+ i = 0;
+ igt_until_timeout(2) {
execobj.handle = obj[i&1].handle;
obj[i&1].batch[i*64/4] = MI_BATCH_BUFFER_END;
execbuf.batch_start_offset = i*64;
gem_execbuf(fd, &execbuf);
+ if (++i == BATCH_SIZE / 64)
+ break;
}
+ igt_info("Completed %d cycles\n", i);
for (i = 0; i < 2; i++) {
gem_close(fd, obj[i].handle);