From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B77C8B615 for ; Tue, 26 Jul 2022 14:28:53 +0000 (UTC) Date: Tue, 26 Jul 2022 16:28:49 +0200 From: Kamil Konieczny To: igt-dev@lists.freedesktop.org Message-ID: References: <8e33260c9fdfbc3d4508d71903063ebb1a2dcc6c.1658826356.git.karolina.drobnik@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8e33260c9fdfbc3d4508d71903063ebb1a2dcc6c.1658826356.git.karolina.drobnik@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t v2 2/2] tests/gem_exec_fence: Coordinate sleep with the start of the request List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Wilson Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 2022-07-26 at 12:13:12 +0200, Karolina Drobnik wrote: > From: Chris Wilson > > Wait until we know the request is running on the GPU before sleeping > and giving a chance for other fences to run ahead. > > Signed-off-by: Chris Wilson > Signed-off-by: Karolina Drobnik Reviewed-by: Kamil Konieczny -- Kamil > --- > tests/i915/gem_exec_fence.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c > index 260aa82c..7ff7614d 100644 > --- a/tests/i915/gem_exec_fence.c > +++ b/tests/i915/gem_exec_fence.c > @@ -324,7 +324,9 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, > .ahnd = ahnd, > .ctx = ctx, > .engine = e->flags, > - .flags = IGT_SPIN_FENCE_OUT | spin_hang(flags)); > + .flags = IGT_SPIN_FENCE_OUT | > + IGT_SPIN_POLL_RUN | > + spin_hang(flags)); > igt_assert(spin->out_fence != -1); > > i = 0; > @@ -347,6 +349,7 @@ static void test_fence_await(int fd, const intel_ctx_t *ctx, > i++; > } > > + igt_spin_busywait_until_started(spin); > /* Long, but not too long to anger preemption disable checks */ > usleep(50 * 1000); /* 50 ms, typical preempt reset is 150+ms */ > > -- > 2.25.1 >