diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-10 18:40:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-10 18:42:42 +0100 |
commit | e8bcd678a6e570ccda0d694939d17285fb394da2 (patch) | |
tree | 997942130e1680dcb9f651d1e0178268a42b3082 | |
parent | 645c95400ccfd743a17b4ab90488cea7eb316776 (diff) |
igt/gem_shrink: Fix execution object offset
An off-by-one caused us to execute the blank object rather than the
batch.
References: https://bugs.freedesktop.org/show_bug.cgi?id=94801
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_shrink.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/gem_shrink.c b/tests/gem_shrink.c index 44b6acbc5158..468fcf88ad26 100644 --- a/tests/gem_shrink.c +++ b/tests/gem_shrink.c @@ -112,8 +112,8 @@ static void execbufN(int fd, uint64_t alloc) obj[count].handle = gem_create(fd, 4096); gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); - for (int i = 0; i < count; i++) { - int j = count - i - 1; + for (int i = 1; i <= count; i++) { + int j = count - i; obj[j].handle = gem_create(fd, 1 << 20); execbuf.buffers_ptr = (uintptr_t)&obj[j]; @@ -139,8 +139,8 @@ static void hang(int fd, uint64_t alloc) obj[count].handle = gem_create(fd, 4096); gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); - for (int i = 0; i < count; i++) { - int j = count - i - 1; + for (int i = 1; i <= count; i++) { + int j = count - i; obj[j].handle = gem_create(fd, 1 << 20); execbuf.buffers_ptr = (uintptr_t)&obj[j]; |