Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/kms_pm_dc: Add DC5 retention flops test
@ 2023-03-27 18:12 Mohammed Thasleem
  2024-10-09 10:22 ` Luca Coelho
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mohammed Thasleem @ 2023-03-27 18:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Mohammed Thasleem

This test validates the display engine entry to DC5 state while
eDP PSR is active on Pipe B from display version 30 onwards.

Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
---
 tests/intel/kms_pm_dc.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 541e94cb5..820a9dec3 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -80,6 +80,10 @@
  * SUBTEST: deep-pkgc
  * Description: This test validates display engine entry to PKGC10 state for extended vblank
  * Functionality: pm_dc
+ *
+ * SUBTEST: dc5-retention-flops
+ * Description: This test validates display engine entry to DC5 state while PSR is active on Pipe B
+ * Functionality: pm_dc
  */
 
 /* DC State Flags */
@@ -122,6 +126,31 @@ typedef struct {
 static bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count);
 static void check_dc_counter(data_t *data, int dc_flag, uint32_t prev_dc_count);
 
+static void set_output_on_pipe_b(data_t *data)
+{
+	igt_display_t *display = &data->display;
+	igt_output_t *output;
+	enum pipe pipe;
+
+	for_each_pipe_with_valid_output(display, pipe, output) {
+		drmModeConnectorPtr c = output->config.connector;
+
+		/* DC5 with PIPE_B transaction */
+		if (pipe != PIPE_B)
+			continue;
+
+		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
+			continue;
+
+		igt_output_set_pipe(output, pipe);
+		if (!intel_pipe_output_combo_valid(display))
+			continue;
+
+		data->output = output;
+		data->mode = igt_output_get_mode(output);
+	}
+}
+
 static void setup_output(data_t *data)
 {
 	igt_display_t *display = &data->display;
@@ -396,6 +425,19 @@ static void psr_dpms(data_t *data, int mode)
 	}
 }
 
+static void test_dc5_retention_flops(data_t *data, int dc_flag)
+{
+	uint32_t dc_counter_before_psr;
+
+	require_dc_counter(data->debugfs_fd, dc_flag);
+	dc_counter_before_psr = read_dc_counter(data->debugfs_fd, dc_flag);
+	set_output_on_pipe_b(data);
+	setup_primary(data);
+	igt_assert(psr_wait_entry(data->debugfs_fd, data->op_psr_mode, NULL));
+	check_dc_counter(data, dc_flag, dc_counter_before_psr);
+	cleanup_dc_psr(data);
+}
+
 static void test_dc_state_psr(data_t *data, int dc_flag)
 {
 	uint32_t dc_counter_before_psr;
@@ -784,6 +826,19 @@ igt_main
 		test_dc_state_dpms(&data, CHECK_DC5);
 	}
 
+	igt_describe("This test validates display engine entry to DC5 state "
+		     "while PSR is active on Pipe B");
+	igt_subtest("dc5-retention-flops") {
+		igt_require_f(intel_display_ver(data.devid) >= 30,
+			      "Test not supported on this platform.\n");
+		igt_require(psr_sink_support(data.drm_fd, data.debugfs_fd,
+					     PSR_MODE_1, NULL));
+		data.op_psr_mode = PSR_MODE_1;
+		psr_enable(data.drm_fd, data.debugfs_fd, data.op_psr_mode, NULL);
+		igt_require(!psr_disabled_check(data.debugfs_fd));
+		test_dc5_retention_flops(&data, CHECK_DC5);
+	}
+
 	igt_describe("This test validates negative scenario of DC5 display "
 		     "engine entry to DC5 state while all connectors's DPMS "
 		     "property set to ON");
-- 
2.25.1


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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27 18:12 [PATCH i-g-t] tests/intel/kms_pm_dc: Add DC5 retention flops test Mohammed Thasleem
2024-10-09 10:22 ` Luca Coelho
2024-10-09 11:06 ` ✓ CI.xeBAT: success for " Patchwork
2024-10-09 11:21 ` ✓ Fi.CI.BAT: " Patchwork
2024-10-09 16:41 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-10 13:10 ` ✗ Fi.CI.IGT: " Patchwork

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