[PATCH 1/2] drmtest: remove unused argument from gem_mmap__cpu

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

 



From: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>

That's just misleading.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
---
 lib/drmtest.c                |  2 +-
 lib/drmtest.h                |  2 +-
 tests/gem_cs_tlb.c           |  3 +--
 tests/gem_evict_everything.c |  3 +--
 tests/gem_fence_thrash.c     |  2 +-
 tests/gem_gtt_speed.c        | 10 +++++-----
 tests/gem_pwrite_pread.c     |  8 ++++----
 7 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index d8fc60f..636ba26 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -557,7 +557,7 @@ void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot)
 	return ptr;
 }
 
-void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot)
+void *gem_mmap__cpu(int fd, uint32_t handle, int size)
 {
 	struct drm_i915_gem_mmap mmap_arg;
 
diff --git a/lib/drmtest.h b/lib/drmtest.h
index a9fd0bc..7f335b5 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -77,7 +77,7 @@ uint32_t gem_create(int fd, int size);
 void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf);
 
 void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot);
-void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
+void *gem_mmap__cpu(int fd, uint32_t handle, int size);
 #define gem_mmap gem_mmap__gtt
 
 uint64_t gem_aperture_size(int fd);
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index 6f1fd5b..b0bbebb 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -113,8 +113,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, BATCH_SIZE,
-					  PROT_READ | PROT_WRITE);
+		batch_ptr = gem_mmap__cpu(fd, handle_new, BATCH_SIZE);
 		batch_ptr[split*2] = MI_BATCH_BUFFER_END;
 
 		for (i = split*2 + 2; i < BATCH_SIZE/8; i++)
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 762aef1..347509c 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -196,8 +196,7 @@ static void forked_evictions(int fd, int size, int count,
 
 			for (l = 0; l < count && (flags & MEMORY_PRESSURE); l++) {
 				uint32_t *base = gem_mmap__cpu(realfd, bo[l],
-							       size,
-							       PROT_READ | PROT_WRITE);
+							       size);
 				memset(base, 0, size);
 				munmap(base, size);
 			}
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index bff73dd..8e16f21 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -68,7 +68,7 @@ bo_create (int fd, int tiling)
 	handle = gem_create(fd, OBJECT_SIZE);
 
 	/* dirty cpu caches a bit ... */
-	ptr = gem_mmap__cpu(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+	ptr = gem_mmap__cpu(fd, handle, OBJECT_SIZE);
 	igt_assert(ptr);
 	memset(ptr, 0, OBJECT_SIZE);
 	munmap(ptr, OBJECT_SIZE);
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 459bdab..6ced4b8 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
 				       I915_GEM_DOMAIN_CPU);
 
 			{
-				uint32_t *base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
+				uint32_t *base = gem_mmap__cpu(fd, handle, size);
 				volatile uint32_t *ptr = base;
 				int x = 0;
 
@@ -103,7 +103,7 @@ int main(int argc, char **argv)
 				/* mmap read */
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
+					base = gem_mmap__cpu(fd, handle, size);
 					ptr = base;
 					x = 0;
 
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
 				/* mmap write */
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
+					base = gem_mmap__cpu(fd, handle, size);
 					ptr = base;
 
 					for (i = 0; i < size/sizeof(*ptr); i++)
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
 
 				gettimeofday(&start, NULL);
 				for (loop = 0; loop < 1000; loop++) {
-					base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
+					base = gem_mmap__cpu(fd, handle, size);
 					memset(base, 0, size);
 					munmap(base, size);
 				}
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
 				       size/1024, elapsed(&start, &end, loop));
 
 				gettimeofday(&start, NULL);
-				base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
+				base = gem_mmap__cpu(fd, handle, size);
 				for (loop = 0; loop < 1000; loop++)
 					memset(base, 0, size);
 				munmap(base, size);
diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c
index 1ae0820..072d323 100644
--- a/tests/gem_pwrite_pread.c
+++ b/tests/gem_pwrite_pread.c
@@ -180,8 +180,8 @@ static void as_cpu_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len,
 
 	gem_write(fd, exec[2].handle, 0, batch, execbuf.batch_len);
 
-	src_ptr = gem_mmap__cpu(fd, src, OBJECT_SIZE, PROT_WRITE);
-	dst_ptr = gem_mmap__cpu(fd, dst, OBJECT_SIZE, PROT_READ);
+	src_ptr = gem_mmap__cpu(fd, src, OBJECT_SIZE);
+	dst_ptr = gem_mmap__cpu(fd, dst, OBJECT_SIZE);
 
 	while (loops--) {
 		gem_set_domain(fd, src,
@@ -309,8 +309,8 @@ static void test_as_cpu_mmap(int fd, uint32_t src, uint32_t dst, int len)
 
 	gem_write(fd, exec[2].handle, 0, batch, execbuf.batch_len);
 
-	src_ptr = gem_mmap__cpu(fd, src, OBJECT_SIZE, PROT_WRITE);
-	dst_ptr = gem_mmap__cpu(fd, dst, OBJECT_SIZE, PROT_READ);
+	src_ptr = gem_mmap__cpu(fd, src, OBJECT_SIZE);
+	dst_ptr = gem_mmap__cpu(fd, dst, OBJECT_SIZE);
 
 	gem_set_domain(fd, src, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
 	for (i = 0; i < len/4; i++)
-- 
1.8.3.1

_______________________________________________
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