[igt-dev] [PATCH i-g-t 2/3] lib/igt_psr: Add function to check PSR2 selective fetch
Pankaj Bharadiya
pankaj.laxminarayan.bharadiya at intel.com
Wed Nov 18 08:14:48 UTC 2020
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 at intel.com>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
---
lib/igt_psr.c | 10 ++++++++++
lib/igt_psr.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 6cdb97bcc..d5167fbad 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 8368ecb49..25111cc2b 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);
--
2.29.2
More information about the igt-dev
mailing list