From 5ef25867499fadf39f7eb81bab5f07158b740093 Mon Sep 17 00:00:00 2001 From: José Roberto de Souza Date: Thu, 4 Oct 2018 13:12:41 -0700 Subject: lib/psr: Add support to new modified i915_edp_psr_status output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel patch 'drm/i915: Refactor PSR status debugfs' changed the output of i915_edp_psr_status, so adding support to the new output here while keeping the support to the old one for a while. In psr_active() we were overdoing, we just need to check the source state to know if PSR is active and doing that we keep compability to old and new i915_edp_psr_status output. Cc: Rodrigo Vivi Cc: Dhinakaran Pandiyan Reviewed-by: Rodrigo Vivi Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza --- lib/igt_psr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/igt_psr.c') diff --git a/lib/igt_psr.c b/lib/igt_psr.c index 82012e6d..a59ff94e 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -32,8 +32,8 @@ static bool psr_active(int debugfs_fd, bool check_active) igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, sizeof(buf)); - active = strstr(buf, "HW Enabled & Active bit: yes\n") && - (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); + + active = strstr(buf, "SRDENT") || strstr(buf, "SLEEP"); return check_active ? active : !active; } @@ -137,5 +137,6 @@ bool psr_sink_support(int debugfs_fd) ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, sizeof(buf)); - return ret > 0 && strstr(buf, "Sink_Support: yes\n"); + return ret > 0 && (strstr(buf, "Sink_Support: yes\n") || + strstr(buf, "Sink support: yes")); } -- cgit v1.2.3