[PATCH igt] igt/pm_rc6_residency: Allow some leeway on the upper %% bound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As we use rounding when converting from hw clocks to time, we may report
a residency greater than wallclock (by a small margin), so allow us to
overshoot by 5% (just due to our inaccuracy).

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/pm_rc6_residency.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index d6fc4701..520d3b54 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -79,9 +79,9 @@ static void residency_accuracy(unsigned int diff,
 
 	ratio = (double)diff / duration;
 
-	igt_info("Residency in %s or deeper state: %u ms (sleep duration %u ms) (ratio to expected duration: %.02f)\n",
-		 name_of_rc6_residency, diff, duration, ratio);
-	igt_assert_f(ratio > 0.9 && ratio <= 1,
+	igt_info("Residency in %s or deeper state: %u ms (sleep duration %u ms) (%.1f%% of expected duration)\n",
+		 name_of_rc6_residency, diff, duration, 100*ratio);
+	igt_assert_f(ratio > 0.9 && ratio <= 1.05,
 		     "Sysfs RC6 residency counter is inaccurate.\n");
 }
 
-- 
2.15.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux