[PATCH igt v2] igt/pm_rc6_residency: Check debugfs existence before reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During the startup, we try to determine if the system supports rc6 prior
to testing. However, the startup check asserts the residency debugfs
exists, instead of testing for a requirement.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/pm_rc6_residency.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 01eeaa307..42a41c833 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -60,6 +60,15 @@ static unsigned long get_rc6_enabled_mask(void)
 	return enabled;
 }
 
+static bool has_rc6_residency(const char *name)
+{
+	unsigned long residency;
+	char path[128];
+
+	sprintf(path, "power/%s_residency_ms", name);
+	return igt_sysfs_scanf(sysfs, path, "%lu", &residency) == 1;
+}
+
 static unsigned long read_rc6_residency(const char *name)
 {
 	unsigned long residency;
@@ -201,6 +210,8 @@ igt_main
 		devid = intel_get_drm_devid(fd);
 		sysfs = igt_sysfs_open(fd, NULL);
 
+		igt_require(has_rc6_residency("rc6"));
+
 		/* Make sure rc6 counters are running */
 		igt_drop_caches_set(fd, DROP_IDLE);
 		igt_require(wait_for_rc6());
-- 
2.16.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux