From e8bcd678a6e570ccda0d694939d17285fb394da2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 10 Apr 2016 18:40:26 +0100 Subject: [PATCH] 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 --- tests/gem_shrink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/gem_shrink.c b/tests/gem_shrink.c index 44b6acbc..468fcf88 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];