All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stylon Wang <stylon.wang@amd.com>
To: petri.latvala@intel.com, arek@hiler.eu, markyacoub@google.com,
	igt-dev@lists.freedesktop.org
Cc: Anson.Jacob@amd.com, Nicholas.Choi@amd.com
Subject: [igt-dev] [PATCH i-g-t v2 2/2] tests/amdgpu: Add suspend and DPMS subtests to ASSR test
Date: Fri, 16 Jul 2021 21:16:22 +0800	[thread overview]
Message-ID: <20210716131622.103320-3-stylon.wang@amd.com> (raw)
In-Reply-To: <20210716131622.103320-1-stylon.wang@amd.com>

Test if ASSR is correctly enabled/disabled after suspend and DPMS.

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
---
 tests/amdgpu/amd_assr.c | 42 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 4 deletions(-)

diff --git a/tests/amdgpu/amd_assr.c b/tests/amdgpu/amd_assr.c
index 066973d3..235fb315 100644
--- a/tests/amdgpu/amd_assr.c
+++ b/tests/amdgpu/amd_assr.c
@@ -40,6 +40,14 @@ typedef struct data {
 	int fd;
 } data_t;
 
+/* Test flags. */
+enum {
+	TEST_NONE = 1 << 0,
+	TEST_DPMS = 1 << 1,
+	TEST_SUSPEND = 1 << 2,
+};
+
+
 /* Common test setup. */
 static void test_init(data_t *data)
 {
@@ -184,7 +192,25 @@ static void present_visual_pattern(data_t *data, igt_output_t *output)
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 }
 
-static void test_assr(data_t *data, igt_output_t *output)
+static void test_cycle_flags(data_t *data, igt_output_t *output,
+				uint32_t test_flags)
+{
+	if (test_flags & TEST_DPMS) {
+		igt_info("Link DPMS off then on\n");
+		kmstest_set_connector_dpms(data->fd,
+					   output->config.connector,
+					   DRM_MODE_DPMS_OFF);
+		kmstest_set_connector_dpms(data->fd,
+					   output->config.connector,
+					   DRM_MODE_DPMS_ON);
+	}
+
+	if (test_flags & TEST_SUSPEND)
+		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+					      SUSPEND_TEST_NONE);
+}
+
+static void test_assr(data_t *data, igt_output_t *output, uint32_t test_flags)
 {
 	drmModeConnector *connector = output->config.connector;
 	int connector_type = connector->connector_type;
@@ -194,6 +220,8 @@ static void test_assr(data_t *data, igt_output_t *output)
 
 	igt_info("Test ASSR on link %s\n", output->name);
 
+	test_cycle_flags(data, output, test_flags);
+
 	igt_assert_f(find_aux_dev(data, output, aux_dev, sizeof(aux_dev)),
 			"Cannot find AUX device for link %s\n", output->name);
 	igt_info("Link %s aux %s\n", output->name, aux_dev);
@@ -217,7 +245,7 @@ static void test_assr(data_t *data, igt_output_t *output)
 		igt_assert(!assr_enabled);
 }
 
-static void test_assr_links(data_t *data)
+static void test_assr_links(data_t *data, uint32_t test_flags)
 {
 	for (int i = 0; i < data->display.n_outputs; ++i) {
 		igt_output_t *output = &data->display.outputs[i];
@@ -232,7 +260,7 @@ static void test_assr_links(data_t *data)
 
 		test_init(data);
 
-		test_assr(data, output);
+		test_assr(data, output, test_flags);
 
 		test_fini(data);
 	}
@@ -260,7 +288,13 @@ igt_main
 
 	igt_describe("Test ASSR on connected DP/eDP links");
 	igt_subtest("assr-links")
-		test_assr_links(&data);
+		test_assr_links(&data, TEST_NONE);
+	igt_describe("Test ASSR with DPMS ");
+	igt_subtest("assr-links-dpms")
+		test_assr_links(&data, TEST_DPMS);
+	igt_describe("Test ASSR with suspend ");
+	igt_subtest("assr-links-suspend")
+		test_assr_links(&data, TEST_SUSPEND);
 
 	igt_fixture
 	{
-- 
2.32.0

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

  parent reply	other threads:[~2021-07-16 13:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 12:00 [igt-dev] [PATCH i-g-t 0/2] New tests for ASSR Content Protection on DP/eDP Stylon Wang
2021-07-13 12:00 ` [igt-dev] [PATCH i-g-t 1/2] tests/amdgpu: New ASSR test on DP/eDP links Stylon Wang
2021-07-13 14:57   ` Mark Yacoub
2021-07-13 15:57   ` Mark Yacoub
2021-07-13 16:26   ` Mark Yacoub
2021-07-13 12:00 ` [igt-dev] [PATCH i-g-t 2/2] tests/amdgpu: Add suspend and DPMS subtests to ASSR test Stylon Wang
2021-07-13 13:20 ` [igt-dev] ✓ Fi.CI.BAT: success for New tests for ASSR Content Protection on DP/eDP Patchwork
2021-07-13 16:25 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-15 20:53 ` [igt-dev] [PATCH i-g-t 0/2] " Rodrigo Siqueira
2021-07-15 21:42   ` Vudum, Lakshminarayana
2021-07-15 21:37 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2021-07-16 13:16 ` [igt-dev] [PATCH i-g-t v2 0/2] tests/amdgpu: New ASSR test on DP/eDP links Stylon Wang
2021-07-16 13:16   ` [igt-dev] [PATCH i-g-t v2 1/2] " Stylon Wang
2021-07-16 14:58     ` Mark Yacoub
2021-07-19 12:58     ` [igt-dev] [PATCH i-g-t v3 0/2] " Stylon Wang
2021-07-19 12:58       ` [igt-dev] [PATCH i-g-t v3 1/2] tests/kms_assr: " Stylon Wang
2021-07-19 12:58       ` [igt-dev] [PATCH i-g-t v3 2/2] tests/kms_assr: Add suspend and DPMS subtests to ASSR test Stylon Wang
2021-08-25 12:24       ` [igt-dev] [PATCH i-g-t v4 0/2] New ASSR test on DP/eDP links Stylon Wang
2021-08-25 12:24         ` [igt-dev] [PATCH i-g-t v4 1/2] tests/amdgpu: " Stylon Wang
2021-08-25 12:24         ` [igt-dev] [PATCH i-g-t v4 2/2] tests/amdgpu: Add suspend and DPMS subtests to ASSR test Stylon Wang
2021-08-26 12:39         ` [igt-dev] [PATCH i-g-t v4 0/2] New ASSR test on DP/eDP links Rodrigo Siqueira
2021-07-16 13:16   ` Stylon Wang [this message]
2021-07-19 14:01 ` [igt-dev] ✓ Fi.CI.BAT: success for New tests for ASSR Content Protection on DP/eDP (rev3) Patchwork
2021-07-19 19:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-08-25 13:14 ` [igt-dev] ✓ Fi.CI.BAT: success for New tests for ASSR Content Protection on DP/eDP (rev5) Patchwork
2021-08-25 18:49 ` [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=20210716131622.103320-3-stylon.wang@amd.com \
    --to=stylon.wang@amd.com \
    --cc=Anson.Jacob@amd.com \
    --cc=Nicholas.Choi@amd.com \
    --cc=arek@hiler.eu \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=markyacoub@google.com \
    --cc=petri.latvala@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 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.