summaryrefslogtreecommitdiff
path: root/tests/gem_ctx_create.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-04-22 10:58:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-04-22 10:59:44 +0100
commitac5431c9a4455173c639e77f07eed6cf78cfdc2e (patch)
tree183e7720373567cad8a4f8b6668fa2dee695e700 /tests/gem_ctx_create.c
parentba075fd67df40e6ddb8287d3f67fcc1bb75d2032 (diff)
igt/gem_ctx_create: Exercise all engines + context creation
Minor addition to testing each engine individual, test them all at once with a new context. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_ctx_create.c')
-rw-r--r--tests/gem_ctx_create.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index aa4534ea..ae0825a1 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -107,9 +107,18 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
const uint32_t bbe = MI_BATCH_BUFFER_END;
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 obj;
+ unsigned int nengine, engines[16];
unsigned *shared;
- gem_require_ring(fd, engine);
+ if (engine == -1) {
+ igt_require(all_nengine);
+ nengine = all_nengine;
+ memcpy(engines, all_engines, sizeof(engines[0])*nengine);
+ } else {
+ gem_require_ring(fd, engine);
+ nengine = 1;
+ engines[0] = engine;
+ }
shared = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
igt_assert(shared != MAP_FAILED);
@@ -121,7 +130,6 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = to_user_pointer(&obj);
execbuf.buffer_count = 1;
- execbuf.flags = engine;
if (ncpus < 0) {
igt_fork(child, ppgtt_nengine) {
@@ -154,7 +162,10 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
do {
do {
execbuf.rsvd1 = gem_context_create(fd);
- gem_execbuf(fd, &execbuf);
+ for (unsigned n = 0; n < nengine; n++) {
+ execbuf.flags = engines[n];
+ gem_execbuf(fd, &execbuf);
+ }
gem_context_destroy(fd, execbuf.rsvd1);
} while (++count & 1023);
clock_gettime(CLOCK_MONOTONIC, &end);
@@ -360,6 +371,11 @@ igt_main
igt_subtest("forked-files")
files(fd, 150, ncpus);
+ igt_subtest("active-all")
+ active(fd, -1, 120, 1);
+ igt_subtest("forked-active-all")
+ active(fd, -1, 120, ncpus);
+
for (const struct intel_execution_engine *e = intel_execution_engines;
e->name; e++) {
igt_subtest_f("active-%s", e->name)