All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: ben@bwidawsk.net, miku@iki.fi
Subject: [RFC] tests/gem_reset_stats: add subtest hang-render-and-<ring>
Date: Tue, 28 Jan 2014 13:16:35 +0200	[thread overview]
Message-ID: <1390907795-3491-2-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1390907795-3491-1-git-send-email-mika.kuoppala@intel.com>

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 <mika.kuoppala@intel.com>
---
 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

  reply	other threads:[~2014-01-28 11:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 11:16 [RFC] How to assign blame when multiple rings are hung Mika Kuoppala
2014-01-28 11:16 ` Mika Kuoppala [this message]
2014-01-28 12:39 ` Chris Wilson
2014-01-28 19:36   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390907795-3491-2-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=miku@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.