From 6f80f6b7aece563a4e85fbed9d957d49e245ab7b Mon Sep 17 00:00:00 2001 From: José Roberto de Souza Date: Thu, 4 Oct 2018 13:32:08 -0700 Subject: tests/psr: Share the code check if sink supports PSR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same code checking if sink supports PSR was spread into 3 tests, better move it to lib and reuse. v2: splitted previous patch into this one and the next one(Dhinakaran) Cc: Rodrigo Vivi Cc: Dhinakaran Pandiyan Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza --- lib/igt_psr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/igt_psr.c') diff --git a/lib/igt_psr.c b/lib/igt_psr.c index c105bb6e..82012e6d 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -129,3 +129,13 @@ bool psr_disable(int debugfs_fd) { return psr_set(debugfs_fd, false); } + +bool psr_sink_support(int debugfs_fd) +{ + char buf[PSR_STATUS_MAX_LEN]; + int ret; + + ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, + sizeof(buf)); + return ret > 0 && strstr(buf, "Sink_Support: yes\n"); +} -- cgit v1.2.3