All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 11/50] tests/gem_ctx_exec: Adopt to use allocator
Date: Thu, 22 Jul 2021 10:32:01 +0200	[thread overview]
Message-ID: <20210722083240.33453-12-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20210722083240.33453-1-zbigniew.kempczynski@intel.com>

For newer gens we're not able to rely on relocations. Adopt to use
offsets acquired from the allocator.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 tests/i915/gem_ctx_exec.c | 45 +++++++++++++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
index 4d3d1c12f..5691546c9 100644
--- a/tests/i915/gem_ctx_exec.c
+++ b/tests/i915/gem_ctx_exec.c
@@ -178,6 +178,7 @@ static void norecovery(int i915)
 		};
 		int expect = pass == 0 ? -EIO : 0;
 		igt_spin_t *spin;
+		uint64_t ahnd = get_reloc_ahnd(i915, param.ctx_id);
 
 		gem_context_set_param(i915, &param);
 
@@ -185,7 +186,9 @@ static void norecovery(int i915)
 		gem_context_get_param(i915, &param);
 		igt_assert_eq(param.value, pass);
 
-		spin = __igt_spin_new(i915, .ctx = ctx,
+		spin = __igt_spin_new(i915,
+				      .ahnd = ahnd,
+				      .ctx = ctx,
 				      .flags = IGT_SPIN_POLL_RUN);
 		igt_spin_busywait_until_started(spin);
 
@@ -196,6 +199,7 @@ static void norecovery(int i915)
 		igt_spin_free(i915, spin);
 
 		intel_ctx_destroy(i915, ctx);
+		put_ahnd(ahnd);
 	}
 
 	 igt_disallow_hang(i915, hang);
@@ -271,6 +275,7 @@ static void nohangcheck_hostile(int i915)
 	const intel_ctx_t *ctx;
 	int err = 0;
 	int dir;
+	uint64_t ahnd;
 
 	/*
 	 * Even if the user disables hangcheck during their context,
@@ -284,6 +289,7 @@ static void nohangcheck_hostile(int i915)
 
 	ctx = intel_ctx_create_all_physical(i915);
 	hang = igt_allow_hang(i915, ctx->id, 0);
+	ahnd = get_reloc_ahnd(i915, ctx->id);
 
 	igt_require(__enable_hangcheck(dir, false));
 
@@ -295,7 +301,9 @@ static void nohangcheck_hostile(int i915)
 		gem_engine_property_printf(i915, e->name,
 					   "preempt_timeout_ms", "%d", 50);
 
-		spin = __igt_spin_new(i915, .ctx = ctx,
+		spin = __igt_spin_new(i915,
+				      .ahnd = ahnd,
+				      .ctx = ctx,
 				      .engine = e->flags,
 				      .flags = (IGT_SPIN_NO_PREEMPTION |
 						IGT_SPIN_FENCE_OUT));
@@ -333,6 +341,7 @@ static void nohangcheck_hostile(int i915)
 
 	igt_assert_eq(sync_fence_status(fence), -EIO);
 	close(fence);
+	put_ahnd(ahnd);
 
 	close(dir);
 	close(i915);
@@ -345,10 +354,14 @@ static void close_race(int i915)
 	const intel_ctx_t **ctx;
 	uint32_t *ctx_id;
 	igt_spin_t *spin;
+	uint64_t ahnd;
 
 	/* Check we can execute a polling spinner */
 	base_ctx = intel_ctx_create(i915, NULL);
-	igt_spin_free(i915, igt_spin_new(i915, .ctx = base_ctx,
+	ahnd = get_reloc_ahnd(i915, base_ctx->id);
+	igt_spin_free(i915, igt_spin_new(i915,
+					 .ahnd = ahnd,
+					 .ctx = base_ctx,
 					 .flags = IGT_SPIN_POLL_RUN));
 
 	ctx = calloc(ncpus, sizeof(*ctx));
@@ -361,7 +374,10 @@ static void close_race(int i915)
 	}
 
 	igt_fork(child, ncpus) {
-		spin = __igt_spin_new(i915, .ctx = base_ctx,
+		ahnd = get_reloc_ahnd(i915, base_ctx->id);
+		spin = __igt_spin_new(i915,
+				      .ahnd = ahnd,
+				      .ctx = base_ctx,
 				      .flags = IGT_SPIN_POLL_RUN);
 		igt_spin_end(spin);
 		gem_sync(i915, spin->handle);
@@ -403,6 +419,7 @@ static void close_race(int i915)
 		}
 
 		igt_spin_free(i915, spin);
+		put_ahnd(ahnd);
 	}
 
 	igt_until_timeout(5) {
@@ -474,11 +491,22 @@ igt_main
 	igt_subtest("basic-nohangcheck")
 		nohangcheck_hostile(fd);
 
-	igt_subtest("basic-close-race")
-		close_race(fd);
+	igt_subtest_group {
+		igt_fixture {
+			intel_allocator_multiprocess_start();
+		}
+
+		igt_subtest("basic-close-race")
+				close_race(fd);
+
+		igt_fixture {
+			intel_allocator_multiprocess_stop();
+		}
+	}
 
 	igt_subtest("reset-pin-leak") {
 		int i;
+		uint64_t ahnd;
 
 		/*
 		 * Use an explicit context to isolate the test from
@@ -486,6 +514,7 @@ igt_main
 		 * default context (eg. if they would be eliminated).
 		 */
 		ctx_id = gem_context_create(fd);
+		ahnd = get_reloc_ahnd(fd, ctx_id);
 
 		/*
 		 * Iterate enough times that the kernel will
@@ -493,7 +522,8 @@ igt_main
 		 * the last context is leaked at every reset.
 		 */
 		for (i = 0; i < 20; i++) {
-			igt_hang_t hang = igt_hang_ring(fd, 0);
+
+			igt_hang_t hang = igt_hang_ring_with_ahnd(fd, 0, ahnd);
 
 			igt_assert_eq(exec(fd, handle, 0, 0), 0);
 			igt_assert_eq(exec(fd, handle, 0, ctx_id), 0);
@@ -501,5 +531,6 @@ igt_main
 		}
 
 		gem_context_destroy(fd, ctx_id);
+		put_ahnd(ahnd);
 	}
 }
-- 
2.26.0

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

  parent reply	other threads:[~2021-07-22  8:33 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  8:31 [igt-dev] [PATCH i-g-t 00/50] Add allocator support in IGT Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 01/50] lib/igt_dummyload: Add support of using allocator in igt spinner Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 02/50] lib/intel_allocator: Add few helper functions for common use Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 03/50] lib/igt_gt: Add passing ahnd as an argument to igt_hang Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 04/50] lib/intel_batchbuffer: Add allocator support in blitter fast copy Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 05/50] lib/intel_batchbuffer: Add allocator support in blitter src copy Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 06/50] lib/huc_copy: Extend huc copy prototype to pass allocator handle Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 07/50] tests/gem_bad_reloc: Skip on gens where relocations are not supported Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 08/50] tests/gem_busy: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:31 ` [igt-dev] [PATCH i-g-t 09/50] tests/gem_create: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 10/50] tests/gem_ctx_engines: " Zbigniew Kempczyński
2021-07-22  8:32 ` Zbigniew Kempczyński [this message]
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 12/50] tests/gem_ctx_freq: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 13/50] tests/gem_ctx_isolation: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 14/50] tests/gem_ctx_param: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 15/50] tests/gem_eio: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 16/50] tests/gem_exec_async: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 17/50] tests/gem_exec_big: Require relocation support Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 18/50] tests/gem_exec_capture: Support gens without relocations Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 19/50] tests/gem_exec_gttfill: Require relocation support Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 20/50] tests/gem_exec_store: Support gens without relocations Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 21/50] tests/gem_exec_suspend: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 22/50] tests/gem_exec_parallel: Adopt to use alloctor Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 23/50] tests/gem_exec_params: Support gens without relocations Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 24/50] tests/gem_mmap: Add allocator support Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 25/50] tests/gem_mmap_gtt: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 26/50] tests/gem_mmap_offset: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 27/50] tests/gem_mmap_wc: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 28/50] tests/gem_request_retire: Add allocator support Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 29/50] tests/gem_ringfill: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 30/50] tests/gem_softpin: Exercise eviction with softpinning Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 31/50] tests/gem_spin_batch: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 32/50] tests/gem_tiled_fence_blits: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 33/50] tests/gem_unfence_active_buffers: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 34/50] tests/gem_unref_active_buffers: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 35/50] tests/gem_wait: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 36/50] tests/gem_watchdog: Adopt to use no-reloc Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 37/50] tests/gem_workarounds: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 38/50] tests/i915_hangman: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 39/50] tests/i915_module_load: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 40/50] tests/i915_pm_rc6_residency: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 41/50] tests/i915_pm_rpm: Adopt to use no-reloc Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 42/50] tests/i915_pm_rps: Alter " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 43/50] tests/kms_busy: Adopt to use allocator Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 44/50] tests/kms_cursor_legacy: " Zbigniew Kempczyński
2021-07-23 14:26   ` Rodrigo Siqueira
2021-07-30  4:04     ` Zbigniew Kempczyński
2021-08-03 15:05       ` Rodrigo Siqueira
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 45/50] tests/kms_flip: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 46/50] tests/kms_vblank: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 47/50] tests/perf_pmu: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 48/50] tests/sysfs_heartbeat_interval: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 49/50] tests/sysfs_preempt_timeout: " Zbigniew Kempczyński
2021-07-22  8:32 ` [igt-dev] [PATCH i-g-t 50/50] tests/sysfs_timeslice_duration: " Zbigniew Kempczyński
2021-07-22  9:50 ` [igt-dev] ✗ Fi.CI.BAT: failure for Add allocator support in IGT Patchwork
2021-07-26 17:37 ` [igt-dev] [PATCH i-g-t 00/50] " Rodrigo Siqueira
2021-07-30  4:07   ` Zbigniew Kempczyński
2021-08-03 15:09     ` Rodrigo Siqueira

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=20210722083240.33453-12-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.