mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
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>
This commit is contained in:
parent
c5b0293ca3
commit
9bf4e19125
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user