[igt-dev] [PATCH i-g-t 6/6] DO_NOT_MERGE: Debug patch to cover DC IGT test.
Anshuman Gupta
anshuman.gupta at intel.com
Tue Jun 18 17:56:17 UTC 2019
This patch make sure DC state IGT patches run on CI Bat test.
This patch print package c state counter also.
Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
---
tests/i915/i915_pm_dc.c | 51 +++++++++++++++++++++++++++
tests/intel-ci/fast-feedback.testlist | 4 +++
2 files changed, 55 insertions(+)
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index 576e32c7..c672e72e 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -61,6 +61,8 @@ typedef struct {
} data_t;
int msr_fd;
+int pmc_debugfs;
+bool pmc_loaded;
bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count);
void check_dc_counter(int drm_fd, int dc_flag, uint32_t prev_dc_count);
@@ -92,6 +94,49 @@ static bool supports_pc8_plus_residencies(void)
return true;
}
+static bool setup_pmc(void)
+{
+ const char *debugfs_root;
+ char path[200];
+
+ /* Make sure our intel_pmc_core module is loaded. */
+ pmc_loaded = igt_kmod_is_loaded("intel_pmc_core");
+
+ if (!pmc_loaded)
+ pmc_loaded = igt_kmod_load("intel_pmc_core", NULL) == 0;
+
+ if (!pmc_loaded) {
+ igt_info("intel_pmc_core module not loaded\n");
+ return;
+ }
+
+ debugfs_root = igt_debugfs_mount();
+ igt_assert(debugfs_root);
+ snprintf(path, sizeof(path), "%s/pmc_core", debugfs_root);
+ pmc_debugfs = open(path, O_RDONLY);
+ igt_require(pmc_debugfs != -1);
+}
+
+static void dump_file(int dir, const char *filename)
+{
+ char *contents;
+
+ contents = igt_sysfs_get(dir, filename);
+ if (!contents)
+ return;
+
+ igt_info("%s:\n%s\n", filename, contents);
+ free(contents);
+}
+
+static void pmc_dump_file(int fd, const char *file)
+{
+ if (!pmc_loaded)
+ return;
+
+ dump_file(fd, file);
+}
+
static void setup_output(data_t *data)
{
igt_display_t *display = &data->display;
@@ -295,6 +340,9 @@ int main(int argc, char *argv[])
msr_fd = open("/dev/cpu/0/msr", O_RDONLY);
igt_assert_f(msr_fd >= 0,
"Can't open /dev/cpu/0/msr.\n");
+ setup_pmc();
+ igt_info("Initial PC state residencies before test\n");
+ pmc_dump_file(pmc_debugfs, "package_cstate_show");
}
igt_subtest("dc5-psr") {
@@ -328,7 +376,10 @@ int main(int argc, char *argv[])
}
igt_fixture {
+ igt_info("PC state residencies after test\n");
+ pmc_dump_file(pmc_debugfs, "package_cstate_show");
close(data.debugfs_fd);
+ close(pmc_debugfs);
display_fini(&data);
}
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 9b711946..f28c306d 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -229,6 +229,10 @@ igt at kms_setmode@basic-clone-single-crtc
igt at i915_pm_backlight@basic-brightness
igt at i915_pm_rpm@basic-pci-d3-state
igt at i915_pm_rpm@basic-rte
+igt at i915_pm_dc@dc5-psr
+igt at i915_pm_dc@dc6-psr
+igt at i915_pm_dc@dc5-dpms
+igt at i915_pm_dc@dc6-dpms
igt at i915_pm_rps@basic-api
igt at prime_busy@basic-after-default
igt at prime_busy@basic-before-default
--
2.21.0
More information about the igt-dev
mailing list