summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 18:29:28 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 19:16:26 +0300
commitb8a77dd6c8e9f73493b2f86f293ff9c06fc08049 (patch)
tree7e43c045f1ff755144818b71b6d89942667c3565 /tests
parent106fe21373f9c3eadcd95fb4b48e452f9b328ffa (diff)
Make gem_mmap__{cpu,gtt,wc}() assert on failure
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@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/drv_suspend.c6
-rw-r--r--tests/gem_concurrent_all.c14
-rw-r--r--tests/gem_cs_tlb.c2
-rw-r--r--tests/gem_evict_everything.c2
-rw-r--r--tests/gem_exec_big.c4
-rw-r--r--tests/gem_exec_faulting_reloc.c2
-rw-r--r--tests/gem_exec_lut_handle.c8
-rw-r--r--tests/gem_fence_thrash.c4
-rw-r--r--tests/gem_fence_upload.c8
-rw-r--r--tests/gem_gtt_cpu_tlb.c4
-rw-r--r--tests/gem_gtt_hog.c4
-rw-r--r--tests/gem_gtt_speed.c30
-rw-r--r--tests/gem_largeobject.c2
-rw-r--r--tests/gem_madvise.c4
-rw-r--r--tests/gem_mmap.c4
-rw-r--r--tests/gem_mmap_gtt.c24
-rw-r--r--tests/gem_mmap_offset_exhaustion.c2
-rw-r--r--tests/gem_mmap_wc.c14
-rw-r--r--tests/gem_persistent_relocs.c2
-rw-r--r--tests/gem_pwrite.c2
-rw-r--r--tests/gem_pwrite_pread.c16
-rw-r--r--tests/gem_reloc_overflow.c2
-rw-r--r--tests/gem_reloc_vs_gpu.c2
-rw-r--r--tests/gem_set_tiling_vs_gtt.c2
-rw-r--r--tests/gem_set_tiling_vs_pwrite.c2
-rw-r--r--tests/gem_streaming_writes.c20
-rw-r--r--tests/gem_tiled_pread_basic.c2
-rw-r--r--tests/gem_tiled_pread_pwrite.c4
-rw-r--r--tests/gem_tiled_swapping.c6
-rw-r--r--tests/gem_tiled_wb.c4
-rw-r--r--tests/gem_tiled_wc.c4
-rw-r--r--tests/gem_tiling_max_stride.c2
-rw-r--r--tests/gem_userptr_blits.c8
-rw-r--r--tests/gen3_mixed_blits.c4
-rw-r--r--tests/gen3_render_mixed_blits.c4
-rw-r--r--tests/gen3_render_tiledx_blits.c4
-rw-r--r--tests/gen3_render_tiledy_blits.c4
-rw-r--r--tests/gen7_forcewake_mt.c2
-rw-r--r--tests/kms_fbc_crc.c4
-rw-r--r--tests/kms_fence_pin_leak.c2
-rw-r--r--tests/kms_psr_sink_crc.c6
-rw-r--r--tests/pm_rpm.c12
-rw-r--r--tests/prime_self_import.c4
-rw-r--r--tests/testdisplay.c2
44 files changed, 132 insertions, 132 deletions
diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index 4e84d1ce..b85dd2f2 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 6efb9775..5b8c3f05 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 a647ddf3..71e5996f 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 12ad6dfd..93ec7a5d 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 1cc7da61..4ea1943d 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 e16b5804..67fc4100 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 282fccf1..0af27bba 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 1b828b86..1161e73d 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 047b783b..d2cbc30e 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 75c3d043..9125c34e 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 cbb7016e..28df7a78 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 ed45bba3..72287187 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 d261939d..0da82057 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 d0f378ef..093d78ac 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 41884292..37d09339 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 5b782c9c..0cfb6f6c 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 3ce60f3f..50153cc6 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 11463ca3..377749c5 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 57024fc2..db69f3a2 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 fce71c74..80809815 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 1e8f5be9..54081409 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 5d794cdb..662e88c0 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 e31928e1..59ba8c01 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 619bd1d1..6f04735e 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 ed6d763f..5c2e93a9 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 3f7ed95a..6664582a 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 e1844b09..14a37065 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 6e048db4..8ae23e3e 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 a66523ba..730e625c 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 654628ec..0a30a481 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 3eee7967..66b35c8f 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 02c4ed28..0867335b 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 e6830f6b..93461c25 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 40b8e1e4..0089eb32 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 cc2757b0..6dd728d7 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 9a243d8a..1abcaaa0 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 11fb002b..e90645ad 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 640fb82e..f7a5aa19 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 c1af5e6f..c31dbdd2 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 0f5d3644..41ce084d 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 720472f0..2da2a612 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 026220ba..7c3e7ca2 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 582c375c..23d349e9 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 af2c5b55..6d206e35 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);