summaryrefslogtreecommitdiff
path: root/tests/gem_softpin.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-01-24 15:34:08 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-01-24 15:35:31 +0000
commit9bf4e19125597ed11a23027270f5ecb3099b5ea9 (patch)
treeaa426a53c5f4e56ff80650066d6c0812d05ed769 /tests/gem_softpin.c
parentc5b0293ca301ea643529d92b7e47f916ec59a762 (diff)
igt/gem_softpin: Keep last_handle around to vary hole generation
If we don't close the handle from the last pass, we don't free up the previous pass's vma immediately, changing the hole allocation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_softpin.c')
-rw-r--r--tests/gem_softpin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c
index 81b35b34..44534296 100644
--- a/tests/gem_softpin.c
+++ b/tests/gem_softpin.c
@@ -129,8 +129,11 @@ static void test_softpin(int fd)
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 object;
uint64_t offset, end;
+ uint32_t last_handle;
int loop;
+ last_handle = gem_create(fd, size);
+
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)&object;
execbuf.buffer_count = 1;
@@ -142,6 +145,7 @@ static void test_softpin(int fd)
/* Find a hole */
gem_execbuf(fd, &execbuf);
gem_close(fd, object.handle);
+ gem_close(fd, last_handle);
igt_debug("Made a 2 MiB hole: %08llx\n",
object.offset);
@@ -157,7 +161,7 @@ static void test_softpin(int fd)
igt_assert_eq_u64(object.offset, offset);
}
- gem_close(fd, object.handle);
+ last_handle = object.handle;
}
}