summaryrefslogtreecommitdiff
path: root/tests/gem_streaming_writes.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-05-19 14:51:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-05-19 15:35:48 +0100
commit65fec5e5836cb347e99d22320ec3ff776ddf2a1f (patch)
tree4ac22d4bc7eb0fdba51d10393fc006cdc691f84f /tests/gem_streaming_writes.c
parentc0a0725fad11bb7911420cf9b49f8a2ccdf35071 (diff)
igt/gem_streaming_writes: Add more validation steps
Inalcude a pre-pass to check that the non-streaming, partial writes work. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_streaming_writes.c')
-rw-r--r--tests/gem_streaming_writes.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c
index d1a1b42f..63a32dc0 100644
--- a/tests/gem_streaming_writes.c
+++ b/tests/gem_streaming_writes.c
@@ -60,7 +60,7 @@ static bool __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *eb)
return drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, eb) == 0;
}
-static void test_streaming(int fd, int mode)
+static void test_streaming(int fd, int mode, int sync)
{
const int has_64bit_reloc = intel_gen(intel_get_drm_devid(fd)) >= 8;
struct drm_i915_gem_execbuffer2 execbuf;
@@ -192,6 +192,8 @@ static void test_streaming(int fd, int mode)
int b;
if (pass) {
+ if (sync)
+ gem_set_domain(fd, src, domain, domain);
for (i = 0; i < CHUNK_SIZE/4; i++)
s[offset/4 + i] = (OBJECT_SIZE*pass + offset)/4 + i;
}
@@ -227,17 +229,19 @@ static void test_streaming(int fd, int mode)
igt_main
{
- int fd;
+ int fd, sync;
igt_fixture
fd = drm_open_any();
- igt_subtest("cpu")
- test_streaming(fd, 0);
- igt_subtest("gtt")
- test_streaming(fd, 1);
- igt_subtest("wc")
- test_streaming(fd, 2);
+ for (sync = 2; sync--; ) {
+ igt_subtest_f("cpu%s", sync ? "-sync":"")
+ test_streaming(fd, 0, sync);
+ igt_subtest_f("gtt%s", sync ? "-sync":"")
+ test_streaming(fd, 1, sync);
+ igt_subtest_f("wc%s", sync ? "-sync":"")
+ test_streaming(fd, 2, sync);
+ }
igt_fixture
close(fd);