Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/kms_pm_dc: Ensure eDP detection before skipping test
@ 2025-02-06 15:59 Jeevan B
  2025-02-06 21:27 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Jeevan B @ 2025-02-06 15:59 UTC (permalink / raw)
  To: igt-dev; +Cc: Jeevan B

Ensure all outputs are checked before skipping the test, preventing
premature exits when an eDP is available later.

Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/intel/kms_pm_dc.c | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 9551cc6b9..aaf057b68 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -640,30 +640,39 @@ static void test_deep_pkgc_state(data_t *data)
 	time_t delay;
 	enum pipe pipe;
 	bool pkgc_flag = false;
-	bool flip = true;
+	bool flip = true, edp_found = false;
 
 	igt_display_t *display = &data->display;
 	igt_plane_t *primary;
 	igt_output_t *output = NULL;
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
-		if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_eDP)
-			igt_skip("No eDP output found, skipping the test.\n");
-		/* Check VRR capabilities before setting up */
-		if (igt_output_has_prop(output, IGT_CONNECTOR_VRR_CAPABLE) &&
-		    igt_output_get_prop(output, IGT_CONNECTOR_VRR_CAPABLE)) {
-			/*
-			 * TODO: Add check for vmin = vmax = flipline if VRR enabled
-			 * when KMD allows for such capability.
-			 */
-			igt_pipe_set_prop_value(display, pipe,
-						IGT_CRTC_VRR_ENABLED, false);
-			igt_assert(igt_display_try_commit_atomic(display,
-								 DRM_MODE_ATOMIC_ALLOW_MODESET,
-								 NULL) == 0);
+		if (output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+			edp_found = true;
 			break;
 		}
 	}
+
+	igt_require_f(edp_found, "No eDP output found, skipping the test.\n");
+
+	for_each_pipe_with_valid_output(display, pipe, output) {
+		if (output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+			/* Check VRR capabilities before setting up */
+			if (igt_output_has_prop(output, IGT_CONNECTOR_VRR_CAPABLE) &&
+			    igt_output_get_prop(output, IGT_CONNECTOR_VRR_CAPABLE)) {
+				/*
+				 * TODO: Add check for vmin = vmax = flipline if VRR enabled
+				 * when KMD allows for such capability.
+				 */
+				igt_pipe_set_prop_value(display, pipe,
+							IGT_CRTC_VRR_ENABLED, false);
+				igt_assert(igt_display_try_commit_atomic(display,
+									 DRM_MODE_ATOMIC_ALLOW_MODESET,
+									 NULL) == 0);
+				break;
+			}
+		}
+	}
 	igt_display_reset(display);
 
 	igt_output_set_pipe(output, pipe);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH i-g-t] tests/intel/kms_pm_dc: Ensure eDP detection before skipping test
@ 2025-02-10 10:36 Jeevan B
  2025-02-18 10:12 ` Sharma, Swati2
  0 siblings, 1 reply; 12+ messages in thread
From: Jeevan B @ 2025-02-10 10:36 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, Jeevan B

Ensure all outputs are checked before skipping the test, preventing
premature exits when an eDP is available later.

v2: Optimized eDP detection by merging loops.

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

diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 9551cc6b9..bbb29d7d9 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -640,30 +640,38 @@ static void test_deep_pkgc_state(data_t *data)
 	time_t delay;
 	enum pipe pipe;
 	bool pkgc_flag = false;
-	bool flip = true;
+	bool flip = true, edp_found = false;
 
 	igt_display_t *display = &data->display;
 	igt_plane_t *primary;
 	igt_output_t *output = NULL;
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
-		if (output->config.connector->connector_type != DRM_MODE_CONNECTOR_eDP)
-			igt_skip("No eDP output found, skipping the test.\n");
-		/* Check VRR capabilities before setting up */
-		if (igt_output_has_prop(output, IGT_CONNECTOR_VRR_CAPABLE) &&
-		    igt_output_get_prop(output, IGT_CONNECTOR_VRR_CAPABLE)) {
-			/*
-			 * TODO: Add check for vmin = vmax = flipline if VRR enabled
-			 * when KMD allows for such capability.
-			 */
-			igt_pipe_set_prop_value(display, pipe,
-						IGT_CRTC_VRR_ENABLED, false);
-			igt_assert(igt_display_try_commit_atomic(display,
-								 DRM_MODE_ATOMIC_ALLOW_MODESET,
-								 NULL) == 0);
-			break;
+		if (output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+
+			edp_found = true;
+			/* Check VRR capabilities before setting up */
+			if (igt_output_has_prop(output, IGT_CONNECTOR_VRR_CAPABLE) &&
+			    igt_output_get_prop(output, IGT_CONNECTOR_VRR_CAPABLE)) {
+				/*
+				 * TODO: Add check for vmin = vmax = flipline if VRR enabled
+				 * when KMD allows for such capability.
+				 */
+				igt_pipe_set_prop_value(display, pipe,
+							IGT_CRTC_VRR_ENABLED, false);
+				igt_assert(igt_display_try_commit_atomic(display,
+									 DRM_MODE_ATOMIC_ALLOW_MODESET,
+									 NULL) == 0);
+			}
+		break;
 		}
 	}
+
+	if (!edp_found) {
+		igt_skip("No eDP output found, skipping the test.\n");
+		return;
+	}
+
 	igt_display_reset(display);
 
 	igt_output_set_pipe(output, pipe);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-02-18 10:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 15:59 [PATCH i-g-t] tests/intel/kms_pm_dc: Ensure eDP detection before skipping test Jeevan B
2025-02-06 21:27 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-02-07  2:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-07  4:35 ` [PATCH i-g-t] " Samala, Pranay
2025-02-07  5:03   ` B, Jeevan
2025-02-07 14:54 ` ✓ i915.CI.BAT: success for " Patchwork
2025-02-07 14:55 ` [PATCH i-g-t] " Sharma, Swati2
2025-02-07 15:27 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-02-07 23:14 ` ✗ i915.CI.Full: failure " Patchwork
2025-02-08  0:06 ` ✗ Xe.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-02-10 10:36 [PATCH i-g-t] " Jeevan B
2025-02-18 10:12 ` Sharma, Swati2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox