summaryrefslogtreecommitdiff
path: root/tests/gem_exec_flush.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-02 08:57:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-02 09:21:50 +0100
commit16c9edb464bdf076ab9ae4219c02106d326855d4 (patch)
treed6429bfcdee4a9d36175c41cb4268d01d5b76466 /tests/gem_exec_flush.c
parentf3532cab978ec715cce8eeb8c4e355dbcf53a374 (diff)
igt/gem_exec_flush: Add basic set-domain checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_flush.c')
-rw-r--r--tests/gem_exec_flush.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index 87d280fb..a7aa819f 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -30,7 +30,8 @@ IGT_TEST_DESCRIPTION("Basic check of flushing after batches");
#define UNCACHED 0
#define COHERENT 1
#define WRITE 2
-#define KERNEL 2
+#define KERNEL 4
+#define SET_DOMAIN 8
static void run(int fd, unsigned ring, int nchild, int timeout,
unsigned flags)
@@ -159,7 +160,19 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
gem_execbuf(fd, &execbuf);
- if (flags & KERNEL) {
+ if (flags & SET_DOMAIN) {
+ gem_set_domain(fd, obj[0].handle,
+ I915_GEM_DOMAIN_GTT,
+ flags & WRITE ? I915_GEM_DOMAIN_GTT : 0);
+
+ if (xor)
+ igt_assert_eq_u32(map[i], i ^ 0xffffffff);
+ else
+ igt_assert_eq_u32(map[i], i);
+
+ if (flags & WRITE)
+ map[i] = 0xdeadbeef;
+ } else if (flags & KERNEL) {
uint32_t val;
gem_read(fd, obj[0].handle, i*sizeof(uint32_t),
@@ -216,6 +229,7 @@ igt_main
{ "rw", WRITE },
{ "pro", KERNEL },
{ "prw", KERNEL | WRITE },
+ { "set", SET_DOMAIN | WRITE },
{ NULL },
};
int gen = -1;