summaryrefslogtreecommitdiff
path: root/tests/prime_mmap.c
diff options
context:
space:
mode:
authorRamalingam C <ramalingam.c@intel.com>2020-01-31 23:01:04 +0530
committerRamalingam C <ramalingam.c@intel.com>2020-02-04 16:08:10 +0530
commit05ac69cd03f2f05b05a5b61f4fb96b5b717d8706 (patch)
tree2993cf6b10d812e191790ae266a78fcec1d497ef /tests/prime_mmap.c
parent4819bf9b587348a09274aea79baa5a58b8390141 (diff)
tests/prime_mmap: use device coherent mapping instead of mmap_gtt
Since on new discrete GPUs we dont have the mappable aperture, if that is acceptable for the test purpose, we should use GEM_MMAP_OFFSET. Hence using gem_mmap_device_coherent() which wraps the mmap options in the order of gem_mmap_offset / gem_mmap / mmap_gtt Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/prime_mmap.c')
-rw-r--r--tests/prime_mmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index fc985784..14334241 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -85,8 +85,8 @@ test_correct(void)
dma_buf_fd = prime_handle_to_fd(fd, handle);
igt_assert(errno == 0);
- /* Check correctness vs GEM_MMAP_GTT */
- ptr1 = gem_mmap__gtt(fd, handle, BO_SIZE, PROT_READ);
+ /* Check correctness vs GEM_MMAP */
+ ptr1 = gem_mmap__device_coherent(fd, handle, 0, BO_SIZE, PROT_READ);
ptr2 = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0);
igt_assert(ptr1 != MAP_FAILED);
igt_assert(ptr2 != MAP_FAILED);