From: jeff.mcgee@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] pm_rps: New subtest for gpu reset
Date: Fri, 31 Jan 2014 10:13:53 -0600 [thread overview]
Message-ID: <1391184833-10973-5-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>
Test that RPS functions as expected after a gpu reset.
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
tests/pm_rps.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 05b859c..846abe6 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -133,6 +133,16 @@ static void checkit(const int *freqs)
igt_assert(freqs[RP1] != 0);
}
+static void matchit(const int *freqs1, const int *freqs2)
+{
+ igt_assert(freqs1[CUR] == freqs2[CUR]);
+ igt_assert(freqs1[MIN] == freqs2[MIN]);
+ igt_assert(freqs1[MAX] == freqs2[MAX]);
+ igt_assert(freqs1[RP0] == freqs2[RP0]);
+ igt_assert(freqs1[RP1] == freqs2[RP1]);
+ igt_assert(freqs1[RPn] == freqs2[RPn]);
+}
+
static void dumpit(const int *freqs)
{
int i;
@@ -462,6 +472,55 @@ static void loaded_check(void)
log("Required %d msec to reach cur=max\n", wait);
}
+#define STABILIZE_WAIT_TIMESTEP_MSEC 100
+#define STABILIZE_WAIT_TIMEOUT_MSEC 2000
+static void stabilize_check(int *freqs)
+{
+ int wait = 0;
+
+ do {
+ read_freqs(freqs);
+ dump(freqs);
+ usleep(1000 * STABILIZE_WAIT_TIMESTEP_MSEC);
+ wait += STABILIZE_WAIT_TIMESTEP_MSEC;
+ } while (wait < STABILIZE_WAIT_TIMEOUT_MSEC);
+
+ log("Waited %d msec to stabilize cur\n", wait);
+}
+
+static void reset(void)
+{
+ int pre_freqs[NUMFREQ];
+ int post_freqs[NUMFREQ];
+
+ log("Apply low load...\n");
+ load_helper_run(LOW);
+ stabilize_check(pre_freqs);
+
+ log("Stop rings...\n");
+ stop_rings();
+ while (rings_stopped())
+ usleep(1000 * 100);
+ log("Ring stop cleared\n");
+
+ log("Apply high load...\n");
+ load_helper_set_load(HIGH);
+ loaded_check();
+
+ log("Apply low load...\n");
+ load_helper_set_load(LOW);
+ stabilize_check(post_freqs);
+ matchit(pre_freqs, post_freqs);
+
+ log("Apply high load...\n");
+ load_helper_set_load(HIGH);
+ loaded_check();
+
+ log("Removing load...\n");
+ load_helper_stop();
+ idle_check();
+}
+
static void pm_rps_exit_handler(int sig)
{
if (origfreqs[MIN] > readval(stuff[MAX].filp)) {
@@ -555,5 +614,8 @@ int main(int argc, char **argv)
load_helper_stop();
}
+ igt_subtest("reset")
+ reset();
+
igt_exit();
}
--
1.8.5.2
next prev parent 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 ` [PATCH 1/4] pm_rps: Add stop rings injection utility jeff.mcgee
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 ` jeff.mcgee [this message]
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-5-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