mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 08:56:11 +00:00
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>
This commit is contained in:
parent
e22525064d
commit
1f6a64ee80
@ -53,6 +53,7 @@ IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT"
|
|||||||
#define SKIP_RELOC 0x1
|
#define SKIP_RELOC 0x1
|
||||||
#define NO_RELOC 0x2
|
#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_exec_object2 gem_exec[MAX_NUM_EXEC+1];
|
||||||
struct drm_i915_gem_relocation_entry gem_reloc[MAX_NUM_RELOC];
|
struct drm_i915_gem_relocation_entry gem_reloc[MAX_NUM_RELOC];
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ igt_simple_main
|
|||||||
} pass[] = {
|
} pass[] = {
|
||||||
{ .name = "relocation", .flags = 0 },
|
{ .name = "relocation", .flags = 0 },
|
||||||
{ .name = "skip-relocs", .flags = SKIP_RELOC },
|
{ .name = "skip-relocs", .flags = SKIP_RELOC },
|
||||||
{ .name = "no-relocs", .flags = NO_RELOC },
|
{ .name = "no-relocs", .flags = SKIP_RELOC | NO_RELOC },
|
||||||
{ .name = NULL },
|
{ .name = NULL },
|
||||||
}, *p;
|
}, *p;
|
||||||
|
|
||||||
@ -136,36 +137,35 @@ igt_simple_main
|
|||||||
execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
|
execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
|
||||||
|
|
||||||
for (j = 0; j < m; j++) {
|
for (j = 0; j < m; j++) {
|
||||||
int target = hars_petruska_f54_1_random() % n;
|
target[j] = hars_petruska_f54_1_random() % n;
|
||||||
gem_reloc[j].target_handle = target;
|
gem_reloc[j].target_handle = target[j];
|
||||||
if (p->flags & SKIP_RELOC)
|
gem_reloc[j].presumed_offset = 0;
|
||||||
gem_reloc[j].presumed_offset = objects[target].offset;
|
|
||||||
else
|
|
||||||
gem_reloc[j].presumed_offset = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gem_execbuf(fd,&execbuf);
|
gem_execbuf(fd,&execbuf);
|
||||||
gettimeofday(&start, NULL);
|
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);
|
gem_execbuf(fd, &execbuf);
|
||||||
|
}
|
||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle);
|
gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle);
|
||||||
elapsed[i][1] = ELAPSED(&start, &end);
|
elapsed[i][1] = ELAPSED(&start, &end);
|
||||||
|
|
||||||
execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT;
|
execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT;
|
||||||
for (j = 0; j < m; j++) {
|
for (j = 0; j < m; j++)
|
||||||
int target = gem_reloc[j].target_handle;
|
gem_reloc[j].target_handle = objects[target[j]].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;
|
|
||||||
}
|
|
||||||
|
|
||||||
gem_execbuf(fd,&execbuf);
|
gem_execbuf(fd,&execbuf);
|
||||||
gettimeofday(&start, NULL);
|
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);
|
gem_execbuf(fd, &execbuf);
|
||||||
|
}
|
||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle);
|
gem_sync(fd, gem_exec[MAX_NUM_EXEC].handle);
|
||||||
elapsed[i][0] = ELAPSED(&start, &end);
|
elapsed[i][0] = ELAPSED(&start, &end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user