Skip to contentSkip to conversation

Fix PSR handling for multi-eDP systems

PATCH New Jeevan B 1 participant 4 messages Mar 23

lore
Share & tools
lore

Jeevan B

author
#0 lore raw

cover Fix PSR handling for multi-eDP systems

PSR handling in a few tests currently relies on global checks by passing NULL to PSR helper functions. This works on single eDP systems, but breaks on platforms with multiple eDP panels where PSR capability can differ per output.

Jeevan B (3):
tests/intel/kms_fbc_dirty_rect: Avoid unnecessary PSR disable tests/kms_vrr: Avoid unnecessary PSR disable tests/intel/kms_psr_stress_test: Select PSR-capable output

 tests/intel/kms_fbc_dirty_rect.c  |  6 +++---
 tests/intel/kms_psr_stress_test.c | 16 +++++++++-------
 tests/kms_vrr.c                   |  6 +++---
 3 files changed, 15 insertions(+), 13 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 1/3 tests/intel/kms_fbc_dirty_rect: Avoid unnecessary PSR disable

Pass output to psr_sink_support so PSR is disabled only when the sink supports it. Using NULL performs a global check, which is unnecessary and can be incorrect on multi-eDP systems.

---
 tests/intel/kms_fbc_dirty_rect.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/intel/kms_fbc_dirty_rect.c +3 -3
index efbd46985..e7634dbab 100644
@@ -414,9 +414,9 @@ static bool prepare_test(data_t *data)
 	igt_require_f(intel_fbc_supported(data->crtc),
 		      "FBC not supported by the chipset on pipe\n");
 
-	if (psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_1, NULL) ||
-	    psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_2, NULL) ||
-	    psr_sink_support(data->drm_fd, data->debugfs_fd, PR_MODE, NULL)) {
+	if (psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_1, data->output) ||
+	    psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_2, data->output) ||
+	    psr_sink_support(data->drm_fd, data->debugfs_fd, PR_MODE, data->output)) {
 		igt_info("PSR is supported by the sink. Disabling PSR to test Dirty FBC functionality.\n");
 		psr_disable(data->drm_fd, data->debugfs_fd, data->output);
 	}
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 2/3 tests/kms_vrr: Avoid unnecessary PSR disable

In reply to Jeevan B

Use output instead of NULL in PSR helpers so PSR is disabled only when supported by the sink, avoiding unnecessary global checks and ensuring correct behavior on multi-eDP setups.

---
 tests/kms_vrr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/kms_vrr.c +3 -3
index ec0692b2f..ec17366c8 100644
@@ -912,9 +912,9 @@ test_lobf(data_t *data, igt_crtc_t *crtc, igt_output_t *output,
 			igt_skip("%s: Aux-less ALPM not enabled, LOBF not supported.\n",
 				 igt_output_name(output));
 
-		if (psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_1, NULL) ||
-		    psr_sink_support(data->drm_fd, data->debugfs_fd, PR_MODE, NULL))
-			psr_disable(data->drm_fd, data->debugfs_fd, NULL);
+		if (psr_sink_support(data->drm_fd, data->debugfs_fd, PSR_MODE_1, output) ||
+		    psr_sink_support(data->drm_fd, data->debugfs_fd, PR_MODE, output))
+			psr_disable(data->drm_fd, data->debugfs_fd, output);
 	}
 
 	igt_info("LOBF test execution on %s, PIPE %s with VRR range: (%u-%u) Hz\n",
Signature · 1 line
2.43.0
author
#3 lore raw

PATCH 3/3 tests/intel/kms_psr_stress_test: Select PSR-capable output

In reply to Jeevan B

Iterate over all eDP outputs and select one that supports PSR instead of picking the first available eDP. Skip the test only if no PSR-capable output is found.

Previously, the test relied on a global PSR capability check and could select an eDP panel without PSR support on systems with multiple eDPs. This could lead to incorrect behavior. this ensures the test runs only on a valid PSR sink and avoids unnecessary failures on multi-eDP systems.

---
 tests/intel/kms_psr_stress_test.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
tests/intel/kms_psr_stress_test.c +9 -7
index 09e73bd49..7ef076e1c 100644
@@ -84,6 +84,7 @@ static void setup_output(data_t *data)
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	igt_crtc_t *crtc;
+	bool found = false;
 
 	igt_display_require(&data->display, data->drm_fd);
 
@@ -93,6 +94,10 @@ static void setup_output(data_t *data)
 		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
 			continue;
 
+		if (!psr_sink_support(data->drm_fd, data->debugfs_fd,
+				      PSR_MODE_1, output))
+			continue;
+
 		igt_display_reset(display);
 		igt_output_set_crtc(output,
 				    crtc);
@@ -103,11 +108,12 @@ static void setup_output(data_t *data)
 
 		data->output = output;
 		data->mode = igt_output_get_mode(output);
+		found = true;
 
 		return;
 	}
 
-	igt_require(data->output);
+	igt_require_f(found, "No eDP output with PSR support found\n");
 }
 
 static void primary_draw(data_t *data, struct igt_fb *fb, uint8_t i)
@@ -232,7 +238,7 @@ static void prepare(data_t *data)
 	r = timerfd_settime(data->completed_timerfd, 0, &interval, NULL);
 	igt_require_f(r != -1, "Error setting completed_timerfd\n");
 
-	data->initial_state = psr_get_mode(data->debugfs_fd, NULL);
+	data->initial_state = psr_get_mode(data->debugfs_fd, data->output);
 	igt_require(data->initial_state != PSR_DISABLED);
 	igt_require(psr_wait_entry(data->debugfs_fd, data->initial_state, data->output));
 }
@@ -345,7 +351,7 @@ static void run(data_t *data)
 	}
 
 	/* Check if after all this stress the PSR is still in the same state */
-	igt_assert(psr_get_mode(data->debugfs_fd, NULL) == data->initial_state);
+	igt_assert(psr_get_mode(data->debugfs_fd, data->output) == data->initial_state);
 	psr_sink_error_check(data->debugfs_fd, data->initial_state, data->output);
 }
 
@@ -359,10 +365,6 @@ int igt_main()
 		data.bops = buf_ops_create(data.drm_fd);
 		kmstest_set_vt_graphics_mode();
 
-		igt_require_f(psr_sink_support(data.drm_fd, data.debugfs_fd,
-					       PSR_MODE_1, NULL),
-			      "Sink does not support PSR\n");
-
 		setup_output(&data);
 
 		data.invalidate_timerfd = timerfd_create(CLOCK_MONOTONIC, 0);
Signature · 1 line
2.43.0