summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-08-13 07:15:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-13 16:12:55 +0100
commit5716e280f4c55be3da3e5fe285070c0fd7638202 (patch)
tree5e2eacc92a0a0472f825eb9dd080a290b6b0c199 /tests
parent2180b639872f81318ebe2bbe4349ca463e755568 (diff)
i915/gem_exec_schedule: Limit the plug to fit small rings
If we are not running with a scheduler, we are using a global ringbuffer which may not accommodate 16 extra batches. Fortunately, we only need one such batch to block the submission queue as without a scheduler, it is in order submission (and so the batch is after the main setup anyway!). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/gem_exec_schedule.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 6e846629..05810210 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -164,8 +164,13 @@ static uint32_t create_highest_priority(int fd)
static void unplug_show_queue(int fd, struct igt_cork *c, unsigned int engine)
{
igt_spin_t *spin[MAX_ELSP_QLEN];
+ int max = MAX_ELSP_QLEN;
- for (int n = 0; n < ARRAY_SIZE(spin); n++) {
+ /* If no scheduler, all batches are emitted in submission order */
+ if (!gem_scheduler_enabled(fd))
+ max = 1;
+
+ for (int n = 0; n < max; n++) {
const struct igt_spin_factory opts = {
.ctx = create_highest_priority(fd),
.engine = engine,
@@ -177,7 +182,7 @@ static void unplug_show_queue(int fd, struct igt_cork *c, unsigned int engine)
igt_cork_unplug(c); /* batches will now be queued on the engine */
igt_debugfs_dump(fd, "i915_engine_info");
- for (int n = 0; n < ARRAY_SIZE(spin); n++)
+ for (int n = 0; n < max; n++)
igt_spin_free(fd, spin[n]);
}