public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: jeff.mcgee@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/4] pm_rps: Add stop rings injection utility
Date: Fri, 31 Jan 2014 10:13:50 -0600	[thread overview]
Message-ID: <1391184833-10973-2-git-send-email-jeff.mcgee@intel.com> (raw)
In-Reply-To: <1391184833-10973-1-git-send-email-jeff.mcgee@intel.com>

From: Jeff McGee <jeff.mcgee@intel.com>

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/pm_rps.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 709e341..a6807d2 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -32,10 +32,12 @@
 #include <string.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <fcntl.h>
 #include "drmtest.h"
 #include "intel_gpu_tools.h"
 #include "intel_bufmgr.h"
 #include "intel_batchbuffer.h"
+#include "igt_debugfs.h"
 
 static bool verbose = false;
 
@@ -62,6 +64,8 @@ struct junk {
 	{ "cur", "r", NULL }, { "min", "rb+", NULL }, { "max", "rb+", NULL }, { "RP0", "r", NULL }, { "RP1", "r", NULL }, { "RPn", "r", NULL }, { NULL, NULL, NULL }
 };
 
+static igt_debugfs_t dfs;
+
 static int readval(FILE *filp)
 {
 	int val;
@@ -267,6 +271,37 @@ static void load_helper_deinit(void)
 		drm_intel_bufmgr_destroy(lh.bufmgr);
 }
 
+static void stop_rings(void)
+{
+	int fd;
+	static const char data[] = "0xf";
+
+	fd = igt_debugfs_open(&dfs, "i915_ring_stop", O_WRONLY);
+	igt_assert(fd >= 0);
+
+	log("injecting ring stop\n");
+	igt_assert(write(fd, data, sizeof(data)) == sizeof(data));
+
+	close(fd);
+}
+
+static bool rings_stopped(void)
+{
+	int fd;
+	static char buf[128];
+	unsigned long long val;
+
+	fd = igt_debugfs_open(&dfs, "i915_ring_stop", O_RDONLY);
+	igt_assert(fd >= 0);
+
+	igt_assert(read(fd, buf, sizeof(buf)) > 0);
+	close(fd);
+
+	sscanf(buf, "%llx", &val);
+
+	return (bool)val;
+}
+
 static void min_max_config(void (*check)(void))
 {
 	int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2;
@@ -471,6 +506,8 @@ int main(int argc, char **argv)
 		igt_install_exit_handler(pm_rps_exit_handler);
 
 		load_helper_init();
+
+		igt_debugfs_init(&dfs);
 	}
 
 	igt_subtest("basic-api")
-- 
1.8.5.2

  reply	other threads:[~2014-01-31 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 16:13 Add reset subtest to pm_rps jeff.mcgee
2014-01-31 16:13 ` jeff.mcgee [this message]
2014-01-31 16:13 ` [PATCH 2/4] pm_rps: Load helper should stall for last write jeff.mcgee
2014-01-31 16:13 ` [PATCH 3/4] pm_rps: Add variable load support to load helper jeff.mcgee
2014-01-31 16:13 ` [PATCH 4/4] pm_rps: New subtest for gpu reset jeff.mcgee
2014-02-05 19:21 ` Add reset subtest to pm_rps Jeff McGee
2014-02-06  6:48   ` Daniel Vetter
2014-02-06 14:59     ` Jeff McGee

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=1391184833-10973-2-git-send-email-jeff.mcgee@intel.com \
    --to=jeff.mcgee@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