summaryrefslogtreecommitdiff
path: root/tests/gem_partial_pwrite_pread.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-06 15:09:50 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-06 16:58:59 +0100
commita661c098b0156a7cba4f29af0d6f223ca72560ba (patch)
tree5cfbae24b27e1a471de0e39aa0a2be24d22d0c4b /tests/gem_partial_pwrite_pread.c
parent24eade08ab49bc2e1e16260472c34365e1e26d50 (diff)
gem_partial_pwrite_pread: Exercise different cacheing of the staging bo
Diffstat (limited to 'tests/gem_partial_pwrite_pread.c')
-rw-r--r--tests/gem_partial_pwrite_pread.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index 2ca0ece0..eac27604 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -253,6 +253,26 @@ static void test_partial_read_writes(void)
}
}
+static void do_tests(int cache_level, const char *suffix)
+{
+ char name[80];
+
+ if (cache_level != -1)
+ gem_set_cacheing(fd, scratch_bo->handle, cache_level);
+
+ snprintf(name, sizeof(name), "reads%s", suffix);
+ if (drmtest_run_subtest(name))
+ test_partial_reads();
+
+ snprintf(name, sizeof(name), "writes%s", suffix);
+ if (drmtest_run_subtest(name))
+ test_partial_writes();
+
+ snprintf(name, sizeof(name), "writes-after-reads%s", suffix);
+ if (drmtest_run_subtest(name))
+ test_partial_read_writes();
+}
+
int main(int argc, char **argv)
{
srandom(0xdeadbeef);
@@ -274,14 +294,11 @@ int main(int argc, char **argv)
drmtest_init_aperture_trashers(bufmgr);
mappable_gtt_limit = gem_mappable_aperture_size();
- if (drmtest_run_subtest("reads"))
- test_partial_reads();
+ do_tests(-1, "");
- if (drmtest_run_subtest("writes"))
- test_partial_writes();
-
- if (drmtest_run_subtest("writes-after-reads"))
- test_partial_read_writes();
+ /* Repeat the tests using different levels of snooping */
+ do_tests(0, "-uncached");
+ do_tests(1, "-snoop");
drmtest_cleanup_aperture_trashers();
drm_intel_bufmgr_destroy(bufmgr);