summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>2020-12-08 22:31:08 +0530
committerPetri Latvala <petri.latvala@intel.com>2021-01-08 14:17:55 +0200
commit3ad22ccfd5e409ba0cc0b3609597615978353137 (patch)
treecff3e20025c71aa35837b32bd1617e473d5ed2da /lib
parent37af81f0352567a3de625111f36809930b0f8fce (diff)
lib/igt_psr: Add function to check PSR2 selective fetch
Add a helper function to check whether "PSR2 selective fetch" is enabled. This function should be used wherever "PSR2 selective fetch" status check needed. Reviewed-by: Jose Roberto de Souza <jose.souza@intel.com> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
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 6cdb97bc..d5167fba 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -36,6 +36,16 @@ bool psr_disabled_check(int debugfs_fd)
return strstr(buf, "PSR mode: disabled\n");
}
+bool psr2_selective_fetch_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, "PSR2 selective fetch: enabled");
+}
+
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 8368ecb4..25111cc2 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -36,6 +36,7 @@ enum psr_mode {
};
bool psr_disabled_check(int debugfs_fd);
+bool psr2_selective_fetch_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);