From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jyoti.r.yadav@intel.com
Subject: [igt-dev] [PATCH i-g-t 6/6] DO_NOT_MERGE: Debug patch to cover DC IGT test.
Date: Tue, 18 Jun 2019 23:26:17 +0530 [thread overview]
Message-ID: <20190618175617.22546-7-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20190618175617.22546-1-anshuman.gupta@intel.com>
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@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@kms_setmode@basic-clone-single-crtc
igt@i915_pm_backlight@basic-brightness
igt@i915_pm_rpm@basic-pci-d3-state
igt@i915_pm_rpm@basic-rte
+igt@i915_pm_dc@dc5-psr
+igt@i915_pm_dc@dc6-psr
+igt@i915_pm_dc@dc5-dpms
+igt@i915_pm_dc@dc6-dpms
igt@i915_pm_rps@basic-api
igt@prime_busy@basic-after-default
igt@prime_busy@basic-before-default
--
2.21.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-18 18:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 17:56 [igt-dev] [PATCH i-g-t 0/6] DEBUG DC states igt tests patch series Anshuman Gupta
2019-06-18 17:56 ` [igt-dev] [PATCH i-g-t 1/6] lib/igt_pm: igt lib helper routines to support DC5/6 tests Anshuman Gupta
2019-08-12 12:04 ` Imre Deak
2019-06-18 17:56 ` [igt-dev] [PATCH i-g-t 2/6] tests/i915/i915_pm_dc: Added new test to verify Display C States Anshuman Gupta
2019-06-18 17:56 ` [igt-dev] [PATCH i-g-t 3/6] tests/i915/i915_pm_dc: Added test for DC6 during PSR Anshuman Gupta
2019-06-18 17:56 ` [igt-dev] [PATCH i-g-t 4/6] tests/i915/i915_pm_dc: Added test for DC5 during DPMS Anshuman Gupta
2019-08-12 12:11 ` Imre Deak
2019-08-12 12:38 ` Gupta, Anshuman
2019-08-12 12:43 ` Imre Deak
2019-06-18 17:56 ` [igt-dev] [PATCH i-g-t 5/6] tests/i915/i915_pm_dc: Added test for DC6 " Anshuman Gupta
2019-06-18 17:56 ` Anshuman Gupta [this message]
2019-06-18 18:44 ` [igt-dev] ✓ Fi.CI.BAT: success for DEBUG DC states igt tests patch series Patchwork
-- strict thread matches above, loose matches on Subject: below --
2019-06-13 10:47 [igt-dev] [PATCH i-g-t 0/6] " Anshuman Gupta
2019-06-13 10:47 ` [igt-dev] [PATCH i-g-t 6/6] DO_NOT_MERGE: Debug patch to cover DC IGT test Anshuman Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190618175617.22546-7-anshuman.gupta@intel.com \
--to=anshuman.gupta@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jyoti.r.yadav@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox