From patchwork Wed Jul 11 07:42:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10519027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5337E6028E for ; Wed, 11 Jul 2018 07:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 452E728756 for ; Wed, 11 Jul 2018 07:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38FB628E7C; Wed, 11 Jul 2018 07:42:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEF8728756 for ; Wed, 11 Jul 2018 07:42:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B2826EBD0; Wed, 11 Jul 2018 07:42:57 +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 1B5226E02F; Wed, 11 Jul 2018 07:42:54 +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 12316029-1500050 for multiple; Wed, 11 Jul 2018 08:42:43 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 11 Jul 2018 08:42:49 +0100 Message-Id: <20180711074249.20479-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.18.0 Subject: [Intel-gfx] [PATCH i-g-t] lib/dummyload: Control whether or not the batch is preemptible 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 MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Sometimes, we do not want to allow control to escape from the spinner, e.g. for when we want to hang the GPU inside the batch. (Split out from the preempt-timeout test case.) Signed-off-by: Chris Wilson Reviewed-by: Antonio Argenziano --- lib/igt_dummyload.c | 5 ++--- lib/igt_dummyload.h | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index 7beb66244..2027a4b7f 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -186,7 +186,8 @@ emit_recursive_batch(igt_spin_t *spin, spin->handle = obj[BATCH].handle; /* Allow ourselves to be preempted */ - *batch++ = MI_ARB_CHK; + if (!(opts->flags & IGT_SPIN_NO_PREEMPTION)) + *batch++ = MI_ARB_CHK; /* Pad with a few nops so that we do not completely hog the system. * @@ -379,8 +380,6 @@ void igt_spin_batch_end(igt_spin_t *spin) if (!spin) return; - igt_assert(*spin->batch == MI_ARB_CHK || - *spin->batch == MI_BATCH_BUFFER_END); *spin->batch = MI_BATCH_BUFFER_END; __sync_synchronize(); } diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h index e80a12451..38bc7682e 100644 --- a/lib/igt_dummyload.h +++ b/lib/igt_dummyload.h @@ -50,9 +50,10 @@ struct igt_spin_factory { unsigned int flags; }; -#define IGT_SPIN_FENCE_OUT (1 << 0) -#define IGT_SPIN_POLL_RUN (1 << 1) -#define IGT_SPIN_FAST (1 << 2) +#define IGT_SPIN_FENCE_OUT (1 << 0) +#define IGT_SPIN_POLL_RUN (1 << 1) +#define IGT_SPIN_FAST (1 << 2) +#define IGT_SPIN_NO_PREEMPTION (1 << 3) igt_spin_t * __igt_spin_batch_factory(int fd, const struct igt_spin_factory *opts);