summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-16 17:15:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-16 17:17:19 +0100
commit7bd2ac6642248fdd865e7b32a1b4f20bda992e27 (patch)
tree36362fa7b319800971412b8563444a5b8e4378dc
parentc84853ba32a7f49a4606ff6aa91f6bc81217054b (diff)
gem_exec_lut_handle: Fix presumed_offset to force relocation on full-ppgtt
If the object is at offset 0, quite likely using full-ppgtt, then the presumed_offset set also to 0 causes the relocation to be skipped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--benchmarks/gem_exec_reloc.c4
-rw-r--r--tests/gem_exec_lut_handle.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index 2ef6df57..40e2e478 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -144,7 +144,7 @@ static int run(unsigned batch_size,
reloc[n].target_handle = target[n];
else
reloc[n].target_handle = objects[target[n]].handle;
- reloc[n].presumed_offset = 0;
+ reloc[n].presumed_offset = -1;
}
gem_execbuf(fd, &execbuf);
@@ -154,7 +154,7 @@ static int run(unsigned batch_size,
for (count = 0; count < 1000; count++) {
if ((flags & SKIP_RELOC) == 0) {
for (n = 0; n < num_relocs; n++)
- reloc[n].presumed_offset = 0;
+ reloc[n].presumed_offset = -1;
if (flags & CYCLE_BATCH) {
c = (c + 1) % 16;
gem_exec[num_objects].handle = cycle[c];
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index 672635c9..a1aa6941 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -165,7 +165,7 @@ igt_simple_main
for (j = 0; j < m; j++) {
target[j] = hars_petruska_f54_1_random() % n;
reloc[j].target_handle = target[j];
- reloc[j].presumed_offset = 0;
+ reloc[j].presumed_offset = -1;
}
gem_execbuf(fd,&execbuf);
@@ -173,7 +173,7 @@ igt_simple_main
for (count = 0; count < 1000; count++) {
if ((p->flags & SKIP_RELOC) == 0) {
for (j = 0; j < m; j++)
- reloc[j].presumed_offset = 0;
+ reloc[j].presumed_offset = -1;
if (p->flags & CYCLE_BATCH) {
c = (c + 1) % 16;
gem_exec[MAX_NUM_EXEC].handle = cycle[c];
@@ -203,7 +203,7 @@ igt_simple_main
for (count = 0; count < 1000; count++) {
if ((p->flags & SKIP_RELOC) == 0) {
for (j = 0; j < m; j++)
- reloc[j].presumed_offset = 0;
+ reloc[j].presumed_offset = -1;
if (p->flags & CYCLE_BATCH) {
c = (c + 1) % 16;
gem_exec[MAX_NUM_EXEC].handle = cycle[c];