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: Thu, 13 Jun 2019 16:17:46 +0530 [thread overview]
Message-ID: <20190613104746.15756-7-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20190613104746.15756-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 | 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@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-13 10:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 10:47 [igt-dev] [PATCH i-g-t 0/6] DEBUG DC states igt tests patch series Anshuman Gupta
2019-06-13 10:47 ` [igt-dev] [PATCH i-g-t 1/6] lib/igt_pm: igt lib helper routines to support DC5/6 tests Anshuman Gupta
2019-06-13 10:47 ` [igt-dev] [PATCH i-g-t 3/6] tests/i915/i915_pm_dc: Added test for DC6 during PSR Anshuman Gupta
2019-06-13 10:47 ` [igt-dev] [PATCH i-g-t 4/6] tests/i915/i915_pm_dc: Added test for DC5 during DPMS Anshuman Gupta
2019-06-13 10:47 ` [igt-dev] [PATCH i-g-t 5/6] tests/i915/i915_pm_dc: Added test for DC6 " Anshuman Gupta
2019-06-13 10:47 ` Anshuman Gupta [this message]
2019-06-13 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for DEBUG DC states igt tests patch series Patchwork
2019-06-13 15:27 ` Gupta, Anshuman
2019-06-14 21:45 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2019-06-18 17:56 [igt-dev] [PATCH i-g-t 0/6] " Anshuman Gupta
2019-06-18 17:56 ` [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=20190613104746.15756-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