diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-07 15:50:41 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-08 12:06:09 +0000 |
commit | 6c7572912320386c49ff1674b5202caf371f5dea (patch) | |
tree | 003ba89cecd0079cd59cfab8e87d48829f943cc4 | |
parent | b1015a3267bbccb985b2fa7e3accb778c7bff0ed (diff) |
i915/query: Cross-check engine list against execbuf interface
Check that every engine listed can be used in execbuf.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
-rw-r--r-- | tests/i915/i915_query.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/i915/i915_query.c b/tests/i915/i915_query.c index e7c6fc91..07d78374 100644 --- a/tests/i915/i915_query.c +++ b/tests/i915/i915_query.c @@ -678,10 +678,24 @@ static void engines(int fd) igt_assert_eq(engines->rsvd[1], 0); igt_assert_eq(engines->rsvd[2], 0); - /* Check results match the legacy GET_PARAM (where we can). */ + /* Confirm the individual engines exist with EXECBUFFER2 */ for (i = 0; i < engines->num_engines; i++) { struct drm_i915_engine_info *engine = (struct drm_i915_engine_info *)&engines->engines[i]; + I915_DEFINE_CONTEXT_PARAM_ENGINES(p_engines, 1) = { + .engines = { engine->engine } + }; + struct drm_i915_gem_context_param param = { + .param = I915_CONTEXT_PARAM_ENGINES, + .value = to_user_pointer(&p_engines), + .size = sizeof(p_engines), + }; + + struct drm_i915_gem_exec_object2 obj = {}; + struct drm_i915_gem_execbuffer2 execbuf = { + .buffers_ptr = to_user_pointer(&obj), + .buffer_count = 1, + }; igt_debug("%u: class=%u instance=%u flags=%llx capabilities=%llx\n", i, @@ -689,6 +703,17 @@ static void engines(int fd) engine->engine.engine_instance, engine->flags, engine->capabilities); + gem_context_set_param(fd, ¶m); + igt_assert_eq(__gem_execbuf(fd, &execbuf), -ENOENT); + + param.size = 0; /* reset context engine map to defaults */ + gem_context_set_param(fd, ¶m); + } + + /* Check results match the legacy GET_PARAM (where we can). */ + for (i = 0; i < engines->num_engines; i++) { + struct drm_i915_engine_info *engine = + (struct drm_i915_engine_info *)&engines->engines[i]; switch (engine->engine.engine_class) { case I915_ENGINE_CLASS_RENDER: |