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 v3 2/3] tests/intel/kms_psr2_sf: Check pipe and output validity for Selective Fetch test
Date: Thu,  5 Feb 2026 09:04:24 +0200	[thread overview]
Message-ID: <20260205070425.300934-3-jouni.hogander@intel.com> (raw)
In-Reply-To: <20260205070425.300934-1-jouni.hogander@intel.com>

There are some restrictions in pipe usage for PSR2/PR Selective
Fetch. Implement helper to checks these restrictions and use it to figure
out if pipe/PSR/PR combo in data_t is valid. Also check if used output
supports PSR/PR.

v3:
  - use data->devid instead of intel_get_drm_devi
  - changed IS_ALDERLAKE_S to !IS_ALDERLAKE_P
v2: rebase and commit message updated

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

diff --git a/tests/intel/kms_psr2_sf.c b/tests/intel/kms_psr2_sf.c
index 53565ada1..e537af121 100644
--- a/tests/intel/kms_psr2_sf.c
+++ b/tests/intel/kms_psr2_sf.c
@@ -1084,18 +1084,36 @@ static bool check_pr_psr2_sel_fetch_support(data_t *data)
 	return status;
 }
 
+static bool sel_fetch_pipe_combo_valid(data_t *data)
+{
+	if (data->devid < 14 && !IS_ALDERLAKE_P(data->devid) && data->pipe != PIPE_A)
+		return false;
+
+	if (data->output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP &&
+	    data->pipe != PIPE_A && data->pipe != PIPE_B)
+		return false;
+
+	return true;
+}
+
 static bool
-pipe_output_combo_valid(igt_display_t *display,
-			enum pipe pipe, igt_output_t *output)
+pipe_output_combo_valid(data_t *data)
 {
-	bool ret = true;
+	bool ret = psr_sink_support(data->drm_fd, data->debugfs_fd,
+				    data->psr_mode, data->output);
+	if (!ret)
+		return ret;
+
+	ret = sel_fetch_pipe_combo_valid(data);
+	if (!ret)
+		return ret;
 
-	igt_display_reset(display);
+	igt_display_reset(&data->display);
 
-	igt_output_set_crtc(output, igt_crtc_for_pipe(output->display, pipe));
-	if (!intel_pipe_output_combo_valid(display))
+	igt_output_set_crtc(data->output, igt_crtc_for_pipe(&data->display, data->pipe));
+	if (!intel_pipe_output_combo_valid(&data->display))
 		ret = false;
-	igt_output_set_crtc(output, NULL);
+	igt_output_set_crtc(data->output, NULL);
 
 	return ret;
 }
@@ -1268,11 +1286,12 @@ int igt_main()
 						   append_psr_subtest[z],
 						   op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i], outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					if (!pipe_output_combo_valid(&data))
+						continue;
+
 					igt_assert_f(set_sel_fetch_mode_for_output(&data),
 						     "Selective fetch is not supported\n");
 
@@ -1294,11 +1313,12 @@ int igt_main()
 							   append_psr_subtest[z],
 							   op_str(data.op)) {
 					for (i = 0; i < n_pipes; i++) {
-						if (!pipe_output_combo_valid(&data.display,
-									     pipes[i], outputs[i]))
-							continue;
 						data.pipe = pipes[i];
 						data.output = outputs[i];
+
+						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]))
@@ -1319,12 +1339,12 @@ int igt_main()
 						   append_psr_subtest[z],
 						   op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1341,12 +1361,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%scursor-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1363,12 +1383,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%scursor-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1385,12 +1405,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%scursor-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1407,12 +1427,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%scursor-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1430,12 +1450,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%s%s-sf-dmg-area", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1451,12 +1471,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%soverlay-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1473,12 +1493,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%soverlay-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1495,11 +1515,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%soverlay-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display, pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1517,12 +1538,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%s%s-sf-dmg-area", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
@@ -1542,12 +1563,12 @@ int igt_main()
 			igt_subtest_with_dynamic_f("%s%soverlay-%s-sf", append_fbc_subtest[y],
 						   append_psr_subtest[z], op_str(data.op)) {
 				for (i = 0; i < n_pipes; i++) {
-					if (!pipe_output_combo_valid(&data.display,
-								     pipes[i],
-								     outputs[i]))
-						continue;
 					data.pipe = pipes[i];
 					data.output = outputs[i];
+
+					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]))
-- 
2.43.0


  parent reply	other threads:[~2026-02-05  7:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  7:04 [PATCH i-g-t v3 0/3] Run PSR2 and PR tests on panel supporting both Jouni Högander
2026-02-05  7:04 ` [PATCH i-g-t v3 1/3] tests/intel/kms_psr2_sf: Drop Early Transport flag from data_t Jouni Högander
2026-02-05  7:04 ` Jouni Högander [this message]
2026-02-06  5:58   ` [i-g-t,v3,2/3] tests/intel/kms_psr2_sf: Check pipe and output validity for Selective Fetch test Joshi, Kunal1
2026-02-06  6:38     ` Hogander, Jouni
2026-02-05  7:04 ` [PATCH i-g-t v3 3/3] tests/kms_psr2_sf: Allow testing of both PSR2 and Panel Replay if supported Jouni Högander
2026-02-05  8:06 ` ✓ Xe.CI.BAT: success for Run PSR2 and PR tests on panel supporting both (rev3) Patchwork
2026-02-05  8:36 ` ✓ i915.CI.BAT: " Patchwork
2026-02-05 23:20 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-06  2:48 ` ✗ 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=20260205070425.300934-3-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