[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-03T06:11:03Z

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.

v2: rebase and commit message updated

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

diff --git a/tests/intel/kms_psr2_sf.c b/tests/intel/kms_psr2_sf.c
index 0eae34cbd..776068104 100644
--- a/tests/intel/kms_psr2_sf.c
+++ b/tests/intel/kms_psr2_sf.c
@@ -1084,18 +1084,37 @@ static bool check_pr_psr2_sel_fetch_support(data_t *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 &&
+ !IS_ALDERLAKE_S(intel_get_drm_devid(data->drm_fd)) && 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;
}
@@ -1265,11 +1284,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");

@@ -1291,11 +1311,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]))
@@ -1316,12 +1337,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]))
@@ -1338,12 +1359,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]))
@@ -1360,12 +1381,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]))
@@ -1382,12 +1403,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]))
@@ -1404,12 +1425,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]))
@@ -1427,12 +1448,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]))
@@ -1448,12 +1469,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]))
@@ -1470,12 +1491,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]))
@@ -1492,11 +1513,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]))
@@ -1514,12 +1536,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]))
@@ -1539,12 +1561,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