[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
Thu Jun 13 10:47:46 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 | 53 +++++++++++++++++++++++++++
tests/intel-ci/fast-feedback.testlist | 4 ++
2 files changed, 57 insertions(+)
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index ba891d85..fde27623 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -32,6 +32,7 @@
#include "intel_bufmgr.h"
#include "intel_io.h"
#include "limits.h"
+#include "igt_kmod.h"
/* DC State Flags */
#define CHECK_DC5 1
@@ -49,9 +50,55 @@ typedef struct {
bool runtime_suspend_disabled;
} data_t;
+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);
+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;
@@ -249,6 +296,9 @@ int main(int argc, char *argv[])
igt_require(has_runtime_pm);
igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
igt_display_require(&data.display, data.drm_fd);
+ setup_pmc();
+ igt_info("Initial PC state residencies before test\n");
+ pmc_dump_file(pmc_debugfs, "package_cstate_show");
}
igt_subtest("dc5-psr") {
@@ -278,7 +328,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