Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] tests/i915/kms_psr2_su: Convert tests to dynamic
Date: Thu,  8 Sep 2022 18:44:16 +0530	[thread overview]
Message-ID: <20220908131417.17308-2-jeevan.b@intel.com> (raw)
In-Reply-To: <20220908131417.17308-1-jeevan.b@intel.com>

Converting the existing subtests to dynamic subtests.
Adding support for each_pipe, currently PSR2 is supported on
PIPE_A so breaking the loop for other pipes currently.

v2: Add commit message and change break to continue. (Jouni)
v3: Check for pipe supporting PSR2 or not and then add to dynamic subtest. (Jouni)

Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/i915/kms_psr2_su.c | 63 +++++++++++++++++++++++++---------------
 1 file changed, 40 insertions(+), 23 deletions(-)

diff --git a/tests/i915/kms_psr2_su.c b/tests/i915/kms_psr2_su.c
index caccf713..f63f1483 100644
--- a/tests/i915/kms_psr2_su.c
+++ b/tests/i915/kms_psr2_su.c
@@ -260,13 +260,30 @@ static void cleanup(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->fb[0]);
 }
 
+static int check_psr2_support(data_t *data, enum pipe pipe, int x)
+{
+	igt_output_t *output;
+	igt_display_t *display = &data->display;
+
+	igt_display_reset(display);
+	output = data->output;
+	igt_output_set_pipe(output, pipe);
+
+	prepare(data);
+	x = psr_wait_entry(data->debugfs_fd, PSR_MODE_2);
+	cleanup(data);
+
+	return x;
+}
+
 igt_main
 {
 	data_t data = {};
+	enum pipe pipe;
+	int r;
 
 	igt_fixture {
 		struct itimerspec interval;
-		int r;
 
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
@@ -287,12 +304,6 @@ igt_main
 			      "Error enabling PSR2\n");
 		data.op = FRONTBUFFER;
 		data.format = DRM_FORMAT_XRGB8888;
-		prepare(&data);
-		r = psr_wait_entry(data.debugfs_fd, PSR_MODE_2);
-		cleanup(&data);
-		if (!r)
-			psr_print_debugfs(data.debugfs_fd);
-		igt_require_f(r, "PSR2 can not be enabled\n");
 
 		/* blocking timerfd */
 		data.change_screen_timerfd = timerfd_create(CLOCK_MONOTONIC, 0);
@@ -312,23 +323,29 @@ igt_main
 		while (*format != DRM_FORMAT_INVALID) {
 			data.format = *format++;
 			igt_describe("Test that selective update works when screen changes");
-			igt_subtest_f("%s-%s", op_str(data.op), igt_format_str(data.format)) {
-				if (data.op == FRONTBUFFER &&
-				    intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 12) {
-					/*
-					 * FIXME: Display 12+ platforms now have PSR2
-					 * selective fetch enabled by default but we
-					 * still can't properly handle frontbuffer
-					 * rendering, so right it does full frame
-					 * fetches at every frontbuffer rendering.
-					 * So it is expected that this test will fail
-					 * in display 12+ platform for now.
-					 */
-					igt_skip("PSR2 selective fetch is doing full frame fetches for frontbuffer rendering\n");
+			igt_subtest_with_dynamic_f("%s-%s", op_str(data.op), igt_format_str(data.format)) {
+				for_each_pipe_with_valid_output(&data.display, pipe, data.output) {
+					if (check_psr2_support(&data, pipe, r)) {
+						igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
+							if (data.op == FRONTBUFFER &&
+							    intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 12) {
+								/*
+								 * FIXME: Display 12+ platforms now have PSR2
+								 * selective fetch enabled by default but we
+								 * still can't properly handle frontbuffer
+								 * rendering, so right it does full frame
+								 * fetches at every frontbuffer rendering.
+								 * So it is expected that this test will fail
+								 * in display 12+ platform for now.
+								 */
+								igt_skip("PSR2 selective fetch is doing full frame fetches for frontbuffer rendering\n");
+							}
+							prepare(&data);
+							run(&data);
+							cleanup(&data);
+						}
+					}
 				}
-				prepare(&data);
-				run(&data);
-				cleanup(&data);
 			}
 		}
 	}
-- 
2.36.0

  reply	other threads:[~2022-09-08 13:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 13:14 [igt-dev] [PATCH i-g-t 0/2] Convert PSR2 sf & su test to dynamic Jeevan B
2022-09-08 13:14 ` Jeevan B [this message]
2022-09-09 11:23   ` [igt-dev] [PATCH i-g-t 1/2] tests/i915/kms_psr2_su: Convert tests " Hogander, Jouni
2022-09-08 13:14 ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/kms_psr2_sf: " Jeevan B
2022-09-09 11:36   ` Hogander, Jouni
2022-09-13 20:42     ` B, Jeevan
2022-09-14  6:19       ` Hogander, Jouni
2022-09-14  7:12   ` Hogander, Jouni
2022-09-14  8:18     ` Petri Latvala
2022-09-08 13:55 ` [igt-dev] ✓ Fi.CI.BAT: success for Convert PSR2 sf & su test " Patchwork
2022-09-08 18:20 ` [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=20220908131417.17308-2-jeevan.b@intel.com \
    --to=jeevan.b@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox