Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73F72898C7 for ; Mon, 9 Aug 2021 09:33:16 +0000 (UTC) Date: Mon, 9 Aug 2021 11:33:10 +0200 From: Zbigniew =?utf-8?Q?Kempczy=C5=84ski?= Message-ID: <20210809093310.GE17331@zkempczy-mobl2> References: <20210806134145.24634-1-zbigniew.kempczynski@intel.com> <20210806134145.24634-34-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210806134145.24634-34-zbigniew.kempczynski@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t v4 33/56] tests/gem_request_retire: Add allocator support 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 Cc: Ch Sai Gowtham , Petri Latvala , Ashutosh Dixit List-ID: On Fri, Aug 06, 2021 at 03:41:22PM +0200, Zbigniew Kempczyński wrote: > From: Ch Sai Gowtham > > When relocations are not available tests must assign addresses to objects > by themselves instead of relying on the driver. We use allocator for > that purpose. > > Signed-off-by: Ch Sai Gowtham > Cc: Zbigniew Kempczyński > Cc: Petri Latvala > Cc: Ashutosh Dixit > --- > tests/i915/gem_request_retire.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/tests/i915/gem_request_retire.c b/tests/i915/gem_request_retire.c > index 3df54f2a5..da9d405ed 100644 > --- a/tests/i915/gem_request_retire.c > +++ b/tests/i915/gem_request_retire.c > @@ -63,21 +63,29 @@ test_retire_vma_not_inactive(int fd) > { > struct intel_execution_engine2 *e; > const intel_ctx_t *ctx; > + uint64_t ahnd, ahndN; > igt_spin_t *bg = NULL; > > ctx = intel_ctx_create_all_physical(fd); > + ahnd = get_reloc_ahnd(fd, ctx->id); > > for_each_ctx_engine(fd, ctx, e) { > igt_spin_t *spin; > const intel_ctx_t *spin_ctx; > > if (!bg) { > - bg = igt_spin_new(fd, .ctx = ctx, .engine = e->flags); > + bg = igt_spin_new(fd, > + .ahnd = ahnd, > + .ctx = ctx, > + .engine = e->flags); > continue; > } > > spin_ctx = intel_ctx_create(fd, &ctx->cfg); > - spin = igt_spin_new(fd, .ctx = spin_ctx, > + ahndN = get_reloc_ahnd(fd, spin_ctx->id); > + spin = igt_spin_new(fd, > + .ahnd = ahndN, > + .ctx = spin_ctx, > .engine = e->flags, > .dependency = bg->handle, > .flags = IGT_SPIN_SOFTDEP); Ok, we're running this on separate contexts so .dependency can have different vma. Reviewed-by: Zbigniew Kempczyński -- Zbigniew > @@ -86,11 +94,13 @@ test_retire_vma_not_inactive(int fd) > > gem_sync(fd, spin->handle); > igt_spin_free(fd, spin); > + put_ahnd(ahndN); > } > > igt_drop_caches_set(fd, DROP_RETIRE); > igt_spin_free(fd, bg); > intel_ctx_destroy(fd, ctx); > + put_ahnd(ahnd); > } > > int fd; > -- > 2.26.0 >