From patchwork Wed Dec 6 23:03:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Argenziano X-Patchwork-Id: 10097379 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 19B4460329 for ; Wed, 6 Dec 2017 23:04:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB7229E90 for ; Wed, 6 Dec 2017 23:04:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00D6429E92; Wed, 6 Dec 2017 23:04:01 +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=-4.2 required=2.0 tests=BAYES_00, 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 AB1EC29E90 for ; Wed, 6 Dec 2017 23:04:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 487BA6E743; Wed, 6 Dec 2017 23:04:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FAE26E737 for ; Wed, 6 Dec 2017 23:03:59 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2017 15:03:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,369,1508828400"; d="scan'208";a="10217845" Received: from relo-linux-2.fm.intel.com ([10.1.27.122]) by orsmga003.jf.intel.com with ESMTP; 06 Dec 2017 15:03:59 -0800 From: Antonio Argenziano To: intel-gfx@lists.freedesktop.org Date: Wed, 6 Dec 2017 15:03:46 -0800 Message-Id: <20171206230346.30767-5-antonio.argenziano@intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171206230346.30767-1-antonio.argenziano@intel.com> References: <20171206230346.30767-1-antonio.argenziano@intel.com> Subject: [Intel-gfx] [RFC i-g-t 5/5] igt_hang_ctx: Add preemptible parameter X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a parameter to make the hanging context pre-emptible. Cc: Chris Wilson Signed-off-by: Antonio Argenziano --- lib/igt_gt.c | 4 ++-- lib/igt_gt.h | 1 + tests/drv_hangman.c | 2 +- tests/gem_reset_stats.c | 2 +- tests/gem_softpin.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 48d40e61..bc33e087 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -294,7 +294,7 @@ igt_hang_t igt_hang_ctx(int fd, igt_hang_opt_t opts) context_set_ban(fd, opts.ctx, 0); emit_recursive_batch(&spin, fd, - (igt_spin_opt_t){opts.ctx, opts.ring, 0, false}); + (igt_spin_opt_t){opts.ctx, opts.ring, 0, opts.preemptible}); if (opts.offset) *opts.offset = spin.spinning_offset; @@ -316,7 +316,7 @@ igt_hang_t igt_hang_ctx(int fd, igt_hang_opt_t opts) */ igt_hang_t igt_hang_ring(int fd, int ring) { - return igt_hang_ctx(fd, (igt_hang_opt_t){0, ring, 0, NULL}); + return igt_hang_ctx(fd, (igt_hang_opt_t){0, ring, 0, NULL, false}); } /** diff --git a/lib/igt_gt.h b/lib/igt_gt.h index 3f3e2d96..17fcee33 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -42,6 +42,7 @@ typedef struct igt_hang_opt { int ring; unsigned flags; uint64_t *offset; + bool preemptible; } igt_hang_opt_t; igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags); diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index 75fb2364..e9227a84 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -187,7 +187,7 @@ static void test_error_state_capture(unsigned ring_id, clear_error_state(); - hang = igt_hang_ctx(device, (igt_hang_opt_t){0, ring_id, HANG_ALLOW_CAPTURE, &offset}); + hang = igt_hang_ctx(device, (igt_hang_opt_t){0, ring_id, HANG_ALLOW_CAPTURE, &offset, false}); batch = gem_mmap__cpu(device, hang.handle, 0, 4096, PROT_READ); gem_set_domain(device, hang.handle, I915_GEM_DOMAIN_CPU, 0); igt_post_hang_ring(device, hang); diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index 19174307..c5024157 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -161,7 +161,7 @@ static void inject_hang(int fd, uint32_t ctx, clock_gettime(CLOCK_MONOTONIC, &ts_injected); - hang = igt_hang_ctx(fd, (igt_hang_opt_t){ctx, e->exec_id | e->flags, flags & BAN, NULL}); + hang = igt_hang_ctx(fd, (igt_hang_opt_t){ctx, e->exec_id | e->flags, flags & BAN, NULL, false}); if ((flags & ASYNC) == 0) igt_post_hang_ring(fd, hang); } diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c index 9256138a..07b5712d 100644 --- a/tests/gem_softpin.c +++ b/tests/gem_softpin.c @@ -359,7 +359,7 @@ static void test_evict_hang(int fd) execbuf.buffers_ptr = to_user_pointer(&object); execbuf.buffer_count = 1; - hang = igt_hang_ctx(fd, (igt_hang_opt_t){0, 0, 0, (uint64_t *)&expected}); + hang = igt_hang_ctx(fd, (igt_hang_opt_t){0, 0, 0, (uint64_t *)&expected, false}); object.offset = expected; object.flags = EXEC_OBJECT_PINNED;