summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAntonio Argenziano <antonio.argenziano@intel.com>2019-02-21 14:38:59 -0800
committerAntonio Argenziano <antonio.argenziano@intel.com>2019-02-22 09:18:02 -0800
commit8afdfd8fa9ce17043d9105dedca46ad4555fdcdb (patch)
tree1b973ccc6cc2f80cdb0b9b1f4058e2d1ad7f1814 /tests
parentd1e352d15a6c6e1062ee60198795809435d1bb47 (diff)
tests/prime_self_import: Swap gtt mapping for cpu
The test uses gtt mapping to check two BOs have the same content, since it seems there is no contention on the BOs use cpu mapping to make it compatible with platforms that do not have a mappable aperture. v2: - Need to have an explicit set_domain. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/prime_self_import.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 8c4f5321..45b70e81 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -59,8 +59,12 @@ check_bo(int fd1, uint32_t handle1, int fd2, uint32_t handle2)
char *ptr1, *ptr2;
int i;
- ptr1 = gem_mmap__gtt(fd1, handle1, BO_SIZE, PROT_READ | PROT_WRITE);
- ptr2 = gem_mmap__gtt(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE);
+
+ ptr1 = gem_mmap__cpu(fd1, handle1, 0, BO_SIZE, PROT_READ | PROT_WRITE);
+ ptr2 = gem_mmap__cpu(fd2, handle2, 0, BO_SIZE, PROT_READ | PROT_WRITE);
+
+ gem_set_domain(fd1, handle1, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+ gem_set_domain(fd2, handle2, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
/* check whether it's still our old object first. */
for (i = 0; i < BO_SIZE; i++) {