From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/3] tests/gem_reset_stats: stop rings after injecting hang
Date: Wed, 20 Nov 2013 16:58:16 +0200 [thread overview]
Message-ID: <1384959497-25533-2-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1384959497-25533-1-git-send-email-mika.kuoppala@intel.com>
To make driver report a simulated hang in dmesg.
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
tests/gem_reset_stats.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index a7497f3..9e52b60 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -42,6 +42,7 @@
#include "intel_batchbuffer.h"
#include "intel_gpu_tools.h"
#include "rendercopy.h"
+#include "igt_debugfs.h"
#define RS_NO_ERROR 0
#define RS_BATCH_ACTIVE (1 << 0)
@@ -73,6 +74,8 @@ struct local_drm_i915_gem_context_destroy {
#define CONTEXT_DESTROY_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2e, struct local_drm_i915_gem_context_destroy)
#define GET_RESET_STATS_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x32, struct local_drm_i915_reset_stats)
+static igt_debugfs_t dfs;
+
static uint32_t context_create(int fd)
{
struct local_drm_i915_gem_context_create create;
@@ -192,6 +195,17 @@ static int exec_valid(int fd, int ctx)
return exec.handle;
}
+static void stop_rings(void)
+{
+ int fd;
+
+ fd = igt_debugfs_open(&dfs, "i915_ring_stop", O_WRONLY);
+ igt_assert(fd >= 0);
+
+ igt_assert(write(fd, "0xff", 4) == 4);
+ close(fd);
+}
+
#define BUFSIZE (4 * 1024)
#define ITEMS (BUFSIZE >> 2)
@@ -284,6 +298,8 @@ static int inject_hang(int fd, int ctx)
free(buf);
+ stop_rings();
+
return exec.handle;
}
@@ -743,6 +759,8 @@ igt_main
igt_skip("Kernel is too old, or contexts not supported: %s\n",
strerror(errno));
+ assert(igt_debugfs_init(&dfs) == 0);
+
close(fd);
}
--
1.7.9.5
next prev parent reply other threads:[~2013-11-20 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 14:58 [PATCH 1/3] tests/gem_reset_stats: add support for BDW+ Mika Kuoppala
2013-11-20 14:58 ` Mika Kuoppala [this message]
2013-11-20 14:58 ` [PATCH 3/3] tests/gem_reset_stats: check non root access to reset_stats Mika Kuoppala
2013-11-20 20:32 ` 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=1384959497-25533-2-git-send-email-mika.kuoppala@intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox