[PATCH i-g-t 6/7] Make gem_mmap__{cpu, gtt, wc}() assert on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.

To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 benchmarks/gem_blt.c               |  2 +-
 benchmarks/gem_exec_reloc.c        |  6 ++--
 benchmarks/gem_mmap.c              |  6 ++--
 demos/intel_sprite_on.c            |  4 +--
 lib/igt_draw.c                     |  6 ++--
 lib/igt_fb.c                       |  4 +--
 lib/ioctl_wrappers.c               | 68 ++++++++++++++++++++++++++++++++++----
 lib/ioctl_wrappers.h               |  4 +++
 tests/drv_suspend.c                |  6 ++--
 tests/gem_concurrent_all.c         | 14 ++++----
 tests/gem_cs_tlb.c                 |  2 +-
 tests/gem_evict_everything.c       |  2 +-
 tests/gem_exec_big.c               |  4 +--
 tests/gem_exec_faulting_reloc.c    |  2 +-
 tests/gem_exec_lut_handle.c        |  8 ++---
 tests/gem_fence_thrash.c           |  4 +--
 tests/gem_fence_upload.c           |  8 ++---
 tests/gem_gtt_cpu_tlb.c            |  4 +--
 tests/gem_gtt_hog.c                |  4 +--
 tests/gem_gtt_speed.c              | 30 ++++++++---------
 tests/gem_largeobject.c            |  2 +-
 tests/gem_madvise.c                |  4 +--
 tests/gem_mmap.c                   |  4 +--
 tests/gem_mmap_gtt.c               | 24 +++++++-------
 tests/gem_mmap_offset_exhaustion.c |  2 +-
 tests/gem_mmap_wc.c                | 14 ++++----
 tests/gem_persistent_relocs.c      |  2 +-
 tests/gem_pwrite.c                 |  2 +-
 tests/gem_pwrite_pread.c           | 16 ++++-----
 tests/gem_reloc_overflow.c         |  2 +-
 tests/gem_reloc_vs_gpu.c           |  2 +-
 tests/gem_set_tiling_vs_gtt.c      |  2 +-
 tests/gem_set_tiling_vs_pwrite.c   |  2 +-
 tests/gem_streaming_writes.c       | 20 +++++------
 tests/gem_tiled_pread_basic.c      |  2 +-
 tests/gem_tiled_pread_pwrite.c     |  4 +--
 tests/gem_tiled_swapping.c         |  6 ++--
 tests/gem_tiled_wb.c               |  4 +--
 tests/gem_tiled_wc.c               |  4 +--
 tests/gem_tiling_max_stride.c      |  2 +-
 tests/gem_userptr_blits.c          |  8 ++---
 tests/gen3_mixed_blits.c           |  4 +--
 tests/gen3_render_mixed_blits.c    |  4 +--
 tests/gen3_render_tiledx_blits.c   |  4 +--
 tests/gen3_render_tiledy_blits.c   |  4 +--
 tests/gen7_forcewake_mt.c          |  2 +-
 tests/kms_fbc_crc.c                |  4 +--
 tests/kms_fence_pin_leak.c         |  2 +-
 tests/kms_psr_sink_crc.c           |  6 ++--
 tests/pm_rpm.c                     | 12 +++----
 tests/prime_self_import.c          |  4 +--
 tests/testdisplay.c                |  2 +-
 52 files changed, 212 insertions(+), 152 deletions(-)

diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c
index 3ed2300..e722541 100644
--- a/benchmarks/gem_blt.c
+++ b/benchmarks/gem_blt.c
@@ -177,7 +177,7 @@ static int run(int object, int batch, int count, int reps)
 
 	fd = drm_open_driver(DRIVER_INTEL);
 	handle = gem_create(fd, size);
-	buf = gem_mmap__cpu(fd, handle, 0, size, PROT_WRITE);
+	buf = __gem_mmap__cpu(fd, handle, 0, size, PROT_WRITE);
 	igt_assert(buf);
 
 	gen = intel_gen(intel_get_drm_devid(fd));
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index 274ce41..5be482a 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -115,13 +115,13 @@ static int run(unsigned batch_size,
 	if (num_relocs) {
 		size = ALIGN(sizeof(*mem_reloc)*num_relocs, 4096);
 		reloc_handle = gem_create(fd, size);
-		reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+		reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 		memcpy(reloc, mem_reloc, sizeof(*mem_reloc)*num_relocs);
 		munmap(reloc, size);
 
 		if (flags & FAULT) {
 			igt_disable_prefault();
-			reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+			reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 		} else
 			reloc = mem_reloc;
 	}
@@ -162,7 +162,7 @@ static int run(unsigned batch_size,
 			}
 			if (flags & FAULT && reloc) {
 				munmap(reloc, size);
-				reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+				reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 				gem_exec[num_objects].relocs_ptr = (uintptr_t)reloc;
 			}
 			gem_execbuf(fd, &execbuf);
diff --git a/benchmarks/gem_mmap.c b/benchmarks/gem_mmap.c
index 6bf7fd3..571f757 100644
--- a/benchmarks/gem_mmap.c
+++ b/benchmarks/gem_mmap.c
@@ -115,17 +115,17 @@ int main(int argc, char **argv)
 	handle = gem_create(fd, OBJECT_SIZE);
 	switch (map) {
 	case CPU:
-		ptr = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
+		ptr = __gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
 		break;
 	case GTT:
-		ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE);
+		ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 		break;
 	case WC:
-		ptr = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
+		ptr = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 		break;
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
index 4083070..6dddded 100644
--- a/demos/intel_sprite_on.c
+++ b/demos/intel_sprite_on.c
@@ -359,7 +359,7 @@ static int prepare_primary_surface(int fd, int prim_width, int prim_height,
 	if (tiled)
 		gem_set_tiling(fd, *prim_handle, I915_TILING_X, *prim_stride);
 
-	prim_fb_ptr = gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
+	prim_fb_ptr = __gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
 
 	if (prim_fb_ptr != NULL) {
 		// Write primary surface with gray background
@@ -454,7 +454,7 @@ static int prepare_sprite_surfaces(int fd, int sprite_width, int sprite_height,
 			gem_set_tiling(fd, sprite_handles[i], I915_TILING_X, *sprite_stride);
 
 		// Get pointer to the surface
-		sprite_fb_ptr = gem_mmap__gtt(fd,
+		sprite_fb_ptr = __gem_mmap__gtt(fd,
 				sprite_handles[i], *sprite_size,
 				PROT_READ | PROT_WRITE);
 
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 38ecae0..07aa812 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -252,7 +252,7 @@ static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
 	if (tiling != I915_TILING_NONE)
 		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
 
-	ptr = gem_mmap__cpu(fd, buf->handle, 0, buf->size, 0);
+	ptr = __gem_mmap__cpu(fd, buf->handle, 0, buf->size, 0);
 	igt_assert(ptr);
 
 	switch (tiling) {
@@ -281,7 +281,7 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
 	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
 		       I915_GEM_DOMAIN_GTT);
 
-	ptr = gem_mmap__gtt(fd, buf->handle, buf->size, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, buf->handle, buf->size, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	draw_rect_ptr_linear(ptr, buf->stride, rect, color, buf->bpp);
@@ -303,7 +303,7 @@ static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
 	if (tiling != I915_TILING_NONE)
 		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
 
-	ptr = gem_mmap__wc(fd, buf->handle, 0, buf->size,
+	ptr = __gem_mmap__wc(fd, buf->handle, 0, buf->size,
 			   PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index e225f8a..5ab063f 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -745,7 +745,7 @@ static void create_cairo_surface__blit(int fd, struct igt_fb *fb)
 		       I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
 
 	/* Setup cairo context */
-	blit->linear.map = gem_mmap__cpu(fd,
+	blit->linear.map = __gem_mmap__cpu(fd,
 					 blit->linear.handle,
 					 0,
 					 blit->linear.size,
@@ -774,7 +774,7 @@ static void destroy_cairo_surface__gtt(void *arg)
 
 static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
 {
-	void *ptr = gem_mmap__gtt(fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE);
+	void *ptr = __gem_mmap__gtt(fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	fb->cairo_surface =
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index eb745bc..36982a7 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -447,7 +447,7 @@ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 }
 
 /**
- * gem_mmap__gtt:
+ * __gem_mmap__gtt:
  * @fd: open i915 drm file descriptor
  * @handle: gem buffer object handle
  * @size: size of the gem buffer
@@ -458,7 +458,7 @@ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
  *
  * Returns: A pointer to the created memory mapping, NULL on failure.
  */
-void *gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
+void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
 {
 	struct drm_i915_gem_mmap_gtt mmap_arg;
 	void *ptr;
@@ -477,6 +477,24 @@ void *gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
 	return ptr;
 }
 
+/**
+ * gem_mmap__gtt:
+ * @fd: open i915 drm file descriptor
+ * @handle: gem buffer object handle
+ * @size: size of the gem buffer
+ * @prot: memory protection bits as used by mmap()
+ *
+ * Like __gem_mmap__gtt() except we assert on failure.
+ *
+ * Returns: A pointer to the created memory mapping
+ */
+void *gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
+{
+	void *ptr = __gem_mmap__gtt(fd, handle, size, prot);
+	igt_assert(ptr);
+	return ptr;
+}
+
 struct local_i915_gem_mmap_v2 {
 	uint32_t handle;
 	uint32_t pad;
@@ -523,7 +541,7 @@ bool gem_mmap__has_wc(int fd)
 }
 
 /**
- * gem_mmap__wc:
+ * __gem_mmap__wc:
  * @fd: open i915 drm file descriptor
  * @handle: gem buffer object handle
  * @offset: offset in the gem buffer of the mmap arena
@@ -537,7 +555,7 @@ bool gem_mmap__has_wc(int fd)
  *
  * Returns: A pointer to the created memory mapping, NULL on failure.
  */
-void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
+void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
 {
 	struct local_i915_gem_mmap_v2 arg;
 
@@ -559,7 +577,26 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
 }
 
 /**
- * gem_mmap__cpu:
+ * gem_mmap__wc:
+ * @fd: open i915 drm file descriptor
+ * @handle: gem buffer object handle
+ * @offset: offset in the gem buffer of the mmap arena
+ * @size: size of the mmap arena
+ * @prot: memory protection bits as used by mmap()
+ *
+ * Like __gem_mmap__wc() except we assert on failure.
+ *
+ * Returns: A pointer to the created memory mapping
+ */
+void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
+{
+	void *ptr = __gem_mmap__wc(fd, handle, offset, size, prot);
+	igt_assert(ptr);
+	return ptr;
+}
+
+/**
+ * __gem_mmap__cpu:
  * @fd: open i915 drm file descriptor
  * @handle: gem buffer object handle
  * @offset: offset in the gem buffer of the mmap arena
@@ -571,7 +608,7 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
  *
  * Returns: A pointer to the created memory mapping, NULL on failure.
  */
-void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
+void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
 {
 	struct drm_i915_gem_mmap mmap_arg;
 
@@ -587,6 +624,25 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
 }
 
 /**
+ * gem_mmap__cpu:
+ * @fd: open i915 drm file descriptor
+ * @handle: gem buffer object handle
+ * @offset: offset in the gem buffer of the mmap arena
+ * @size: size of the mmap arena
+ * @prot: memory protection bits as used by mmap()
+ *
+ * Like __gem_mmap__cpu() except we assert on failure.
+ *
+ * Returns: A pointer to the created memory mapping
+ */
+void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
+{
+	void *ptr = __gem_mmap__cpu(fd, handle, offset, size, prot);
+	igt_assert(ptr);
+	return ptr;
+}
+
+/**
  * gem_madvise:
  * @fd: open i915 drm file descriptor
  * @handle: gem buffer object handle
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 7c607a2..7505acb 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -66,6 +66,10 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns
 bool gem_mmap__has_wc(int fd);
 void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
 
+void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot);
+void *__gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
+void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot);
+
 /**
  * gem_require_mmap_wc:
  * @fd: open i915 drm file descriptor
diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index 4e84d1c..b85dd2f 100644
--- a/tests/drv_suspend.c
+++ b/tests/drv_suspend.c
@@ -56,19 +56,19 @@ test_fence_restore(int fd, bool tiled2untiled, bool hibernate)
 	handle_tiled = gem_create(fd, OBJECT_SIZE);
 
 	/* Access the buffer objects in the order we want to have the laid out. */
-	ptr1 = gem_mmap__gtt(fd, handle1, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr1 = __gem_mmap__gtt(fd, handle1, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr1);
 	for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
 		ptr1[i] = i;
 
-	ptr_tiled = gem_mmap__gtt(fd, handle_tiled, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr_tiled = __gem_mmap__gtt(fd, handle_tiled, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr_tiled);
 	if (tiled2untiled)
 		gem_set_tiling(fd, handle_tiled, I915_TILING_X, 2048);
 	for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
 		ptr_tiled[i] = i;
 
-	ptr2 = gem_mmap__gtt(fd, handle2, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr2 = __gem_mmap__gtt(fd, handle2, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr2);
 	for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
 		ptr2[i] = i;
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 6efb977..5b8c3f0 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -171,7 +171,7 @@ wc_create_bo(drm_intel_bufmgr *bufmgr, int width, int height)
 	gem_require_mmap_wc(fd);
 
 	bo = unmapped_create_bo(bufmgr, width, height);
-	bo->virtual = gem_mmap__wc(fd, bo->handle, 0, bo->size, PROT_READ | PROT_WRITE);
+	bo->virtual = __gem_mmap__wc(fd, bo->handle, 0, bo->size, PROT_READ | PROT_WRITE);
 	return bo;
 }
 
@@ -471,9 +471,9 @@ static void cpu_copy_bo(drm_intel_bo *dst, drm_intel_bo *src)
 
 	gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_CPU, 0);
 	gem_set_domain(fd, dst->handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
-	s = gem_mmap__cpu(fd, src->handle, 0, size, PROT_READ);
+	s = __gem_mmap__cpu(fd, src->handle, 0, size, PROT_READ);
 	igt_assert(s);
-	d = gem_mmap__cpu(fd, dst->handle, 0, size, PROT_WRITE);
+	d = __gem_mmap__cpu(fd, dst->handle, 0, size, PROT_WRITE);
 	igt_assert(d);
 
 	memcpy(d, s, size);
@@ -490,9 +490,9 @@ static void gtt_copy_bo(drm_intel_bo *dst, drm_intel_bo *src)
 	gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0);
 	gem_set_domain(fd, dst->handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
-	s = gem_mmap__gtt(fd, src->handle, size, PROT_READ);
+	s = __gem_mmap__gtt(fd, src->handle, size, PROT_READ);
 	igt_assert(s);
-	d = gem_mmap__gtt(fd, dst->handle, size, PROT_WRITE);
+	d = __gem_mmap__gtt(fd, dst->handle, size, PROT_WRITE);
 	igt_assert(d);
 
 	memcpy(d, s, size);
@@ -509,9 +509,9 @@ static void wc_copy_bo(drm_intel_bo *dst, drm_intel_bo *src)
 	gem_set_domain(fd, src->handle, I915_GEM_DOMAIN_GTT, 0);
 	gem_set_domain(fd, dst->handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
-	s = gem_mmap__wc(fd, src->handle, 0, size, PROT_READ);
+	s = __gem_mmap__wc(fd, src->handle, 0, size, PROT_READ);
 	igt_assert(s);
-	d = gem_mmap__wc(fd, dst->handle, 0, size, PROT_WRITE);
+	d = __gem_mmap__wc(fd, dst->handle, 0, size, PROT_WRITE);
 	igt_assert(d);
 
 	memcpy(d, s, size);
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index a647ddf..71e5996 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -115,7 +115,7 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
 		igt_progress(buf, split, BATCH_SIZE/8 - 1);
 
 		handle_new = gem_create(fd, BATCH_SIZE);
-		batch_ptr = gem_mmap__cpu(fd, handle_new, 0, BATCH_SIZE,
+		batch_ptr = __gem_mmap__cpu(fd, handle_new, 0, BATCH_SIZE,
 					  PROT_READ | PROT_WRITE);
 		igt_assert(batch_ptr);
 		batch_ptr[split*2] = MI_BATCH_BUFFER_END;
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 12ad6df..93ec7a5 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -132,7 +132,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo)
 
 static void clear(int fd, uint32_t handle, int size)
 {
-	void *base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+	void *base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 
 	igt_assert(base != NULL);
 	memset(base, 0, size);
diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c
index 1cc7da6..4ea1943 100644
--- a/tests/gem_exec_big.c
+++ b/tests/gem_exec_big.c
@@ -203,9 +203,9 @@ igt_simple_main
 		gem_write(fd, handle, 0, batch, sizeof(batch));
 
 		if (!FORCE_PREAD_PWRITE && gem_has_llc(fd))
-			ptr = gem_mmap__cpu(fd, handle, 0, batch_size, PROT_READ);
+			ptr = __gem_mmap__cpu(fd, handle, 0, batch_size, PROT_READ);
 		else if (!FORCE_PREAD_PWRITE && gem_mmap__has_wc(fd))
-			ptr = gem_mmap__wc(fd, handle, 0, batch_size, PROT_READ);
+			ptr = __gem_mmap__wc(fd, handle, 0, batch_size, PROT_READ);
 		else
 			ptr = NULL;
 
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c
index e16b580..67fc410 100644
--- a/tests/gem_exec_faulting_reloc.c
+++ b/tests/gem_exec_faulting_reloc.c
@@ -200,7 +200,7 @@ static void run(int object_size)
 
 	handle_relocs = gem_create(fd, 4096);
 	gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc));
-	gtt_relocs = gem_mmap__gtt(fd, handle_relocs, 4096,
+	gtt_relocs = __gem_mmap__gtt(fd, handle_relocs, 4096,
 			      PROT_READ | PROT_WRITE);
 	igt_assert(gtt_relocs);
 
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index 282fccf..0af27bb 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -123,7 +123,7 @@ igt_simple_main
 
 	size = ALIGN(sizeof(mem_reloc), 4096);
 	reloc_handle = gem_create(fd, size);
-	reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+	reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 	igt_assert(reloc);
 	for (n = 0; n < MAX_NUM_RELOC; n++) {
 		reloc[n].offset = 1024;
@@ -148,7 +148,7 @@ igt_simple_main
 				struct timeval start, end;
 
 				if (p->flags & FAULT)
-					reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+					reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 				else
 					reloc = mem_reloc;
 
@@ -182,7 +182,7 @@ igt_simple_main
 					}
 					if (p->flags & FAULT) {
 						munmap(reloc, size);
-						reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+						reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 						gem_exec[MAX_NUM_EXEC].relocs_ptr = (uintptr_t)reloc;
 					}
 					gem_execbuf(fd, &execbuf);
@@ -212,7 +212,7 @@ igt_simple_main
 					}
 					if (p->flags & FAULT) {
 						munmap(reloc, size);
-						reloc = gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
+						reloc = __gem_mmap__cpu(fd, reloc_handle, 0, size, PROT_READ | PROT_WRITE);
 						gem_exec[MAX_NUM_EXEC].relocs_ptr = (uintptr_t)reloc;
 					}
 					gem_execbuf(fd, &execbuf);
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 1b828b8..1161e73 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -67,14 +67,14 @@ bo_create (int fd, int tiling)
 	handle = gem_create(fd, OBJECT_SIZE);
 
 	/* dirty cpu caches a bit ... */
-	ptr = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 	memset(ptr, 0, OBJECT_SIZE);
 	munmap(ptr, OBJECT_SIZE);
 
 	gem_set_tiling(fd, handle, tiling, 1024);
 
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
diff --git a/tests/gem_fence_upload.c b/tests/gem_fence_upload.c
index 047b783..d2cbc30 100644
--- a/tests/gem_fence_upload.c
+++ b/tests/gem_fence_upload.c
@@ -68,7 +68,7 @@ static void performance(void)
 
 		for (n = 0; n < count; n++) {
 			handle[n] = gem_create(fd, OBJECT_SIZE);
-			ptr[n] = gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
+			ptr[n] = __gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
 			igt_assert(ptr[n]);
 		}
 
@@ -176,7 +176,7 @@ static void thread_performance(unsigned mask)
 
 		for (n = 0; n < count; n++) {
 			handle[n] = gem_create(fd, OBJECT_SIZE);
-			ptr[n] = gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
+			ptr[n] = __gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
 			igt_assert(ptr[n]);
 
 			if (mask & READ) {
@@ -257,7 +257,7 @@ static void *no_contention(void *closure)
 	int n;
 
 	for (n = 0; n < t->loops; n++) {
-		uint32_t *ptr = gem_mmap__gtt(t->fd, t->handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+		uint32_t *ptr = __gem_mmap__gtt(t->fd, t->handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 		igt_assert(ptr);
 		memset(ptr + (rand() % 256) * 4096 / 4, 0, 4096);
 		munmap(ptr, OBJECT_SIZE);
@@ -272,7 +272,7 @@ static void *wc_mmap(void *closure)
 	int n;
 
 	for (n = 0; n < t->loops; n++) {
-		uint32_t *ptr = gem_mmap__wc(t->fd, t->handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+		uint32_t *ptr = __gem_mmap__wc(t->fd, t->handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 		igt_assert(ptr);
 		memset(ptr + (rand() % 256) * 4096 / 4, 0, 4096);
 		munmap(ptr, OBJECT_SIZE);
diff --git a/tests/gem_gtt_cpu_tlb.c b/tests/gem_gtt_cpu_tlb.c
index 75c3d04..9125c34 100644
--- a/tests/gem_gtt_cpu_tlb.c
+++ b/tests/gem_gtt_cpu_tlb.c
@@ -59,7 +59,7 @@ create_bo(int fd)
 	handle = gem_create(fd, OBJ_SIZE);
 
 	/* Fill the BO with dwords starting at start_val */
-	data = gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(data);
 	for (i = 0; i < OBJ_SIZE/4; i++)
 		data[i] = i;
@@ -83,7 +83,7 @@ igt_simple_main
 	handle = gem_create(fd, OBJ_SIZE);
 
 	/* touch one page */
-	ptr = gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 	*ptr = 0xdeadbeef;
 	munmap(ptr, OBJ_SIZE);
diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index cbb7016..28df7a7 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -140,11 +140,11 @@ static void run(data_t *data, int child)
 	 * set-to-gtt-domain within the fault handler.
 	 */
 	if (write) {
-		ptr = gem_mmap__gtt(data->fd, handle, size, PROT_READ | PROT_WRITE);
+		ptr = __gem_mmap__gtt(data->fd, handle, size, PROT_READ | PROT_WRITE);
 		igt_assert(ptr);
 		ptr[rand() % (size / 4)] = canary;
 	} else {
-		ptr = gem_mmap__gtt(data->fd, handle, size, PROT_READ);
+		ptr = __gem_mmap__gtt(data->fd, handle, size, PROT_READ);
 		igt_assert(ptr);
 	}
 	x = ptr[rand() % (size / 4)];
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index ed45bba..7228718 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
 				       I915_GEM_DOMAIN_CPU);
 
 			{
-				uint32_t *base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				volatile uint32_t *ptr = base;
 				int x = 0;
 
@@ -106,7 +106,7 @@ int main(int argc, char **argv)
 				/* mmap read */
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+					base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 					ptr = base;
 					x = 0;
 
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
 				/* mmap write */
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+					base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 					ptr = base;
 
 					igt_assert(base);
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
 
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+					base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 					igt_assert(base);
 					memset(base, 0, size);
 					munmap(base, size);
@@ -153,7 +153,7 @@ int main(int argc, char **argv)
 					 size/1024, elapsed(&start, &end, loop));
 
 				gettimeofday(&start, NULL);
-				base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				base = __gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				igt_assert(base);
 				for (loop = 0; loop < 1000; loop++)
 					memset(base, 0, size);
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
 
 		/* prefault into gtt */
 		{
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			volatile uint32_t *ptr = base;
 			int x = 0;
 
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
 		/* mmap read */
 		gettimeofday(&start, NULL);
 		for (loop = 0; loop < 1000; loop++) {
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			volatile uint32_t *ptr = base;
 			int x = 0;
 
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
 		if (gem_mmap__has_wc(fd)) {
 			gettimeofday(&start, NULL);
 			for (loop = 0; loop < 1000; loop++) {
-				uint32_t *base = gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = __gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				volatile uint32_t *ptr = base;
 				int x = 0;
 
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
 		/* mmap write */
 		gettimeofday(&start, NULL);
 		for (loop = 0; loop < 1000; loop++) {
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			volatile uint32_t *ptr = base;
 
 			igt_assert(base);
@@ -261,7 +261,7 @@ int main(int argc, char **argv)
 			/* mmap write */
 			gettimeofday(&start, NULL);
 			for (loop = 0; loop < 1000; loop++) {
-				uint32_t *base = gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = __gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				volatile uint32_t *ptr = base;
 
 				igt_assert(base);
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
 		/* mmap clear */
 		gettimeofday(&start, NULL);
 		for (loop = 0; loop < 1000; loop++) {
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			memset(base, 0, size);
 			munmap(base, size);
 		}
@@ -291,7 +291,7 @@ int main(int argc, char **argv)
 			/* mmap clear */
 			gettimeofday(&start, NULL);
 			for (loop = 0; loop < 1000; loop++) {
-				uint32_t *base = gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = __gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				memset(base, 0, size);
 				munmap(base, size);
 			}
@@ -301,7 +301,7 @@ int main(int argc, char **argv)
 		}
 
 		gettimeofday(&start, NULL);{
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			for (loop = 0; loop < 1000; loop++)
 				memset(base, 0, size);
 			munmap(base, size);
@@ -311,7 +311,7 @@ int main(int argc, char **argv)
 
 		if (gem_mmap__has_wc(fd)) {
 			gettimeofday(&start, NULL);{
-				uint32_t *base = gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = __gem_mmap__wc(fd, handle, 0, size, PROT_READ | PROT_WRITE);
 				for (loop = 0; loop < 1000; loop++)
 					memset(base, 0, size);
 				munmap(base, size);
@@ -323,7 +323,7 @@ int main(int argc, char **argv)
 		/* mmap read */
 		gettimeofday(&start, NULL);
 		for (loop = 0; loop < 1000; loop++) {
-			uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+			uint32_t *base = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 			volatile uint32_t *ptr = base;
 			int x = 0;
 
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index d261939..0da8205 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -64,7 +64,7 @@ test_large_object(int fd)
 	igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create) == 0);
 
 	/* prefault */
-	ptr = gem_mmap__gtt(fd, create.handle, obj_size, PROT_WRITE | PROT_READ);
+	ptr = __gem_mmap__gtt(fd, create.handle, obj_size, PROT_WRITE | PROT_READ);
 	igt_assert(ptr);
 	*ptr = 0;
 
diff --git a/tests/gem_madvise.c b/tests/gem_madvise.c
index d0f378e..093d78a 100644
--- a/tests/gem_madvise.c
+++ b/tests/gem_madvise.c
@@ -63,7 +63,7 @@ dontneed_before_mmap(void)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 	gem_madvise(fd, handle, I915_MADV_DONTNEED);
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr == NULL);
 	igt_assert(errno == EFAULT);
 	close(fd);
@@ -77,7 +77,7 @@ dontneed_after_mmap(void)
 	char *ptr;
 
 	handle = gem_create(fd, OBJECT_SIZE);
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 	gem_madvise(fd, handle, I915_MADV_DONTNEED);
 	close(fd);
diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index 4188429..37d0933 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -80,7 +80,7 @@ test_huge_bo(int huge)
 	bo = gem_create(fd, huge_object_size);
 
 	/* Obtain CPU mapping for the object. */
-	ptr_cpu = gem_mmap__cpu(fd, bo, 0, huge_object_size,
+	ptr_cpu = __gem_mmap__cpu(fd, bo, 0, huge_object_size,
 				PROT_READ | PROT_WRITE);
 	igt_require(ptr_cpu);
 	gem_set_domain(fd, bo, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
@@ -166,7 +166,7 @@ igt_main
 	igt_subtest("short-mmap") {
 		igt_assert(OBJECT_SIZE > 4096);
 		arg.handle = gem_create(fd, OBJECT_SIZE);
-		addr = gem_mmap__cpu(fd, arg.handle, 0, 4096, PROT_WRITE);
+		addr = __gem_mmap__cpu(fd, arg.handle, 0, 4096, PROT_WRITE);
 		igt_assert(addr);
 		memset(addr, 0, 4096);
 		munmap(addr, 4096);
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 5b782c9..0cfb6f6 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -56,7 +56,7 @@ mmap_bo(int fd, uint32_t handle)
 {
 	void *ptr;
 
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	return ptr;
@@ -179,7 +179,7 @@ test_read_write(int fd, enum test_read_write order)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	if (order == READ_BEFORE_WRITE) {
@@ -203,10 +203,10 @@ test_read_write2(int fd, enum test_read_write order)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
-	r = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
+	r = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
 	igt_assert(r);
 
-	w = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	w = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(w);
 
 	if (order == READ_BEFORE_WRITE) {
@@ -291,12 +291,12 @@ test_huge_bo(int fd, int huge, int tiling)
 	bo = gem_create(fd, PAGE_SIZE);
 	if (tiling)
 		gem_set_tiling(fd, bo, tiling, pitch);
-	linear_pattern = gem_mmap__gtt(fd, bo, PAGE_SIZE,
+	linear_pattern = __gem_mmap__gtt(fd, bo, PAGE_SIZE,
 				       PROT_READ | PROT_WRITE);
 	igt_assert(linear_pattern);
 	for (i = 0; i < PAGE_SIZE; i++)
 		linear_pattern[i] = i;
-	tiled_pattern = gem_mmap__cpu(fd, bo, 0, PAGE_SIZE, PROT_READ);
+	tiled_pattern = __gem_mmap__cpu(fd, bo, 0, PAGE_SIZE, PROT_READ);
 	igt_assert(tiled_pattern);
 
 	gem_set_domain(fd, bo, I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT, 0);
@@ -307,13 +307,13 @@ test_huge_bo(int fd, int huge, int tiling)
 		gem_set_tiling(fd, bo, tiling, pitch);
 
 	/* Initialise first/last page through CPU mmap */
-	ptr = gem_mmap__cpu(fd, bo, 0, size, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__cpu(fd, bo, 0, size, PROT_READ | PROT_WRITE);
 	memcpy(ptr, tiled_pattern, PAGE_SIZE);
 	memcpy(ptr + last_offset, tiled_pattern, PAGE_SIZE);
 	munmap(ptr, size);
 
 	/* Obtain mapping for the object through GTT. */
-	ptr = gem_mmap__gtt(fd, bo, size, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, bo, size, PROT_READ | PROT_WRITE);
 	igt_require_f(ptr, "Huge BO GTT mapping not supported.\n");
 
 	set_domain_gtt(fd, bo);
@@ -369,7 +369,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 	if (tiling_a)
 		gem_set_tiling(fd, bo, tiling_a,
 			       tiling_a == I915_TILING_Y ? 128 : 512);
-	a = gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
+	a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
 	igt_require(a);
 	gem_close(fd, bo);
 
@@ -380,7 +380,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 	if (tiling_b)
 		gem_set_tiling(fd, bo, tiling_b, 
 			       tiling_b == I915_TILING_Y ? 128 : 512);
-	b = gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
+	b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
 	igt_require(b);
 	gem_close(fd, bo);
 
@@ -440,10 +440,10 @@ test_write_cpu_read_gtt(int fd)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
-	dst = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
+	dst = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst);
 
-	src = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
+	src = __gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src);
 
 	gem_close(fd, handle);
diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c
index 3ce60f3..50153cc 100644
--- a/tests/gem_mmap_offset_exhaustion.c
+++ b/tests/gem_mmap_offset_exhaustion.c
@@ -60,7 +60,7 @@ create_and_map_bo(int fd)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	/* touch it to force it into the gtt */
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 11463ca..377749c 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -62,7 +62,7 @@ mmap_bo(int fd, uint32_t handle)
 {
 	void *ptr;
 
-	ptr = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	return ptr;
@@ -183,10 +183,10 @@ test_read_write2(int fd, enum test_read_write order)
 	handle = gem_create(fd, OBJECT_SIZE);
 	set_domain(fd, handle);
 
-	r = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
+	r = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(r);
 
-	w = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	w = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(w);
 
 	if (order == READ_BEFORE_WRITE) {
@@ -288,10 +288,10 @@ test_write_cpu_read_wc(int fd, int force_domain)
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
-	dst = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
+	dst = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst);
 
-	src = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
+	src = __gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src);
 
 	memset(src, 0xaa, OBJECT_SIZE);
@@ -315,10 +315,10 @@ test_write_gtt_read_wc(int fd)
 	handle = gem_create(fd, OBJECT_SIZE);
 	set_domain(fd, handle);
 
-	dst = gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
+	dst = __gem_mmap__wc(fd, handle, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst);
 
-	src = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE);
+	src = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src);
 
 	memset(src, 0xaa, OBJECT_SIZE);
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index 57024fc..db69f3a 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -225,7 +225,7 @@ static void do_test(int fd, bool faulting_reloc)
 
 		relocs_bo_handle[i] = gem_create(fd, 4096);
 		gem_write(fd, relocs_bo_handle[i], 0, reloc, sizeof(reloc));
-		gtt_relocs_ptr[i] = gem_mmap__gtt(fd, relocs_bo_handle[i], 4096,
+		gtt_relocs_ptr[i] = __gem_mmap__gtt(fd, relocs_bo_handle[i], 4096,
 				      PROT_READ | PROT_WRITE);
 		igt_assert(gtt_relocs_ptr[i]);
 
diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c
index fce71c7..8080981 100644
--- a/tests/gem_pwrite.c
+++ b/tests/gem_pwrite.c
@@ -118,7 +118,7 @@ static void test_big_gtt(int fd, int scale)
 	handle = gem_create(fd, size);
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
-	ptr = gem_mmap__wc(fd, handle, 0, size, PROT_READ);
+	ptr = __gem_mmap__wc(fd, handle, 0, size, PROT_READ);
 	igt_assert(ptr);
 
 	for (offset = 0; offset < size; offset += 4096) {
diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c
index 1e8f5be..5408140 100644
--- a/tests/gem_pwrite_pread.c
+++ b/tests/gem_pwrite_pread.c
@@ -112,9 +112,9 @@ static void as_gtt_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len,
 	uint32_t *src_ptr, *dst_ptr;
 	BUILD_EXEC;
 
-	src_ptr = gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_WRITE);
+	src_ptr = __gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src_ptr);
-	dst_ptr = gem_mmap__gtt(fd, dst, OBJECT_SIZE, PROT_READ);
+	dst_ptr = __gem_mmap__gtt(fd, dst, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst_ptr);
 
 	while (loops--) {
@@ -139,9 +139,9 @@ static void as_cpu_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len,
 	uint32_t *src_ptr, *dst_ptr;
 	BUILD_EXEC;
 
-	src_ptr = gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_WRITE);
+	src_ptr = __gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src_ptr);
-	dst_ptr = gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
+	dst_ptr = __gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst_ptr);
 
 	while (loops--) {
@@ -186,9 +186,9 @@ static void test_as_gtt_mmap(int fd, uint32_t src, uint32_t dst, int len)
 	int i;
 	BUILD_EXEC;
 
-	src_ptr = gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_WRITE);
+	src_ptr = __gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src_ptr);
-	dst_ptr = gem_mmap__gtt(fd, dst, OBJECT_SIZE, PROT_READ);
+	dst_ptr = __gem_mmap__gtt(fd, dst, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst_ptr);
 
 	gem_set_domain(fd, src, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -212,9 +212,9 @@ static void test_as_cpu_mmap(int fd, uint32_t src, uint32_t dst, int len)
 	int i;
 	BUILD_EXEC;
 
-	src_ptr = gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_WRITE);
+	src_ptr = __gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_WRITE);
 	igt_assert(src_ptr);
-	dst_ptr = gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
+	dst_ptr = __gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(dst_ptr);
 
 	gem_set_domain(fd, src, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index 5d794cd..662e88c 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -85,7 +85,7 @@ static void source_offset_tests(int devid, bool reloc_gtt)
 		execbuf.buffer_count = 2;
 
 		if (reloc_gtt) {
-			dst_gtt = gem_mmap__gtt(fd, handle, 8192, PROT_READ | PROT_WRITE);
+			dst_gtt = __gem_mmap__gtt(fd, handle, 8192, PROT_READ | PROT_WRITE);
 			igt_assert(dst_gtt != MAP_FAILED);
 			gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 			memset(dst_gtt, 0, 8192);
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index e31928e..59ba8c0 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -162,7 +162,7 @@ static void reloc_and_emit(int fd, drm_intel_bo *target_bo, bool faulting_reloc)
 
 	handle_relocs = gem_create(fd, 4096);
 	gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc));
-	gtt_relocs = gem_mmap__gtt(fd, handle_relocs, 4096,
+	gtt_relocs = __gem_mmap__gtt(fd, handle_relocs, 4096,
 			      PROT_READ | PROT_WRITE);
 	igt_assert(gtt_relocs);
 
diff --git a/tests/gem_set_tiling_vs_gtt.c b/tests/gem_set_tiling_vs_gtt.c
index 619bd1d..6f04735 100644
--- a/tests/gem_set_tiling_vs_gtt.c
+++ b/tests/gem_set_tiling_vs_gtt.c
@@ -66,7 +66,7 @@ igt_simple_main
 		tile_height = 8;
 
 	handle = gem_create(fd, OBJECT_SIZE);
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	/* gtt coherency is done with set_domain in libdrm, don't break that */
diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index ed6d763..5c2e93a 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -62,7 +62,7 @@ igt_simple_main
 		data[i] = i;
 
 	handle = gem_create(fd, OBJECT_SIZE);
-	ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE);
diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c
index 3f7ed95..6664582 100644
--- a/tests/gem_streaming_writes.c
+++ b/tests/gem_streaming_writes.c
@@ -88,21 +88,21 @@ static void test_streaming(int fd, int mode, int sync)
 	switch (mode) {
 	case 0: /* cpu/snoop */
 		gem_set_caching(fd, src, I915_CACHING_CACHED);
-		s = gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+		s = __gem_mmap__cpu(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 		igt_assert(s);
 		break;
 	case 1: /* gtt */
-		s = gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+		s = __gem_mmap__gtt(fd, src, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 		igt_assert(s);
 		break;
 	case 2: /* wc */
-		s = gem_mmap__wc(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+		s = __gem_mmap__wc(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 		igt_assert(s);
 		break;
 	}
 	*s = 0; /* fault the object into the mappable range first (for GTT) */
 
-	d = gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
+	d = __gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(d);
 
 	gem_write(fd, dst, 0, tmp, sizeof(tmp));
@@ -154,7 +154,7 @@ static void test_streaming(int fd, int mode, int sync)
 		batch[i].handle = gem_create(fd, 4096);
 		batch[i].offset = 0;
 
-		base = gem_mmap__cpu(fd, batch[i].handle, 0, 4096, PROT_WRITE);
+		base = __gem_mmap__cpu(fd, batch[i].handle, 0, 4096, PROT_WRITE);
 		igt_assert(base);
 
 		for (int j = 0; j < 64; j++) {
@@ -254,10 +254,10 @@ static void test_batch(int fd, int mode, int reverse)
 	exec[DST].handle = gem_create(fd, OBJECT_SIZE);
 	exec[SRC].handle = gem_create(fd, OBJECT_SIZE);
 
-	s = gem_mmap__wc(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	s = __gem_mmap__wc(fd, src, 0, OBJECT_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(s);
 
-	d = gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
+	d = __gem_mmap__cpu(fd, dst, 0, OBJECT_SIZE, PROT_READ);
 	igt_assert(d);
 
 	memset(reloc, 0, sizeof(reloc));
@@ -285,15 +285,15 @@ static void test_batch(int fd, int mode, int reverse)
 	switch (mode) {
 	case 0: /* cpu/snoop */
 		igt_require(gem_has_llc(fd));
-		base = gem_mmap__cpu(fd, exec[BATCH].handle, 0, batch_size, PROT_READ | PROT_WRITE);
+		base = __gem_mmap__cpu(fd, exec[BATCH].handle, 0, batch_size, PROT_READ | PROT_WRITE);
 		igt_assert(base);
 		break;
 	case 1: /* gtt */
-		base = gem_mmap__gtt(fd, exec[BATCH].handle, batch_size, PROT_READ | PROT_WRITE);
+		base = __gem_mmap__gtt(fd, exec[BATCH].handle, batch_size, PROT_READ | PROT_WRITE);
 		igt_assert(base);
 		break;
 	case 2: /* wc */
-		base = gem_mmap__wc(fd, exec[BATCH].handle, 0, batch_size, PROT_READ | PROT_WRITE);
+		base = __gem_mmap__wc(fd, exec[BATCH].handle, 0, batch_size, PROT_READ | PROT_WRITE);
 		igt_assert(base);
 		break;
 	}
diff --git a/tests/gem_tiled_pread_basic.c b/tests/gem_tiled_pread_basic.c
index e1844b0..14a3706 100644
--- a/tests/gem_tiled_pread_basic.c
+++ b/tests/gem_tiled_pread_basic.c
@@ -72,7 +72,7 @@ create_bo(int fd)
 	gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t));
 
 	/* Fill the BO with dwords starting at start_val */
-	data = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
 	igt_assert(data);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		data[i] = i;
diff --git a/tests/gem_tiled_pread_pwrite.c b/tests/gem_tiled_pread_pwrite.c
index 6e048db..8ae23e3 100644
--- a/tests/gem_tiled_pread_pwrite.c
+++ b/tests/gem_tiled_pread_pwrite.c
@@ -79,7 +79,7 @@ create_bo_and_fill(int fd)
 	gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t));
 
 	/* Fill the BO with dwords starting at start_val */
-	data = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
 	igt_assert(data);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		data[i] = i;
@@ -123,7 +123,7 @@ igt_simple_main
 		gem_write(fd, handle_target, 0, linear, sizeof(linear));
 
 		/* Check the target bo's contents. */
-		data = gem_mmap__gtt(fd, handle_target, sizeof(linear), PROT_READ | PROT_WRITE);
+		data = __gem_mmap__gtt(fd, handle_target, sizeof(linear), PROT_READ | PROT_WRITE);
 		igt_assert(data);
 		for (j = 0; j < WIDTH*HEIGHT; j++)
 			igt_assert_f(data[j] == j,
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index a66523b..730e625 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -78,7 +78,7 @@ create_bo(int fd)
 	handle = gem_create(fd, LINEAR_DWORDS);
 	gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t));
 
-	data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
 	if (data == NULL) {
 		gem_close(fd, handle);
 		return 0;
@@ -94,7 +94,7 @@ fill_bo(int fd, uint32_t handle)
 	uint32_t *data;
 	int i;
 
-	data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
 	igt_assert(data);
 
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -109,7 +109,7 @@ check_bo(int fd, uint32_t handle)
 	uint32_t *data;
 	int j;
 
-	data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ);
+	data = __gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ);
 	igt_assert(data);
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0);
 	j = rand() % (WIDTH * HEIGHT);
diff --git a/tests/gem_tiled_wb.c b/tests/gem_tiled_wb.c
index 654628e..0a30a48 100644
--- a/tests/gem_tiled_wb.c
+++ b/tests/gem_tiled_wb.c
@@ -71,7 +71,7 @@ create_bo(int fd)
 	/* Write throught the fence to tiled the data.
 	 * We then manually detile on reading back through the mmap(wc).
 	 */
-	data = gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(data);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		data[i] = i;
@@ -179,7 +179,7 @@ igt_simple_main
 		last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
 		offset -= first_page;
 
-		linear = gem_mmap__cpu(fd, handle, first_page, last_page - first_page, PROT_READ);
+		linear = __gem_mmap__cpu(fd, handle, first_page, last_page - first_page, PROT_READ);
 		igt_assert(linear);
 
 
diff --git a/tests/gem_tiled_wc.c b/tests/gem_tiled_wc.c
index 3eee796..66b35c8 100644
--- a/tests/gem_tiled_wc.c
+++ b/tests/gem_tiled_wc.c
@@ -65,7 +65,7 @@ create_bo(int fd)
 	gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t));
 
 	/* Fill the BO with dwords starting at start_val */
-	data = gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
+	data = __gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(data);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		data[i] = i;
@@ -174,7 +174,7 @@ igt_simple_main
 		first_page = offset & ~(PAGE_SIZE-1);
 		last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
 
-		linear = gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ);
+		linear = __gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ);
 		igt_assert(linear);
 
 		/* Translate from offsets in the read buffer to the swizzled
diff --git a/tests/gem_tiling_max_stride.c b/tests/gem_tiling_max_stride.c
index 02c4ed2..0867335 100644
--- a/tests/gem_tiling_max_stride.c
+++ b/tests/gem_tiling_max_stride.c
@@ -97,7 +97,7 @@ igt_simple_main
 
 	handle = gem_create(fd, size);
 
-	ptr = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
 	igt_assert(ptr);
 
 	test_invalid_tiling(fd, handle, 0);
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index e6830f6..93461c2 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -544,7 +544,7 @@ static int test_invalid_gtt_mapping(int fd)
 
 	/* GTT mapping */
 	handle = create_bo(fd, 0);
-	ptr = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+	ptr = __gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
 	gem_close(fd, handle);
 	igt_assert(ptr);
 	igt_assert(((unsigned long)ptr & (PAGE_SIZE - 1)) == 0);
@@ -573,7 +573,7 @@ static void test_process_exit(int fd, int flags)
 		handle = create_userptr_bo(fd, sizeof(linear));
 
 		if (flags & PE_GTT_MAP) {
-			uint32_t *ptr = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+			uint32_t *ptr = __gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
 			if (ptr)
 				*ptr = 0;
 		}
@@ -688,12 +688,12 @@ static void *umap(int fd, uint32_t handle)
 	void *ptr;
 
 	if (gem_has_llc(fd)) {
-		ptr = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
+		ptr = __gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
 		igt_assert(ptr);
 	} else {
 		uint32_t tmp = gem_create(fd, sizeof(linear));
 		copy(fd, tmp, handle, 0);
-		ptr = gem_mmap__cpu(fd, tmp, 0, sizeof(linear), PROT_READ);
+		ptr = __gem_mmap__cpu(fd, tmp, 0, sizeof(linear), PROT_READ);
 		igt_assert(ptr);
 		gem_close(fd, tmp);
 	}
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 40b8e1e..0089eb3 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -426,7 +426,7 @@ create_bo(int fd, uint32_t val, int tiling)
 	gem_set_tiling(fd, handle, tiling, WIDTH*4);
 
 	/* Fill the BO with dwords starting at val */
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		v[i] = val++;
@@ -441,7 +441,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	uint32_t *v;
 	int i;
 
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++) {
 		igt_assert_f(v[i] == val,
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index cc2757b..6dd728d 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -314,7 +314,7 @@ create_bo(int fd, uint32_t val, int tiling)
 	gem_set_tiling(fd, handle, tiling, WIDTH*4);
 
 	/* Fill the BO with dwords starting at val */
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		v[i] = val++;
@@ -329,7 +329,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	uint32_t *v;
 	int i;
 
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++) {
 		igt_assert_f(v[i] == val,
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 9a243d8..1abcaaa 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -301,7 +301,7 @@ create_bo(int fd, uint32_t val)
 	gem_set_tiling(fd, handle, I915_TILING_X, WIDTH*4);
 
 	/* Fill the BO with dwords starting at val */
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		v[i] = val++;
@@ -316,7 +316,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	uint32_t *v;
 	int i;
 
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++) {
 		igt_assert_f(v[i] == val,
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 11fb002..e90645a 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -301,7 +301,7 @@ create_bo(int fd, uint32_t val)
 	gem_set_tiling(fd, handle, I915_TILING_Y, WIDTH*4);
 
 	/* Fill the BO with dwords starting at val */
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++)
 		v[i] = val++;
@@ -316,7 +316,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
 	uint32_t *v;
 	int i;
 
-	v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
+	v = __gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
 	igt_assert(v);
 	for (i = 0; i < WIDTH*HEIGHT; i++) {
 		igt_assert_f(v[i] == val,
diff --git a/tests/gen7_forcewake_mt.c b/tests/gen7_forcewake_mt.c
index 640fb82..f7a5aa1 100644
--- a/tests/gen7_forcewake_mt.c
+++ b/tests/gen7_forcewake_mt.c
@@ -190,7 +190,7 @@ igt_simple_main
 		gem_execbuf(t[0].fd, &execbuf);
 		gem_sync(t[0].fd, exec[1].handle);
 
-		p = gem_mmap__gtt(t[0].fd, exec[0].handle, 4096, PROT_READ);
+		p = __gem_mmap__gtt(t[0].fd, exec[0].handle, 4096, PROT_READ);
 		igt_assert(p);
 
 		igt_info("[%d]={ %08x %08x }\n", i, p[0], p[1]);
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index c1af5e6..c31dbdd 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -188,7 +188,7 @@ static void fill_mmap_cpu(data_t *data, uint32_t handle, unsigned char color)
 {
 	void *ptr;
 
-	ptr = gem_mmap__cpu(data->drm_fd, handle, 0, 4096, PROT_WRITE);
+	ptr = __gem_mmap__cpu(data->drm_fd, handle, 0, 4096, PROT_WRITE);
 	igt_assert(ptr);
 	gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_CPU,
 		       I915_GEM_DOMAIN_CPU);
@@ -201,7 +201,7 @@ static void fill_mmap_gtt(data_t *data, uint32_t handle, unsigned char color)
 {
 	void *ptr;
 
-	ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
+	ptr = __gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
 	igt_assert(ptr);
 	gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_GTT,
 		       I915_GEM_DOMAIN_GTT);
diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c
index 0f5d364..41ce084 100644
--- a/tests/kms_fence_pin_leak.c
+++ b/tests/kms_fence_pin_leak.c
@@ -89,7 +89,7 @@ static void touch_fences(data_t *data)
 		uint32_t handle = data->bos[i]->handle;
 		void *ptr;
 
-		ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
+		ptr = __gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 		memset(ptr, 0, 4);
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 720472f..2da2a61 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -379,7 +379,7 @@ static void run_test(data_t *data)
 		expected = "still GREEN";
 		break;
 	case MMAP_GTT:
-		ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
+		ptr = __gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
 				    PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(data->drm_fd, handle,
@@ -389,7 +389,7 @@ static void run_test(data_t *data)
 		expected = "BLACK or TRANSPARENT mark on top of plane in test";
 		break;
 	case MMAP_GTT_WAITING:
-		ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
+		ptr = __gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
 				    PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(data->drm_fd, handle,
@@ -413,7 +413,7 @@ static void run_test(data_t *data)
 		expected = "BLACK or TRANSPARENT mark on top of plane in test";
 		break;
 	case MMAP_CPU:
-		ptr = gem_mmap__cpu(data->drm_fd, handle, 0, data->mod_size, PROT_WRITE);
+		ptr = __gem_mmap__cpu(data->drm_fd, handle, 0, data->mod_size, PROT_WRITE);
 		igt_assert(ptr);
 		gem_set_domain(data->drm_fd, handle,
 			       I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 026220b..7c3e7ca 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -973,12 +973,12 @@ static void gem_mmap_subtest(bool gtt_mmap)
 	handle = gem_create(drm_fd, buf_size);
 
 	if (gtt_mmap) {
-		gem_buf = gem_mmap__gtt(drm_fd, handle, buf_size,
+		gem_buf = __gem_mmap__gtt(drm_fd, handle, buf_size,
 					PROT_READ | PROT_WRITE);
 		igt_assert(gem_buf);
 	}
 	else {
-		gem_buf = gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
+		gem_buf = __gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
 		igt_assert(gem_buf);
 	}
 
@@ -1012,12 +1012,12 @@ static void gem_mmap_subtest(bool gtt_mmap)
 	disable_all_screens_and_wait(&ms_data);
 
 	if (gtt_mmap) {
-		gem_buf = gem_mmap__gtt(drm_fd, handle, buf_size,
+		gem_buf = __gem_mmap__gtt(drm_fd, handle, buf_size,
 					PROT_READ | PROT_WRITE);
 		igt_assert(gem_buf);
 	}
 	else {
-		gem_buf = gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
+		gem_buf = __gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
 		igt_assert(gem_buf);
 	}
 
@@ -1474,7 +1474,7 @@ static void fill_igt_fb(struct igt_fb *fb, uint32_t color)
 	int i;
 	uint32_t *ptr;
 
-	ptr = gem_mmap__gtt(drm_fd, fb->gem_handle, fb->size, PROT_WRITE);
+	ptr = __gem_mmap__gtt(drm_fd, fb->gem_handle, fb->size, PROT_WRITE);
 	igt_assert(ptr);
 	for (i = 0; i < fb->size/sizeof(uint32_t); i++)
 		ptr[i] = color;
@@ -1756,7 +1756,7 @@ static void fences_subtest(bool dpms)
 	gem_get_tiling(drm_fd, params.fb.gem_handle, &tiling, &swizzle);
 	igt_assert(tiling);
 
-	buf_ptr = gem_mmap__gtt(drm_fd, params.fb.gem_handle,
+	buf_ptr = __gem_mmap__gtt(drm_fd, params.fb.gem_handle,
 				params.fb.size, PROT_WRITE | PROT_READ);
 	igt_assert(buf_ptr);
 	for (i = 0; i < params.fb.size/sizeof(uint32_t); i++)
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 582c375..23d349e 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -60,9 +60,9 @@ 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);
+	ptr1 = __gem_mmap__gtt(fd1, handle1, BO_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr1);
-	ptr2 = gem_mmap__gtt(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE);
+	ptr2 = __gem_mmap__gtt(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE);
 	igt_assert(ptr2);
 
 	/* check whether it's still our old object first. */
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index af2c5b5..6d206e3 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -221,7 +221,7 @@ paint_color_key(struct igt_fb *fb_info)
 	int i, j;
 	uint32_t *fb_ptr;
 
-	fb_ptr = gem_mmap__gtt(drm_fd, fb_info->gem_handle,
+	fb_ptr = __gem_mmap__gtt(drm_fd, fb_info->gem_handle,
 			  fb_info->size, PROT_READ | PROT_WRITE);
 	igt_assert(fb_ptr);
 
-- 
2.4.9

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux