All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jigar Bhatt <jigar.bhatt@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v11] tests/i915/i915_pm_dc: Add DC9 igt test
Date: Mon, 22 Mar 2021 13:16:01 +0530	[thread overview]
Message-ID: <1616399161-26567-1-git-send-email-jigar.bhatt@intel.com> (raw)
In-Reply-To: <20210121083432.526247-1-jigar.bhatt@intel.com>

DC9 igt test validation depends on DC{5,6} counters reset.
When Display Engine enters to DC9, it resets DMC f/w and DC5/DC6 counter.
We don't have a DC9 counter unlike DC{5,6},
therefore this tests uses DC{5,6} counter reset method to validate DC9.

v11 :
- Changing title.

v10: [Anshuman]
- Revert the function name with check_dc9() only.

v9: [Anshuman]
- Change function name check_dc9() to dc9_failed().

v8: [Anshuman]
- Add support_dc6() to check whether a platform supports dc6.

v7: [Anshuman]
- Skip if no support of DC6.

v6: [Anshuman]
- assert for DC6 counter in setup_dc9_dpms.
- Move  dpms_off() to test_dc9_dpms().

Signed-off-by: Jigar Bhatt <jigar.bhatt@intel.com>
---
 tests/i915/i915_pm_dc.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index 30c6024..f5ea278 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -384,6 +384,52 @@ static void test_dc_state_dpms(data_t *data, int dc_flag)
 	cleanup_dc_dpms(data);
 }
 
+static bool support_dc6(int debugfs_fd)
+{
+       char buf[4096];
+
+       igt_debugfs_simple_read(debugfs_fd, "i915_dmc_info",
+			       buf, sizeof(buf));
+       return strstr(buf, "DC5 -> DC6 count");
+}
+
+static bool check_dc9(uint32_t debugfs_fd, int prev_dc, bool dc6_supported, int seconds)
+{
+/*
+ * Since we do not have DC9 Counter,
+ * So we rely on dc5/dc6 counter reset to check if Display Engine was in DC9.
+ */
+       return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd, CHECK_DC6) <
+		       prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) <
+		       prev_dc, seconds, 100);
+}
+
+static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported)
+{
+       setup_dc_dpms(data);
+       dpms_off(data);
+       igt_skip_on_f(!(igt_wait(dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) >
+				 prev_dc : read_dc_counter(data->debugfs_fd, CHECK_DC5) >
+				 prev_dc, 3000, 100)), "Unable to enters shallow DC states\n");
+       dpms_on(data);
+       cleanup_dc_dpms(data);
+}
+
+static void test_dc9_dpms(data_t *data)
+{
+       require_dc_counter(data->debugfs_fd, CHECK_DC5);
+       bool dc6_supported = support_dc6(data->debugfs_fd);
+
+       setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :
+		       read_dc_counter(data->debugfs_fd, CHECK_DC5), dc6_supported);
+       dpms_off(data);
+       igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
+			       read_dc_counter(data->debugfs_fd, CHECK_DC6) :
+			       read_dc_counter(data->debugfs_fd, CHECK_DC5),
+			       dc6_supported, 3000), "Not in DC9\n");
+       dpms_on(data);
+}
+
 IGT_TEST_DESCRIPTION("These tests validate Display Power DC states");
 int main(int argc, char *argv[])
 {
@@ -449,6 +495,13 @@ int main(int argc, char *argv[])
 		test_dc_state_dpms(&data, CHECK_DC6);
 	}
 
+	igt_describe("This test validates display engine entry to DC9 state");
+	igt_subtest("dc9-dpms") {
+	       igt_require_f(igt_pm_pc8_plus_residencies_enabled(data.msr_fd),
+			       "PC8+ residencies not supported\n");
+	       test_dc9_dpms(&data);
+       }
+
 	igt_fixture {
 		free(data.pwr_dmn_info);
 		close(data.debugfs_fd);
-- 
2.8.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-03-22  8:08 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  8:34 [igt-dev] [PATCH i-g-t v2] tests/i915/i915_pm_dc: Add DC9 igt test Function Jigar Bhatt
2021-01-22  8:51 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-01-22 11:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-02-01  7:38 ` [igt-dev] [PATCH i-g-t v2 0/1] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-02-01  7:38   ` [igt-dev] [PATCH i-g-t v2 1/1] " Jigar Bhatt
2021-02-02 11:25   ` [igt-dev] [PATCH i-g-t v2 0/1] " Gupta, Anshuman
2021-02-01 12:33 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev2) Patchwork
2021-02-01 16:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-02-05  9:15 ` [igt-dev] [PATCH i-g-t v3] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-02-05  9:15   ` Jigar Bhatt
2021-02-08  6:48     ` Petri Latvala
2021-02-08  7:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev3) Patchwork
2021-02-22  4:46 ` [igt-dev] [PATCH i-g-t v4] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-02-23  4:30   ` Gupta, Anshuman
2021-02-22 10:43 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev4) Patchwork
2021-02-22 13:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-01 10:07 ` [igt-dev] [PATCH i-g-t v5] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-03-02  6:14   ` Gupta, Anshuman
2021-03-02  9:10 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev5) Patchwork
2021-03-02  9:19 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2021-03-04  7:09 ` [igt-dev] [PATCH i-g-t v6] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-03-04  7:42   ` Anshuman Gupta
2021-03-04  8:54 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev6) Patchwork
2021-03-05 12:48 ` [igt-dev] [PATCH i-g-t v7] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-03-08  5:38   ` Anshuman Gupta
2021-03-05 13:40 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev7) Patchwork
2021-03-05 17:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-12 11:43 ` [igt-dev] [PATCH i-g-t v8] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-03-16  4:26   ` Anshuman Gupta
2021-03-12 12:37 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev8) Patchwork
2021-03-12 13:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-03-18  9:56 ` [igt-dev] [PATCH i-g-t v9] tests/i915/i915_pm_dc: Add DC9 igt test Jigar Bhatt
2021-03-18 11:15 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev9) Patchwork
2021-03-18 12:20 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-19  5:21 ` [igt-dev] [PATCH i-g-t v10] tests/i915/i915_pm_dc: Add DC9 igt test Function Jigar Bhatt
2021-03-19  6:02   ` Gupta, Anshuman
2021-03-19  6:24 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev10) Patchwork
2021-03-19  8:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-03-22  7:46 ` Jigar Bhatt [this message]
2021-03-22 10:25   ` [igt-dev] [PATCH i-g-t v11] tests/i915/i915_pm_dc: Add DC9 igt test Gupta, Anshuman
2021-03-23 14:54     ` Dixit, Ashutosh
2021-03-23 17:41   ` Dixit, Ashutosh
2021-03-22 10:28 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc: Add DC9 igt test Function (rev11) Patchwork
2021-03-23 10:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=1616399161-26567-1-git-send-email-jigar.bhatt@intel.com \
    --to=jigar.bhatt@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.