public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Jouni Högander" <jouni.hogander@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH i-g-t v2 3/3] tests/kms_psr2_sf: Allow testing of both PSR2 and Panel Replay if supported
Date: Tue,  3 Feb 2026 08:10:36 +0200	[thread overview]
Message-ID: <20260203061036.21482-4-jouni.hogander@intel.com> (raw)
In-Reply-To: <20260203061036.21482-1-jouni.hogander@intel.com>

Currently kms_psr2_sf is testing only Panel Replay even if PSR2 is
supported. Allow testing both PSR2 and Panel Replay when supported.

Also drop some complexity from fixture for detection of working
PSR. Earlier working PSR support was detected in fixture by enabling PSR
and then ensuring PSR entry happens. Now we are relying on
pipe_output_combo_valid. Earlier approach was problematic as PSR Might be
broken due to some earlier test which was run. This caused kms_psr2_sf to
not run any tests on that sink/pipe setup. Now these are supposed to be
visible as failing testcases.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 tests/intel/kms_psr2_sf.c | 153 +++++---------------------------------
 1 file changed, 20 insertions(+), 133 deletions(-)

diff --git a/tests/intel/kms_psr2_sf.c b/tests/intel/kms_psr2_sf.c
index 776068104..353ed14bf 100644
--- a/tests/intel/kms_psr2_sf.c
+++ b/tests/intel/kms_psr2_sf.c
@@ -252,36 +252,6 @@ static bool is_et_check_needed(data_t *data)
 	}
 }
 
-static bool set_sel_fetch_mode_for_output(data_t *data)
-{
-	bool supported = false;
-
-	if (psr_sink_support(data->drm_fd, data->debugfs_fd,
-						 PR_MODE_SEL_FETCH_ET, data->output)) {
-		supported = true;
-		data->psr_mode = PR_MODE_SEL_FETCH;
-	} else if (psr_sink_support(data->drm_fd, data->debugfs_fd,
-							PR_MODE_SEL_FETCH, data->output)) {
-		supported = true;
-		data->psr_mode = PR_MODE_SEL_FETCH;
-	} else if (psr_sink_support(data->drm_fd, data->debugfs_fd,
-							PSR_MODE_2_ET, data->output)) {
-		supported = true;
-		data->psr_mode = PSR_MODE_2;
-	} else	if (psr_sink_support(data->drm_fd, data->debugfs_fd,
-							  PSR_MODE_2, data->output)) {
-		supported = true;
-		data->psr_mode = PSR_MODE_2;
-	} else
-		igt_info("selective fetch not supported on output %s\n", data->output->name);
-
-	if (supported)
-		supported = psr_enable(data->drm_fd, data->debugfs_fd, data->psr_mode,
-				       data->output);
-
-	return supported;
-}
-
 static const char *op_str(enum operations op)
 {
 	static const char * const name[] = {
@@ -430,6 +400,9 @@ static void prepare(data_t *data)
 	igt_plane_t *primary, *sprite = NULL, *cursor = NULL;
 	int fb_w, fb_h, x, y, view_w, view_h;
 
+	psr_enable(data->drm_fd, data->debugfs_fd, data->psr_mode,
+		   data->output);
+
 	data->mode = igt_output_get_mode(output);
 
 	if (data->coexist_feature & FEATURE_DSC) {
@@ -1065,25 +1038,6 @@ static void cleanup(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->fb_test);
 }
 
-static bool check_pr_psr2_sel_fetch_support(data_t *data)
-{
-	bool status = false;
-
-	/* Check sink supports PR/PSR2 selective fetch */
-	if (!set_sel_fetch_mode_for_output(data))
-		return false;
-
-	/* Check if selective fetch can be enabled */
-	if (!selective_fetch_check(data->debugfs_fd, data->output))
-		igt_assert("Selective fetch is not enabled even though panel should support it\n");
-
-	prepare(data);
-	/* We enter into DEEP_SLEEP for both PSR2 and PR sel fetch */
-	status = psr_wait_entry(data->debugfs_fd, data->psr_mode, data->output);
-	cleanup(data);
-	return status;
-}
-
 static bool sel_fetch_pipe_combo_valid(data_t *data)
 {
 	if (intel_display_ver(intel_get_drm_devid(data->drm_fd)) < 14 &&
@@ -1119,14 +1073,6 @@ pipe_output_combo_valid(data_t *data)
 	return ret;
 }
 
-static bool check_psr_mode_supported(data_t *data, int psr_stat)
-{
-	if (data->psr_mode == psr_stat)
-		return true;
-	else
-		return false;
-}
-
 static void run_dynamic_test_damage_areas(data_t data, int i, int coexist_features[])
 {
 	for (int j = FEATURE_NONE; j < FEATURE_COUNT; j++) {
@@ -1248,18 +1194,25 @@ int igt_main()
 			 data.big_fb_width, data.big_fb_height);
 
 		for_each_pipe_with_valid_output(&data.display, data.pipe, data.output) {
-			coexist_features[n_pipes] = 0;
-			output_supports_pr_psr2_sel_fetch = check_pr_psr2_sel_fetch_support(&data);
-			if (output_supports_pr_psr2_sel_fetch) {
-				pipes[n_pipes] = data.pipe;
-				outputs[n_pipes] = data.output;
+			for (i = 0; i < ARRAY_SIZE(psr_status); i++) {
+				data.psr_mode = psr_status[i];
+				output_supports_pr_psr2_sel_fetch = pipe_output_combo_valid(&data);
+				if (output_supports_pr_psr2_sel_fetch)
+					break;
+			}
 
-				if (is_dsc_supported_by_sink(data.drm_fd, data.output))
-					coexist_features[n_pipes] |= FEATURE_DSC;
+			if (!output_supports_pr_psr2_sel_fetch)
+				continue;
 
-				n_pipes++;
-			}
-			pr_psr2_sel_fetch_supported |= output_supports_pr_psr2_sel_fetch;
+			pipes[n_pipes] = data.pipe;
+			outputs[n_pipes] = data.output;
+
+			coexist_features[n_pipes] = 0;
+			if (is_dsc_supported_by_sink(data.drm_fd, data.output))
+				coexist_features[n_pipes] |= FEATURE_DSC;
+
+			n_pipes++;
+			pr_psr2_sel_fetch_supported = true;
 		}
 		igt_require_f(pr_psr2_sel_fetch_supported,
 					  "No output supports selective fetch\n");
@@ -1290,12 +1243,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
 					run_dynamic_test_damage_areas(data, i, coexist_features);
 				}
@@ -1317,11 +1264,6 @@ int igt_main()
 						if (!pipe_output_combo_valid(&data))
 							continue;
 
-						igt_assert_f(set_sel_fetch_mode_for_output(&data),
-							     "Selective fetch is not supported\n");
-						if (!check_psr_mode_supported(&data, psr_status[z]))
-							continue;
-
 						data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
 						run_dynamic_test_damage_areas(data, i,
 									      coexist_features);
@@ -1343,11 +1285,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
 					run_dynamic_test_damage_areas(data, i, coexist_features);
 				}
@@ -1365,11 +1302,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1387,11 +1319,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1409,11 +1336,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1431,11 +1353,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1454,11 +1371,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					run_plane_move(data, i, coexist_features);
 				}
 			}
@@ -1475,11 +1387,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1497,11 +1404,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1519,11 +1421,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
 					run_dynamic_test(data, i, coexist_features);
 				}
@@ -1542,11 +1439,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
 					run_dynamic_test_damage_areas(data, i, coexist_features);
 				}
@@ -1567,11 +1459,6 @@ int igt_main()
 					if (!pipe_output_combo_valid(&data))
 						continue;
 
-					igt_assert_f(set_sel_fetch_mode_for_output(&data),
-						     "Selective fetch is not supported\n");
-					if (!check_psr_mode_supported(&data, psr_status[z]))
-						continue;
-
 					run_plane_update_continuous(data, i, coexist_features);
 				}
 			}
-- 
2.43.0


  parent reply	other threads:[~2026-02-03  6:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03  6:10 [PATCH i-g-t v2 0/3] Run PSR2 and PR tests on panel supporting both Jouni Högander
2026-02-03  6:10 ` [PATCH i-g-t v2 1/3] tests/intel/kms_psr2_sf: Drop Early Transport flag from data_t Jouni Högander
2026-02-04 10:24   ` [i-g-t, v2, " Joshi, Kunal1
2026-02-03  6:10 ` [PATCH i-g-t v2 2/3] tests/intel/kms_psr2_sf: Check pipe and output validity for Selective Fetch test Jouni Högander
2026-02-05  6:03   ` [i-g-t,v2,2/3] " Joshi, Kunal1
2026-02-03  6:10 ` Jouni Högander [this message]
2026-02-05  6:11   ` [i-g-t, v2, 3/3] tests/kms_psr2_sf: Allow testing of both PSR2 and Panel Replay if supported Joshi, Kunal1
2026-02-03  7:14 ` ✓ Xe.CI.BAT: success for Run PSR2 and PR tests on panel supporting both (rev2) Patchwork
2026-02-03  7:28 ` ✓ i915.CI.BAT: " Patchwork
2026-02-03 18:50 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-03 20:29 ` ✗ Xe.CI.FULL: " 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=20260203061036.21482-4-jouni.hogander@intel.com \
    --to=jouni.hogander@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