summaryrefslogtreecommitdiff
path: root/tests/pm_rc6_residency.c
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2015-02-26 21:10:28 +0530
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-26 17:52:03 +0100
commitaf02ef4a483184dbd9a549e98f40a1975aa204fe (patch)
tree61164a1477892a07b5ae9340332737a02692701b /tests/pm_rc6_residency.c
parentd5579f472e103e7cafb7bb10d5c52246c3d1f072 (diff)
tests/pm_rc6_residency: Fix proper residency calculation
With current code we are not considering the RC6 residency during sysfs read. This is causing test to fail due to incorrect residency_accuracy check This patch consider code time spent for accuracy check Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/pm_rc6_residency.c')
-rw-r--r--tests/pm_rc6_residency.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 2658a893..1600ac32 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -37,6 +37,7 @@
#define SLEEP_DURATION 3000 // in milliseconds
#define RC6_FUDGE 900 // in milliseconds
+#define CODE_TIME 50 // in microseconfs
static unsigned int readit(const char *path)
{
@@ -102,7 +103,7 @@ static void residency_accuracy(int value[],const char *name_of_rc6_residency)
"the GPU is as idle as possible(ie. no X, "
"running and running no other tests)\n");
- counter = ((double)value[1] - (double)value[0]) /(double) SLEEP_DURATION;
+ counter = ((double)value[1] - (double)value[0]) /(double) (SLEEP_DURATION + CODE_TIME);
if( counter > 0.9 ){
counter_result = counter;