From 1a02046973e6d40f0b2d08a8a0370f384c11fbba Mon Sep 17 00:00:00 2001 From: Dhinakaran Pandiyan Date: Mon, 16 Jul 2018 15:39:03 -0700 Subject: tests/psr: Prepare for moving PSR state checking functions into lib Change the function arguments to not rely on test specific data as the following patches change kms_frontbuffer_tracking to reuse PSR functions. v2: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi Signed-off-by: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi --- tests/kms_psr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/kms_psr.c b/tests/kms_psr.c index 4eca51da..9e893ed8 100644 --- a/tests/kms_psr.c +++ b/tests/kms_psr.c @@ -197,12 +197,12 @@ static bool sink_support(data_t *data) strstr(buf, "Sink_Support: yes\n"); } -static bool psr_active(data_t *data, bool check_active) +static bool psr_active(int fd, bool check_active) { bool active; char buf[512]; - igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf); + igt_debugfs_read(fd, "i915_edp_psr_status", buf); active = strstr(buf, "HW Enabled & Active bit: yes\n") && (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); @@ -214,7 +214,7 @@ static bool wait_psr_entry(data_t *data) if (data->with_psr_disabled) return true; - return igt_wait((psr_active(data, true)), 500, 1); + return igt_wait((psr_active(data->drm_fd, true)), 500, 1); } static inline void manual(const char *expected) @@ -303,7 +303,7 @@ static void run_test(data_t *data) expected = "screen GREEN"; break; } - igt_assert(psr_active(data, false)); + igt_assert(psr_active(data->drm_fd, false)); manual(expected); } -- cgit v1.2.3