All of lore.kernel.org
 help / color / mirror / Atom feed
From: jeff.mcgee@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] pm_rps: New subtest min-max-config-loaded
Date: Tue, 28 Jan 2014 18:25:06 -0600	[thread overview]
Message-ID: <1390955106-29853-5-git-send-email-jeff.mcgee@intel.com> (raw)
In-Reply-To: <1390955106-29853-1-git-send-email-jeff.mcgee@intel.com>

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

Like subtest basic-api, but additionally requires that current
frequency is increasing to the configured maximum within reasonable
time since we are loaded.

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

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 555bb7c..709e341 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -371,6 +371,29 @@ static void idle_check(void)
 	log("Required %d msec to reach cur=min\n", wait);
 }
 
+#define LOADED_WAIT_TIMESTEP_MSEC 100
+#define LOADED_WAIT_TIMEOUT_MSEC 3000
+static void loaded_check(void)
+{
+	int freqs[NUMFREQ];
+	int wait = 0;
+
+	/* Monitor frequencies until cur increases to max, which should
+	 * happen within the allotted time */
+	do {
+		read_freqs(freqs);
+		dump(freqs);
+		checkit(freqs);
+		if (freqs[CUR] == freqs[MAX])
+			break;
+		usleep(1000 * LOADED_WAIT_TIMESTEP_MSEC);
+		wait += LOADED_WAIT_TIMESTEP_MSEC;
+	} while (wait < LOADED_WAIT_TIMEOUT_MSEC);
+
+	igt_assert(freqs[CUR] == freqs[MAX]);
+	log("Required %d msec to reach cur=max\n", wait);
+}
+
 static void pm_rps_exit_handler(int sig)
 {
 	if (origfreqs[MIN] > readval(stuff[MAX].filp)) {
@@ -456,5 +479,11 @@ int main(int argc, char **argv)
 	igt_subtest("min-max-config-idle")
 		min_max_config(idle_check);
 
+	igt_subtest("min-max-config-loaded") {
+		load_helper_run();
+		min_max_config(loaded_check);
+		load_helper_stop();
+	}
+
 	igt_exit();
 }
-- 
1.8.5.2

  parent reply	other threads:[~2014-01-29  0:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  0:25 Add two new subtests to pm_rps jeff.mcgee
2014-01-29  0:25 ` [PATCH 1/4] pm_rps: New subtest min-max-config-idle jeff.mcgee
2014-01-29  0:25 ` [PATCH 2/4] lib/drmtest: Add igt_wait_helper jeff.mcgee
2014-01-29  0:25 ` [PATCH 3/4] pm_rps: Add load helper for loading gpu jeff.mcgee
2014-01-29  0:25 ` jeff.mcgee [this message]
2014-02-05 19:20 ` Add two new subtests to pm_rps 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=1390955106-29853-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 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.