From 554aac5f3e349cb5e6cd99f42826893abf564d85 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Fri, 15 May 2015 17:30:58 +0300 Subject: [PATCH] tests/pm_rc6_residency: fix check if RC6P or RC6PP is enabled The test checks the residency in a given RC6 state or any deeper states that are also enabled. For example the RC6 subtest checks the combined residency in RC6/RC6P/RC6PP. Since the kernel reported value for the RC6 residency doesn't include the RC6P or RC6PP residency we need to adjust the RC6 value accordingly. A similar adjustment is needed for the RC6P subtest. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90369 Signed-off-by: Imre Deak Acked-by: Daniel Vetter --- tests/pm_rc6_residency.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c index 54a6b10b..9203d2fa 100644 --- a/tests/pm_rc6_residency.c +++ b/tests/pm_rc6_residency.c @@ -162,6 +162,17 @@ static void measure_residencies(int devid, unsigned int rc6_mask, res->rc6p = end.rc6p - start.rc6p; res->rc6pp = end.rc6pp - start.rc6pp; res->media_rc6 = end.media_rc6 - start.media_rc6; + + /* + * For the purposes of this test case we want a given residency value + * to include the time spent in the corresponding RC state _and_ also + * the time spent in any enabled deeper states. So for example if any + * of RC6P or RC6PP is enabled we want the time spent in these states + * to be also included in the RC6 residency value. The kernel reported + * residency values are exclusive, so add up things here. + */ + res->rc6p += res->rc6pp; + res->rc6 += res->rc6p; } igt_main