summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-05-12 10:02:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-05-12 10:04:46 +0100
commitf5dd258cc7276be30d699d68f7c6952b04067529 (patch)
tree1f719b79cb2bcfaad53d0632ea08a5baf2b966a8 /tests
parenta5a010c82d07db6c0397ba7e5f50c00683a5c5f3 (diff)
igt/gem_streaming_writes: Build in a self-test
Use the first pass to write all values prior to the initial execbuf to verify that the copy itself is true. Subsequent passes then focus on verifying that writing values whilst the GPU is reading from neighbouring values is then correct. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_streaming_writes.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c
index da13dab3..d42a184a 100644
--- a/tests/gem_streaming_writes.c
+++ b/tests/gem_streaming_writes.c
@@ -171,12 +171,19 @@ static void test_streaming(int fd, int mode)
int domain = mode ? I915_GEM_DOMAIN_GTT : I915_GEM_DOMAIN_CPU;
gem_set_domain(fd, src, domain, domain);
+ if (pass == 0) {
+ for (i = 0; i < OBJECT_SIZE/4; i++)
+ s[i] = i;
+ }
+
/* Now copy from the src to the dst in 32byte chunks */
for (offset = 0; offset < OBJECT_SIZE; offset += CHUNK_SIZE) {
int b;
- for (i = 0; i < CHUNK_SIZE/4; i++)
- s[offset/4 + i] = (OBJECT_SIZE*pass + offset)/4 + i;
+ if (pass) {
+ for (i = 0; i < CHUNK_SIZE/4; i++)
+ s[offset/4 + i] = (OBJECT_SIZE*pass + offset)/4 + i;
+ }
b = offset / CHUNK_SIZE / 64;
n = offset / CHUNK_SIZE % 64;