Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/3] tests/i915/gem_exec_schedule: Use separate context for spinner
Date: Thu, 21 Apr 2022 08:09:55 +0200	[thread overview]
Message-ID: <20220421060955.21016-4-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20220421060955.21016-1-zbigniew.kempczynski@intel.com>

Iterating over all physical engines on default context is wrong and
it may end with failure when there're more engines than default context
contains. To handle this we should create separate context on top of
all-physical-engines config.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/5444 (semaphore-resolved).
---
 tests/i915/gem_exec_schedule.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index dfcff849c8..cf2625cbf5 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -1065,7 +1065,7 @@ static void semaphore_resolve(int i915, const intel_ctx_cfg_t *cfg,
 	const struct intel_execution_engine2 *e;
 	const uint32_t SEMAPHORE_ADDR = 64 << 10;
 	uint32_t semaphore, *sema;
-	const intel_ctx_t *outer, *inner;
+	const intel_ctx_t *spin_ctx, *outer, *inner;
 	uint64_t ahnd = get_reloc_ahnd(i915, 0);
 
 	/*
@@ -1080,6 +1080,7 @@ static void semaphore_resolve(int i915, const intel_ctx_cfg_t *cfg,
 	igt_require(gem_scheduler_has_preemption(i915));
 	igt_require(intel_get_drm_devid(i915) >= 8); /* for MI_SEMAPHORE_WAIT */
 
+	spin_ctx = intel_ctx_create(i915, cfg);
 	outer = intel_ctx_create(i915, cfg);
 	inner = intel_ctx_create(i915, cfg);
 
@@ -1097,7 +1098,7 @@ static void semaphore_resolve(int i915, const intel_ctx_cfg_t *cfg,
 		if (!gem_class_can_store_dword(i915, e->class))
 			continue;
 
-		spin = __igt_spin_new(i915, .ahnd = ahnd,
+		spin = __igt_spin_new(i915, .ahnd = ahnd, .ctx = spin_ctx,
 				      .engine = e->flags, .flags = flags);
 		igt_spin_end(spin); /* we just want its address for later */
 		gem_sync(i915, spin->handle);
@@ -1190,6 +1191,7 @@ static void semaphore_resolve(int i915, const intel_ctx_cfg_t *cfg,
 
 	intel_ctx_destroy(i915, inner);
 	intel_ctx_destroy(i915, outer);
+	intel_ctx_destroy(i915, spin_ctx);
 	put_ahnd(ahnd);
 }
 
-- 
2.32.0

  parent reply	other threads:[~2022-04-21  6:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  6:09 [igt-dev] [PATCH i-g-t 0/3] Fix couple of gem_exec_schedule subtests Zbigniew Kempczyński
2022-04-21  6:09 ` [igt-dev] [PATCH i-g-t 1/3] i915/gem_exec_schedule: Fix context creation for shared-vm Zbigniew Kempczyński
2022-04-21 19:46   ` Kamil Konieczny
2022-04-21  6:09 ` [igt-dev] [PATCH i-g-t 2/3] tests/i915/gem_exec_schedule: Don't use default context Zbigniew Kempczyński
2022-04-21 19:51   ` Kamil Konieczny
2022-04-22  6:12     ` Zbigniew Kempczyński
2022-04-22 10:27       ` Kamil Konieczny
2022-04-21  6:09 ` Zbigniew Kempczyński [this message]
2022-04-21 20:00   ` [igt-dev] [PATCH i-g-t 3/3] tests/i915/gem_exec_schedule: Use separate context for spinner Kamil Konieczny
2022-04-21  6:33 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix couple of gem_exec_schedule subtests Patchwork
2022-04-21  7:01 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2022-04-21  9:03 ` [igt-dev] ✓ Fi.CI.BAT: success for Fix couple of gem_exec_schedule subtests (rev2) Patchwork
2022-04-21 11:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-04-21 11:13   ` Zbigniew Kempczyński
2022-04-22 10:29   ` Zbigniew Kempczyński
2022-04-25 15:15     ` Vudum, Lakshminarayana
2022-04-25 15:37 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20220421060955.21016-4-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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