diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-04-08 21:32:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-04-08 21:39:47 +0100 |
commit | 1f6a64ee8078ac32c2986ee9f043c55ce6f22542 (patch) | |
tree | 846106b9c2b2764bccd053f953272716c9a0e8b4 /tests | |
parent | e22525064d357a65f480873ef9d28985e9957237 (diff) |
igt/gem_exec_lut_handle: Put some operations back!
In order to force relocations, we have to remember to clear the presumed
offsets that get filled in by each pass.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_exec_lut_handle.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c index 3f81c619..74ebd949 100644 --- a/tests/gem_exec_lut_handle.c +++ b/tests/gem_exec_lut_handle.c @@ -53,6 +53,7 @@ IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT" #define SKIP_RELOC 0x1 #define NO_RELOC 0x2 +int target[MAX_NUM_RELOC]; struct drm_i915_gem_exec_object2 gem_exec[MAX_NUM_EXEC+1]; struct drm_i915_gem_relocation_entry gem_reloc[MAX_NUM_RELOC]; @@ -89,7 +90,7 @@ igt_simple_main } pass[] = { { .name = "relocation", .flags = 0 }, { .name = "skip-relocs", .flags = SKIP_RELOC }, - { .name = "no-relocs", .flags = NO_RELOC }, + { .name = "no-relocs", .flags = SKIP_RELOC | NO_RELOC }, { .name = NULL }, }, *p; @@ -136,36 +137,35 @@ igt_simple_main execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; for (j = 0; j < m; j++) { - int target = hars_petruska_f54_1_random() % n; - gem_reloc[j].target_handle = target; - if (p->flags & SKIP_RELOC) - gem_reloc[j].presumed_offset = objects[target].offset; - else - gem_reloc[j].presumed_offset = 0; + target[j] = hars_petruska_f54_1_random() % n; + gem_reloc[j].target_handle = target[j]; + gem_reloc[j].presumed_offset = 0; } gem_execbuf(fd,&execbuf); gettimeofday(&start, NULL); - for (count = 0; count < 1000; count++) + for (count = 0; count < 1000; count++) { + if ((p->flags & SKIP_RELOC) == 0) + for (j = 0; j < m; j++) + gem_reloc[j].presumed_offset = 0; gem_execbuf(fd, &execbuf); + } gettimeofday(&end, NULL); gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle); elapsed[i][1] = ELAPSED(&start, &end); execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT; - for (j = 0; j < m; j++) { - int target = gem_reloc[j].target_handle; - gem_reloc[j].target_handle = objects[target].handle; - if (p->flags & SKIP_RELOC) - gem_reloc[j].presumed_offset = objects[target].offset; - else - gem_reloc[j].presumed_offset = 0; - } + for (j = 0; j < m; j++) + gem_reloc[j].target_handle = objects[target[j]].handle; gem_execbuf(fd,&execbuf); gettimeofday(&start, NULL); - for (count = 0; count < 1000; count++) + for (count = 0; count < 1000; count++) { + if ((p->flags & SKIP_RELOC) == 0) + for (j = 0; j < m; j++) + gem_reloc[j].presumed_offset = 0; gem_execbuf(fd, &execbuf); + } gettimeofday(&end, NULL); gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle); elapsed[i][0] = ELAPSED(&start, &end); |