diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-08-17 13:46:58 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-08-20 10:49:53 -0700 |
commit | 6e0b3e7a2d241af36f8c6b1cc335aa1db3532d29 (patch) | |
tree | b301f119d664320b03f173a825749bfb5a4fa7a7 | |
parent | 38a44003774e35c587c67c8766b35e75dbb993b8 (diff) |
pm_rpm: Require DMC loaded before testing runtime_pm for gen9+
Since we block runtime PM if DMC is not loaded, let's skip
the test.
v2: Use i915_dmc_info presence to detect dmc requirement
instead of gen check as Chris suggested.
v3: Add missing \0 before using buf. (Chris)
v4: read only 14 bytes [0:13] so buf[len] is the 15th position.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/pm_rpm.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index bbe36e59..e3bb6227 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -693,6 +693,21 @@ static void setup_pc8(void) has_pc8 = true; } +static bool dmc_loaded(void) +{ + char buf[15]; + int len; + + len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1); + if (len < 0) + return true; /* no CSR support, no DMC requirement */ + + buf[len] = '\0'; + + igt_info("DMC: %s\n", buf); + return strstr(buf, "fw loaded: yes"); +} + static bool setup_environment(void) { if (has_runtime_pm) @@ -715,6 +730,7 @@ static bool setup_environment(void) igt_info("Runtime PM support: %d\n", has_runtime_pm); igt_info("PC8 residency support: %d\n", has_pc8); igt_require(has_runtime_pm); + igt_require(dmc_loaded()); out: disable_all_screens(&ms_data); |