mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
tests/gem_mmap_gtt: Add progress indicators
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@linux.intel.com>
This commit is contained in:
parent
86382de3fb
commit
21022f076d
@ -453,8 +453,10 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
|
|||||||
igt_require(a);
|
igt_require(a);
|
||||||
gem_close(fd, bo);
|
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);
|
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);
|
bo = gem_create(fd, huge_object_size);
|
||||||
if (tiling_b)
|
if (tiling_b)
|
||||||
@ -463,14 +465,17 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
|
|||||||
igt_require(b);
|
igt_require(b);
|
||||||
gem_close(fd, bo);
|
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);
|
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++) {
|
for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
|
||||||
if (i & 1)
|
if (i & 1)
|
||||||
memcpy(a + i *PAGE_SIZE, b + i*PAGE_SIZE, PAGE_SIZE);
|
memcpy(a + i *PAGE_SIZE, b + i*PAGE_SIZE, PAGE_SIZE);
|
||||||
else
|
else
|
||||||
memcpy(b + i *PAGE_SIZE, a + i*PAGE_SIZE, PAGE_SIZE);
|
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++) {
|
for (i = 0; i < huge_object_size / PAGE_SIZE; i++) {
|
||||||
@ -478,6 +483,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);
|
igt_assert(memcmp(pattern_b, a + PAGE_SIZE*i, PAGE_SIZE) == 0);
|
||||||
else
|
else
|
||||||
igt_assert(memcmp(pattern_a, a + PAGE_SIZE*i, PAGE_SIZE) == 0);
|
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);
|
munmap(a, huge_object_size);
|
||||||
|
|
||||||
@ -486,6 +492,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);
|
igt_assert(memcmp(pattern_b, b + PAGE_SIZE*i, PAGE_SIZE) == 0);
|
||||||
else
|
else
|
||||||
igt_assert(memcmp(pattern_a, b + PAGE_SIZE*i, PAGE_SIZE) == 0);
|
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);
|
munmap(b, huge_object_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user