diff options
author | Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> | 2018-09-05 14:15:56 -0700 |
---|---|---|
committer | Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> | 2018-09-05 18:12:43 -0700 |
commit | 0eb4d05ea1148672086972e5dc2506a8d2002ce6 (patch) | |
tree | f0c44cc37c519829832bc9ebb1556aa7900318bd /lib/igt_psr.c | |
parent | 219b578bca04c93004e3f3942ce3079813f72724 (diff) |
tests/psr: Avoid opening of already open debugfs dir
The tests calls igt_debugfs_dir() to open the debugfs dir and further
along calls igt_debugfs_read() each time i915_edp_psr_status needs to be
read. As igt_debugfs_read() opens the directory unnecessarily, switch to
using the newly added igt_debugfs_simple_read()
v2: Commit message typo (Jose)
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'lib/igt_psr.c')
-rw-r--r-- | lib/igt_psr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_psr.c b/lib/igt_psr.c index bc142632..6c5cf43d 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -30,7 +30,7 @@ bool psr_active(int fd, bool check_active) bool active; char buf[512]; - igt_debugfs_read(fd, "i915_edp_psr_status", buf); + igt_debugfs_simple_read(fd, "i915_edp_psr_status", buf, sizeof(buf)); active = strstr(buf, "HW Enabled & Active bit: yes\n") && (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); return check_active ? active : !active; |