From: Mika Kuoppala Subject: [RFC] tests/gem_reset_stats: add subtest hang-render-and- Date: Tue, 28 Jan 2014 13:16:35 +0200 Message-ID: <1390907795-3491-2-git-send-email-mika.kuoppala@intel.com> References: <1390907795-3491-1-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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) In-Reply-To: <1390907795-3491-1-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: ben@bwidawsk.net, miku@iki.fi List-Id: intel-gfx@lists.freedesktop.org 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(); } } -- 1.7.9.5