Commit 6e0b3e7a authored by Rodrigo Vivi's avatar Rodrigo Vivi

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 <>
Cc: Imre Deak <>
Cc: Anusha Srivatsa <>
Signed-off-by: default avatarRodrigo Vivi <>
Reviewed-by: Chris Wilson's avatarChris Wilson <>
parent 38a44003
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment