summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_psr.c10
-rw-r--r--lib/igt_psr.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 83ccacdd..f92eff6c 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -25,6 +25,16 @@
#include "igt_sysfs.h"
#include <errno.h>
+bool psr_disabled_check(int debugfs_fd)
+{
+ char buf[PSR_STATUS_MAX_LEN];
+
+ igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
+ sizeof(buf));
+
+ return strstr(buf, "PSR mode: disabled\n");
+}
+
static bool psr_active_check(int debugfs_fd, enum psr_mode mode)
{
char buf[PSR_STATUS_MAX_LEN];
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index ca385736..02ce760b 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -35,6 +35,7 @@ enum psr_mode {
PSR_MODE_2
};
+bool psr_disabled_check(int debugfs_fd);
bool psr_wait_entry(int debugfs_fd, enum psr_mode mode);
bool psr_wait_update(int debugfs_fd, enum psr_mode mode);
bool psr_long_wait_update(int debugfs_fd, enum psr_mode mode);