Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED88A6E05F for ; Tue, 10 Aug 2021 10:54:14 +0000 (UTC) From: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= Date: Tue, 10 Aug 2021 12:53:08 +0200 Message-Id: <20210810105323.31375-40-zbigniew.kempczynski@intel.com> In-Reply-To: <20210810105323.31375-1-zbigniew.kempczynski@intel.com> References: <20210810105323.31375-1-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v7 39/54] tests/gem_watchdog: Adopt to use no-reloc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: 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 Cc: Petri Latvala Cc: Ashutosh Dixit Reviewed-by: Ashutosh Dixit --- tests/i915/gem_watchdog.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c index 4d4aaee48..db562335a 100644 --- a/tests/i915/gem_watchdog.c +++ b/tests/i915/gem_watchdog.c @@ -111,10 +111,13 @@ static void physical(int i915, const intel_ctx_t *ctx) unsigned int num_engines, i, count; const struct intel_execution_engine2 *e; igt_spin_t *spin[GEM_MAX_ENGINES]; + uint64_t ahnd = get_reloc_ahnd(i915, ctx->id); i = 0; for_each_ctx_engine(i915, ctx, e) { - spin[i] = igt_spin_new(i915, .ctx = ctx, + spin[i] = igt_spin_new(i915, + .ahnd = ahnd, + .ctx = ctx, .engine = e->flags, .flags = spin_flags()); i++; @@ -125,6 +128,7 @@ static void physical(int i915, const intel_ctx_t *ctx) for (i = 0; i < num_engines; i++) igt_spin_free(i915, spin[i]); + put_ahnd(ahnd); igt_assert_eq(count, num_engines); } @@ -216,6 +220,7 @@ static void virtual(int i915, const intel_ctx_cfg_t *base_cfg) unsigned int expect = num_engines; intel_ctx_cfg_t cfg = {}; const intel_ctx_t *ctx[num_engines]; + uint64_t ahnd; igt_require(gem_has_execlists(i915)); @@ -239,10 +244,12 @@ static void virtual(int i915, const intel_ctx_cfg_t *base_cfg) igt_assert(i < num_engines); ctx[i] = intel_ctx_create(i915, &cfg); + ahnd = get_reloc_ahnd(i915, ctx[i]->id); set_load_balancer(i915, ctx[i]->id, ci, count, NULL); spin[i] = igt_spin_new(i915, + .ahnd = ahnd, .ctx = ctx[i], .flags = spin_flags()); i++; @@ -254,8 +261,10 @@ static void virtual(int i915, const intel_ctx_cfg_t *base_cfg) count = wait_timeout(i915, spin, num_engines, wait_us, expect); for (i = 0; i < num_engines && spin[i]; i++) { + ahnd = spin[i]->ahnd; igt_spin_free(i915, spin[i]); intel_ctx_destroy(i915, ctx[i]); + put_ahnd(ahnd); } igt_assert_eq(count, expect); -- 2.26.0