summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2019-12-13 10:52:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-12-31 20:42:37 +0000
commita555a4b98f90dab655d24bb3d07e9291a8b8dac8 (patch)
tree3a624fd90223c879ea74e7485a65ee159ab2fe38
parent62146738c68abfa7497b023a049163932f5a9aa0 (diff)
lib/igt_dummyload: Use mapping selection to allow run batch from lmem
For batches which need to be run from device memory there's a need to use mmap offset interface to map the buffer. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/igt_dummyload.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 32d4d8d3f..b7f4caca3 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -107,12 +107,8 @@ emit_recursive_batch(igt_spin_t *spin,
memset(relocs, 0, sizeof(relocs));
obj[BATCH].handle = gem_create(fd, BATCH_SIZE);
- batch = __gem_mmap__wc(fd, obj[BATCH].handle,
- 0, BATCH_SIZE, PROT_WRITE);
- if (!batch)
- batch = gem_mmap__gtt(fd, obj[BATCH].handle,
- BATCH_SIZE, PROT_WRITE);
-
+ batch = gem_mmap__device_coherent(fd, obj[BATCH].handle,
+ 0, BATCH_SIZE, PROT_WRITE);
gem_set_domain(fd, obj[BATCH].handle,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
execbuf->buffer_count++;
@@ -152,9 +148,10 @@ emit_recursive_batch(igt_spin_t *spin,
0, 4096,
PROT_READ | PROT_WRITE);
else
- spin->poll = gem_mmap__wc(fd, spin->poll_handle,
- 0, 4096,
- PROT_READ | PROT_WRITE);
+ spin->poll = gem_mmap__device_coherent(fd,
+ spin->poll_handle,
+ 0, 4096,
+ PROT_READ | PROT_WRITE);
igt_assert_eq(spin->poll[SPIN_POLL_START_IDX], 0);