From patchwork Wed Oct 30 23:59:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11220469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9D99913 for ; Wed, 30 Oct 2019 23:59:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C75602075D for ; Wed, 30 Oct 2019 23:59:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C75602075D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chris-wilson.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F4B16EBBD; Wed, 30 Oct 2019 23:59:44 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BBA16EBBB; Wed, 30 Oct 2019 23:59:42 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 19026083-1500050 for multiple; Wed, 30 Oct 2019 23:59:35 +0000 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 30 Oct 2019 23:59:34 +0000 Message-Id: <20191030235934.4705-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.24.0.rc1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] i915/gem_ctx_persistence: Sanitycheck execbuf state harder for 'queued' X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" And initialise fence to -1 to avoid closing stdin (fd:0)! Signed-off-by: Chris Wilson --- tests/i915/gem_ctx_persistence.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c index 9273da159..fa6ee7516 100644 --- a/tests/i915/gem_ctx_persistence.c +++ b/tests/i915/gem_ctx_persistence.c @@ -363,10 +363,10 @@ static void test_nonpersistent_file(int i915) static void test_nonpersistent_queued(int i915, unsigned int engine) { - int count = gem_measure_ring_inflight(i915, engine, 0); + const int count = gem_measure_ring_inflight(i915, engine, 0); igt_spin_t *spin; + int fence = -1; uint32_t ctx; - int fence; /* * Not only must the immediate batch be cancelled, but @@ -383,10 +383,13 @@ static void test_nonpersistent_queued(int i915, unsigned int engine) .flags = IGT_SPIN_FENCE_OUT); for (int i = 0; i < count - 1; i++) { + spin->execbuf.rsvd2 = 0; if (fence != -1) close(fence); - spin->execbuf.rsvd2 = 0; + + igt_assert(spin->execbuf.flags & I915_EXEC_FENCE_OUT); gem_execbuf_wr(i915, &spin->execbuf); + igt_assert(spin->execbuf.rsvd2); fence = spin->execbuf.rsvd2 >> 32; } @@ -396,8 +399,7 @@ static void test_nonpersistent_queued(int i915, unsigned int engine) igt_assert_eq(sync_fence_wait(fence, MSEC_PER_SEC / 5), 0); igt_assert_eq(sync_fence_status(fence), -EIO); - spin->handle = 0; - igt_spin_free(-1, spin); + igt_spin_free(i915, spin); } static void sendfd(int socket, int fd)