summaryrefslogtreecommitdiff
path: root/lib/igt_pm.c
diff options
context:
space:
mode:
authorAshutosh Dixit <ashutosh.dixit@intel.com>2023-06-08 08:47:55 -0700
committerAshutosh Dixit <ashutosh.dixit@intel.com>2023-06-09 15:57:48 -0700
commit17fbab44f3ce578011e74a9de99884e32a133b25 (patch)
treee93582571085925c33d2a53dbee3ed45e7406ad4 /lib/igt_pm.c
parent7749841fc500ebe8c7ad7a0e7d25033e0bc9885f (diff)
tests/gem_ctx_freq: Disable SLPC efficient freq for the test
When SLPC efficient freq is enabled, GPU frequencies can be outside the min/max range set from sysfs. Any test which compares actual GPU frequency against set frequencies is therefore meaningful only when SLPC efficient freq is disabled. v2: Move ignore_slpc_efficient_freq to lib/igt_pm.c (Vinay) Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/6786 Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Diffstat (limited to 'lib/igt_pm.c')
-rw-r--r--lib/igt_pm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index e60b09a73..18c84bf3a 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -1400,3 +1400,20 @@ int igt_pm_get_runtime_usage(struct pci_device *pci_dev)
return usage;
}
+
+/**
+ * igt_pm_ignore_slpc_efficient_freq
+ * @i915: open i915 drm file descriptor
+ * @gtfd: open gt sysfs fd
+ * @val: value to set
+ *
+ * Ignores/un-ignores SLPC efficient frequency
+ */
+void igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val)
+{
+ if (!(gem_using_guc_submission(i915) && i915_is_slpc_enabled(i915)))
+ return;
+
+ igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq"));
+ igt_assert(igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val));
+}