summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2015-04-24 10:38:58 +0300
committerThomas Wood <thomas.wood@intel.com>2015-04-27 15:26:00 +0100
commita3e336e4614613e30b2bb2cd21b76c1c69614475 (patch)
tree9c91112a28f3b1d8de3b800c5a0a5d4df382c4e8 /tests
parentdbf6468f90f864decc79cb5c5802cb4d230fb46d (diff)
tests/gem_mmap_gtt: Use PAGE_SIZE instead of hard coded value
Now that there is PAGE_SIZE define, use it. Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_mmap_gtt.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index e80f52e2..92fa6441 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -148,24 +148,25 @@ test_short(int fd)
igt_assert(drmIoctl(fd,
DRM_IOCTL_I915_GEM_MMAP_GTT,
&mmap_arg) == 0);
- for (pages = 1; pages <= OBJECT_SIZE / 4096; pages <<= 1) {
+ for (pages = 1; pages <= OBJECT_SIZE / PAGE_SIZE; pages <<= 1) {
uint8_t *r, *w;
- w = mmap64(0, pages * 4096, PROT_READ | PROT_WRITE,
+ w = mmap64(0, pages * PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, mmap_arg.offset);
igt_assert(w != MAP_FAILED);
- r = mmap64(0, pages * 4096, PROT_READ,
+ r = mmap64(0, pages * PAGE_SIZE, PROT_READ,
MAP_SHARED, fd, mmap_arg.offset);
igt_assert(r != MAP_FAILED);
for (p = 0; p < pages; p++) {
- w[4096*p] = r[4096*p];
- w[4096*p+4095] = r[4096*p+4095];
+ w[p*PAGE_SIZE] = r[p*PAGE_SIZE];
+ w[p*PAGE_SIZE+(PAGE_SIZE-1)] =
+ r[p*PAGE_SIZE+(PAGE_SIZE-1)];
}
- munmap(r, pages * 4096);
- munmap(w, pages * 4096);
+ munmap(r, pages * PAGE_SIZE);
+ munmap(w, pages * PAGE_SIZE);
}
gem_close(fd, mmap_arg.handle);
}