summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWendy Wang <wendy.wang@intel.com>2014-08-26 14:38:49 +0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-26 09:15:45 +0200
commitc1cf0d81389e8cc696a233aa357130f97e1b9a4c (patch)
treedc90555bd74d356be59bfa420f3bb9aaa55c4023
parent50166d2a20b72d008e5991a157a45cd9a77e4dea (diff)
Merge two subtests for pm_rc6_residency IGT case
Combine two subtests(rc6_residency_check and rc6_residency_counter) into one subtest(residency_accuracy) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/pm_rc6_residency.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 8cf7be392..3f3363a5a 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -87,13 +87,22 @@ static void read_rc6_residency( int value[], const char *name_of_rc6_residency[]
free(path);
}
-static void rc6_residency_counter(int value[],const char *name_of_rc6_residency[])
+static void residency_accuracy(int value[],const char *name_of_rc6_residency[])
{
int flag;
unsigned int flag_counter,flag_support;
double counter_result = 0;
+ unsigned int diff;
flag_counter = 0;
flag_support = 0;
+ diff = (value[3] - value[0]) +
+ (value[4] - value[1]) +
+ (value[5] - value[2]);
+
+ igt_assert_f(diff <= (SLEEP_DURATION + RC6_FUDGE),"Diff was too high. That is unpossible\n");
+ igt_assert_f(diff >= (SLEEP_DURATION - RC6_FUDGE),"GPU was not in RC6 long enough. Check that "
+ "the GPU is as idle as possible(ie. no X, "
+ "running and running no other tests)\n");
for(flag = NUMBER_OF_RC6_RESIDENCY-1; flag >= 0; flag --)
{
@@ -123,26 +132,11 @@ static void rc6_residency_counter(int value[],const char *name_of_rc6_residency[
}
igt_info("The residency counter: %f \n", counter_result);
-
igt_skip_on_f(flag_support == 0 , "This machine didn't entry any RC6 state.\n");
igt_assert_f((flag_counter != 0) && (counter_result <=1) , "Sysfs RC6 residency counter is inaccurate.\n");
-
igt_info("This machine entry %s state.\n", name_of_rc6_residency[(flag_counter / 2) - 1]);
}
-static void rc6_residency_check(int value[])
-{
- unsigned int diff;
- diff = (value[3] - value[0]) +
- (value[4] - value[1]) +
- (value[5] - value[2]);
-
- igt_assert_f(diff <= (SLEEP_DURATION + RC6_FUDGE),"Diff was too high. That is unpossible\n");
- igt_assert_f(diff >= (SLEEP_DURATION - RC6_FUDGE),"GPU was not in RC6 long enough. Check that "
- "the GPU is as idle as possible(ie. no X, "
- "running and running no other tests)\n");
-}
-
igt_main
{
int fd;
@@ -159,9 +153,6 @@ igt_main
read_rc6_residency(value, name_of_rc6_residency);
}
- igt_subtest("rc6-residency-check")
- rc6_residency_check(value);
-
- igt_subtest("rc6-residency-counter")
- rc6_residency_counter(value, name_of_rc6_residency);
+ igt_subtest("residency-accuracy")
+ residency_accuracy(value, name_of_rc6_residency);
}