summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-07-13 11:09:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-07-13 11:57:57 +0100
commitd97a7c4fa1b129f64fdaa6297af1c2ec9c8856c4 (patch)
treecbb9d134f87fa437e4febff39dfb409cfc1ccf03 /tests
parent2a99e5bb011c4e2f404b2eadcc2105de023d3c8f (diff)
i915/gem_exec_schedule: Trim reorder-wide workload
A future change will cause the scheduling to only take into account relative priorities and not apply strict priority ordering. To keep reorder-wide working we need to ensure that the seperation in priority levels is sufficient such that a ring full of the high priority work will have an earlier deadline than the first low priority request. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/gem_exec_schedule.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 7e900b2c6..4d70d52f2 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -1849,13 +1849,13 @@ static void reorder_wide(int fd, unsigned ring)
{
const unsigned int ring_size = gem_submission_measure(fd, ring);
const int gen = intel_gen(intel_get_drm_devid(fd));
+ const int priorities[] = { MIN_PRIO, MAX_PRIO };
struct drm_i915_gem_relocation_entry reloc;
struct drm_i915_gem_exec_object2 obj[2];
struct drm_i915_gem_execbuffer2 execbuf;
- struct timespec tv = {};
- IGT_CORK_FENCE(cork);
- uint32_t result, target;
uint32_t result_read[1024];
+ uint32_t result, target;
+ IGT_CORK_FENCE(cork);
uint32_t *expected;
int fence;
@@ -1886,14 +1886,12 @@ static void reorder_wide(int fd, unsigned ring)
execbuf.flags |= I915_EXEC_FENCE_IN;
execbuf.rsvd2 = fence;
- for (int n = MIN_PRIO, x = 1;
- igt_seconds_elapsed(&tv) < 5 && n <= MAX_PRIO;
- n++, x++) {
+ for (int n = 0, x = 1; n < ARRAY_SIZE(priorities); n++, x++) {
unsigned int sz = ALIGN(ring_size * 64, 4096);
uint32_t *batch;
execbuf.rsvd1 = gem_context_clone_with_engines(fd, 0);
- gem_context_set_priority(fd, execbuf.rsvd1, n);
+ gem_context_set_priority(fd, execbuf.rsvd1, priorities[n]);
obj[1].handle = gem_create(fd, sz);
batch = gem_mmap__device_coherent(fd, obj[1].handle, 0, sz, PROT_WRITE);