From patchwork Tue Jan 28 11:16:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 3546271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A9B6C02DC for ; Tue, 28 Jan 2014 11:17:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD3F820127 for ; Tue, 28 Jan 2014 11:17:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C0135200F2 for ; Tue, 28 Jan 2014 11:17:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CDC65FC296; Tue, 28 Jan 2014 03:17:04 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 296C3FC296 for ; Tue, 28 Jan 2014 03:17:02 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 28 Jan 2014 03:16:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,735,1384329600"; d="scan'208";a="465882230" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.60]) by fmsmga001.fm.intel.com with ESMTP; 28 Jan 2014 03:16:55 -0800 Received: by rosetta (Postfix, from userid 1000) id 83F298009D; Tue, 28 Jan 2014 13:16:44 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Jan 2014 13:16:35 +0200 Message-Id: <1390907795-3491-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1390907795-3491-1-git-send-email-mika.kuoppala@intel.com> References: <1390907795-3491-1-git-send-email-mika.kuoppala@intel.com> Cc: ben@bwidawsk.net, miku@iki.fi Subject: [Intel-gfx] [RFC] tests/gem_reset_stats: add subtest hang-render-and- X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If multiple rings are hung at the same time by two different contexts, both should get get blamed for hanging the GPU. Signed-off-by: Mika Kuoppala --- tests/gem_reset_stats.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index 331d954..c1bf72e 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -1017,6 +1017,37 @@ static void test_params(void) close(fd); } +static void test_hang_render_and(void) +{ + int fd[2]; + int h[2]; + int ctx; + const struct target_ring *ring = current_ring; + + fd[0] = drm_open_any(); + fd[1] = drm_open_any(); + + ctx = context_create(fd[0]); + igt_assert(ctx >= 0); + + h[0] = inject_hang_ring(fd[0], ctx, I915_EXEC_RENDER); + h[1] = inject_hang_ring(fd[1], 0, ring->exec); + + gem_sync(fd[1], h[1]); + + assert_reset_status(fd[0], ctx, RS_BATCH_ACTIVE); + assert_reset_status(fd[1], 0, RS_BATCH_ACTIVE); + + gem_close(fd[1], h[1]); + gem_close(fd[0], h[0]); + + context_destroy(fd[0], ctx); + + close(fd[1]); + close(fd[0]); +} + + #define RING_HAS_CONTEXTS current_ring->contexts(current_ring) #define RUN_CTX_TEST(...) do { igt_skip_on(RING_HAS_CONTEXTS == false); __VA_ARGS__; } while (0) @@ -1093,5 +1124,8 @@ igt_main test_close_pending_fork(true); test_close_pending_fork(false); } + + igt_subtest_f("hang-render-and-%s", name) + test_hang_render_and(); } }