summaryrefslogtreecommitdiff
path: root/tests/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-04 19:23:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-04 19:26:13 +0100
commit32e7c0e76f413b222e9446a2a950dab5723410f9 (patch)
tree8799936f4c13e6e5c013d8dc564f766758be4d0b /tests/i915
parent2c37fb335c84c023b98edf71e8c9c4bb98dd4828 (diff)
i915/gem_exec_alignment: Keep within limits
If we have fast alignment searching, we can run out of preallocated objects. Make sure we apply the cap before passing in an illegal array. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r--tests/i915/gem_exec_alignment.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/i915/gem_exec_alignment.c b/tests/i915/gem_exec_alignment.c
index 6e461b46..60a9198f 100644
--- a/tests/i915/gem_exec_alignment.c
+++ b/tests/i915/gem_exec_alignment.c
@@ -172,11 +172,12 @@ static void naughty_child(int i915, int link)
execbuf.buffer_count = 2;
while (igt_seconds_elapsed(&tv) < 2) {
- execbuf.buffer_count <<= 1;
gem_execbuf(i915, &execbuf);
+ if (execbuf.buffer_count >= count)
+ break;
+ execbuf.buffer_count <<= 1;
}
- execbuf.buffer_count <<= 1;
- if (execbuf.buffer_count > count)
+ if (execbuf.buffer_count >= count)
execbuf.buffer_count = count;
igt_debug("Using %u buffers to delay execbuf\n", execbuf.buffer_count);