[igt-dev] [i-g-t] tests/i915/i915_pm_dc: Fix DC9 test case
Mastan Katragadda
mastanx.katragadda at intel.com
Mon Nov 29 07:31:48 UTC 2021
Reading prev_dc counter is most of the times 0 after reset
comparison with 0 test gets failed. taken prev_dc counter after
enterd into shallow DC state.
Signed-off-by: Mastan Katragadda <mastanx.katragadda at intel.com>
---
tests/i915/i915_pm_dc.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index 4ebeb3eb..074b765b 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -434,22 +434,24 @@ static void setup_dc9_dpms(data_t *data, int dc_target)
dpms_off(data);
igt_skip_on_f(!(igt_wait(read_dc_counter(data->debugfs_fd, dc_target) >
prev_dc, 3000, 100)), "Unable to enters shallow DC states\n");
+ prev_dc = read_dc_counter(data->debugfs_fd, dc_target);
dpms_on(data);
cleanup_dc_dpms(data);
+ dpms_off(data);
+ sleep(1); /* wait for counters reset*/
+ check_dc9(data, dc_target, prev_dc);
+ dpms_on(data);
+
+
}
static void test_dc9_dpms(data_t *data)
{
- int prev_dc, dc_target;
+ int dc_target;
require_dc_counter(data->debugfs_fd, CHECK_DC5);
dc_target = support_dc6(data->debugfs_fd) ? CHECK_DC6 : CHECK_DC5;
- prev_dc = read_dc_counter(data->debugfs_fd, dc_target);
setup_dc9_dpms(data, dc_target);
- dpms_off(data);
- sleep(1); /* wait for counters reset*/
- check_dc9(data, dc_target, prev_dc);
- dpms_on(data);
}
static void kms_poll_state_restore(int sig)
--
2.25.1
More information about the igt-dev
mailing list