[Intel-gfx] [PATCH i-g-t 3/7] tests/gem_mmap_gtt: Add progress indicators

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Mon Dec 14 12:15:52 PST 2015


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Some of the copy tests take a while, so let the user know how
far along we are via a progress indicator.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/gem_mmap_gtt.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index b9c413b6160b..3a64a6fdc342 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -376,8 +376,10 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 	igt_require(a);
 	gem_close(fd, bo);
 
-	for (i = 0; i < huge_object_size / PAGE_SIZE; i++)
+	for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
 		memcpy(a + PAGE_SIZE*i, pattern_a, PAGE_SIZE);
+		igt_progress("Writing a ", i, huge_object_size / PAGE_SIZE);
+	}
 
 	bo = gem_create(fd, huge_object_size);
 	if (tiling_b)
@@ -386,14 +388,17 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 	igt_require(b);
 	gem_close(fd, bo);
 
-	for (i = 0; i < huge_object_size / PAGE_SIZE; i++)
+	for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
 		memcpy(b + PAGE_SIZE*i, pattern_b, PAGE_SIZE);
+		igt_progress("Writing b ", i, huge_object_size / PAGE_SIZE);
+	}
 
 	for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
 		if (i & 1)
 			memcpy(a + i *PAGE_SIZE, b + i*PAGE_SIZE, PAGE_SIZE);
 		else
 			memcpy(b + i *PAGE_SIZE, a + i*PAGE_SIZE, PAGE_SIZE);
+		igt_progress("Copying a<->b ", i, huge_object_size / PAGE_SIZE);
 	}
 
 	for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
@@ -401,6 +406,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 			igt_assert(memcmp(pattern_b, a + PAGE_SIZE*i, PAGE_SIZE) == 0);
 		else
 			igt_assert(memcmp(pattern_a, a + PAGE_SIZE*i, PAGE_SIZE) == 0);
+		igt_progress("Checking a ", i, huge_object_size / PAGE_SIZE);
 	}
 	munmap(a, huge_object_size);
 
@@ -409,6 +415,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 			igt_assert(memcmp(pattern_b, b + PAGE_SIZE*i, PAGE_SIZE) == 0);
 		else
 			igt_assert(memcmp(pattern_a, b + PAGE_SIZE*i, PAGE_SIZE) == 0);
+		igt_progress("Checking b ", i, huge_object_size / PAGE_SIZE);
 	}
 	munmap(b, huge_object_size);
 
-- 
2.4.10



More information about the Intel-gfx mailing list