summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-08 16:57:18 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-08 21:44:14 +0100
commit5be93cf38b4b1a29fc46dd80a586bcc1eb25e438 (patch)
tree431a60f7064894a13911753d7eeb3eec1de56cd7 /tests
parent90a1115ec8268977304d42a84717baddb52b1b67 (diff)
igt/gem_mmap_gtt: Check that userspace clflushing of the GTT mmap
References: https://bugs.freedesktop.org/show_bug.cgi?id=100971 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_mmap_gtt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 1fb1f015..4ff5e7f1 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -342,6 +342,25 @@ test_coherency(int fd)
}
static void
+test_clflush(int fd)
+{
+ uint32_t handle;
+ uint32_t *gtt;
+
+ igt_require(igt_setup_clflush());
+
+ handle = gem_create(fd, OBJECT_SIZE);
+
+ gtt = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+ set_domain_gtt(fd, handle);
+
+ igt_clflush_range(gtt, OBJECT_SIZE);
+
+ munmap(gtt, OBJECT_SIZE);
+ gem_close(fd, handle);
+}
+
+static void
test_hang(int fd)
{
igt_hang_t hang;
@@ -792,6 +811,8 @@ igt_main
test_write_gtt(fd);
igt_subtest("coherency")
test_coherency(fd);
+ igt_subtest("clflush")
+ test_clflush(fd);
igt_subtest("hang")
test_hang(fd);
igt_subtest("basic-read-write")