public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bommu Krishnaiah <krishnaiah.bommu@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t 1/1] tests/i915/gem_ctx_persistence: Set context with supported engines
Date: Thu,  9 Jan 2020 14:20:23 +0530	[thread overview]
Message-ID: <20200109085023.25551-2-krishnaiah.bommu@intel.com> (raw)
In-Reply-To: <20200109085023.25551-1-krishnaiah.bommu@intel.com>

Update the context with supported engines on the platform with set_property
I915_CONTEXT_PARAM_ENGINES to make sure the work load is submitted to
the available engines only.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
---
 tests/i915/gem_ctx_persistence.c | 34 ++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c
index d68431ae..e410e85f 100644
--- a/tests/i915/gem_ctx_persistence.c
+++ b/tests/i915/gem_ctx_persistence.c
@@ -145,6 +145,15 @@ static void test_clone(int i915)
 	gem_context_destroy(i915, clone);
 }
 
+static uint32_t create_context(int i915, bool persistent)
+{
+	uint32_t ctx;
+
+	ctx = gem_context_create(i915);
+	gem_context_set_persistence(i915, ctx, persistent);
+	gem_context_set_all_engines(i915, ctx);
+	return ctx;
+}
 static void test_persistence(int i915, unsigned int engine)
 {
 	igt_spin_t *spin;
@@ -156,8 +165,7 @@ static void test_persistence(int i915, unsigned int engine)
 	 * request is retired -- no early termination.
 	 */
 
-	ctx = gem_context_create(i915);
-	gem_context_set_persistence(i915, ctx, true);
+	ctx = create_context(i915, true);
 
 	spin = igt_spin_new(i915, ctx,
 			    .engine = engine,
@@ -188,8 +196,7 @@ static void test_nonpersistent_cleanup(int i915, unsigned int engine)
 	 * any inflight request is cancelled.
 	 */
 
-	ctx = gem_context_create(i915);
-	gem_context_set_persistence(i915, ctx, false);
+	ctx = create_context(i915, false);
 
 	spin = igt_spin_new(i915, ctx,
 			    .engine = engine,
@@ -217,8 +224,7 @@ static void test_nonpersistent_mixed(int i915, unsigned int engine)
 		igt_spin_t *spin;
 		uint32_t ctx;
 
-		ctx = gem_context_create(i915);
-		gem_context_set_persistence(i915, ctx, i & 1);
+		ctx = create_context(i915, i & 1);
 
 		spin = igt_spin_new(i915, ctx,
 				    .engine = engine,
@@ -253,8 +259,7 @@ static void test_nonpersistent_hostile(int i915, unsigned int engine)
 	 * the requests and cleanup the context.
 	 */
 
-	ctx = gem_context_create(i915);
-	gem_context_set_persistence(i915, ctx, false);
+	ctx = create_context(i915, false);
 
 	spin = igt_spin_new(i915, ctx,
 			    .engine = engine,
@@ -284,8 +289,8 @@ static void test_nonpersistent_hostile_preempt(int i915, unsigned int engine)
 
 	igt_require(gem_scheduler_has_preemption(i915));
 
-	ctx = gem_context_create(i915);
-	gem_context_set_persistence(i915, ctx, true);
+	ctx = create_context(i915, true);
+
 	gem_context_set_priority(i915, ctx, 0);
 	spin[0] = igt_spin_new(i915, ctx,
 			       .engine = engine,
@@ -385,8 +390,8 @@ static void test_nonpersistent_queued(int i915, unsigned int engine)
 
 	gem_quiescent_gpu(i915);
 
-	ctx = gem_context_create(i915);
-	gem_context_set_persistence(i915, ctx, false);
+	ctx = create_context(i915, false);
+
 	spin = igt_spin_new(i915, ctx,
 			    .engine = engine,
 			    .flags = IGT_SPIN_FENCE_OUT);
@@ -512,8 +517,7 @@ static void test_process_mixed(int i915, unsigned int engine)
 			igt_spin_t *spin;
 			uint32_t ctx;
 
-			ctx = gem_context_create(i915);
-			gem_context_set_persistence(i915, ctx, persists);
+			ctx = create_context(i915, persists);
 
 			spin = igt_spin_new(i915, ctx,
 					    .engine = engine,
@@ -727,7 +731,7 @@ igt_main
 	igt_subtest("hangcheck")
 		test_nohangcheck_hostile(i915);
 
-	__for_each_static_engine(e) {
+	__for_each_physical_engine(i915, e) {
 		igt_subtest_group {
 			igt_fixture {
 				gem_require_ring(i915, e->flags);
-- 
2.24.0

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

  reply	other threads:[~2020-01-09  9:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  8:50 [igt-dev] [PATCH i-g-t 0/1] tests/i915/gem_ctx_persistence: Set context with supported engines Bommu Krishnaiah
2020-01-09  8:50 ` Bommu Krishnaiah [this message]
2020-01-09  9:18   ` [igt-dev] [PATCH i-g-t 1/1] " Chris Wilson
2020-01-10 10:56     ` Tvrtko Ursulin
2020-01-10 11:03       ` Chris Wilson
2020-01-10 11:14         ` Tvrtko Ursulin
2020-01-09 10:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-09 20:37 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200109085023.25551-2-krishnaiah.bommu@intel.com \
    --to=krishnaiah.bommu@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox