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>
This commit is contained in:
Chris Wilson 2016-04-10 18:40:26 +01:00
parent 645c95400c
commit e8bcd678a6

View File

@ -112,8 +112,8 @@ static void execbufN(int fd, uint64_t alloc)
obj[count].handle = gem_create(fd, 4096); obj[count].handle = gem_create(fd, 4096);
gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe));
for (int i = 0; i < count; i++) { for (int i = 1; i <= count; i++) {
int j = count - i - 1; int j = count - i;
obj[j].handle = gem_create(fd, 1 << 20); obj[j].handle = gem_create(fd, 1 << 20);
execbuf.buffers_ptr = (uintptr_t)&obj[j]; 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); obj[count].handle = gem_create(fd, 4096);
gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe)); gem_write(fd, obj[count].handle, 0, &bbe, sizeof(bbe));
for (int i = 0; i < count; i++) { for (int i = 1; i <= count; i++) {
int j = count - i - 1; int j = count - i;
obj[j].handle = gem_create(fd, 1 << 20); obj[j].handle = gem_create(fd, 1 << 20);
execbuf.buffers_ptr = (uintptr_t)&obj[j]; execbuf.buffers_ptr = (uintptr_t)&obj[j];