Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] i915/query: Cross-check engine list against execbuf interface
@ 2020-12-07 16:11 Chris Wilson
  2020-12-07 16:11 ` [igt-dev] [PATCH i-g-t 2/2] i915/query: Directly check query results against GETPARAM Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Chris Wilson @ 2020-12-07 16:11 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin, Chris Wilson

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>
---
 tests/i915/i915_query.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/tests/i915/i915_query.c b/tests/i915/i915_query.c
index e7c6fc91e..cdf2d3403 100644
--- a/tests/i915/i915_query.c
+++ b/tests/i915/i915_query.c
@@ -633,6 +633,16 @@ has_engine(struct drm_i915_query_engine_info *engines,
 	return false;
 }
 
+static void gem_context_reset_engines(int i915, uint32_t ctx)
+{
+	struct drm_i915_gem_context_param param = {
+		.ctx_id = ctx,
+		.param = I915_CONTEXT_PARAM_ENGINES,
+	};
+
+	gem_context_set_param(i915, &param);
+}
+
 static void engines(int fd)
 {
 	struct drm_i915_query_engine_info *engines;
@@ -678,10 +688,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 +713,15 @@ static void engines(int fd)
 			  engine->engine.engine_instance,
 			  engine->flags,
 			  engine->capabilities);
+		gem_context_set_param(fd, &param);
+		igt_assert_eq(__gem_execbuf(fd, &execbuf), -ENOENT);
+	}
+	gem_context_reset_engines(fd, 0);
+
+	/* 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:
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-12-09  5:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07 16:11 [igt-dev] [PATCH i-g-t 1/2] i915/query: Cross-check engine list against execbuf interface Chris Wilson
2020-12-07 16:11 ` [igt-dev] [PATCH i-g-t 2/2] i915/query: Directly check query results against GETPARAM Chris Wilson
2020-12-08 11:04   ` Petri Latvala
2020-12-08 11:18     ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2020-12-08 11:31       ` Chris Wilson
2020-12-07 17:40 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] i915/query: Cross-check engine list against execbuf interface Patchwork
2020-12-07 19:47 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-12-08 11:01   ` Petri Latvala
2020-12-08 11:56 ` [Intel-gfx] [PATCH i-g-t 1/2] " Andi Shyti
2020-12-09  5:51 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox