All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] kms_psr_sink_crc: Introduce PSR BAT test.
@ 2015-12-07 10:06 Rodrigo Vivi
  2015-12-07 10:06 ` [PATCH i-g-t 2/2] kms_psr_sink_crc: Add basic check for PSR active Rodrigo Vivi
  2015-12-08 10:44 ` [PATCH i-g-t 1/2] kms_psr_sink_crc: Introduce PSR BAT test Daniel Vetter
  0 siblings, 2 replies; 6+ messages in thread
From: Rodrigo Vivi @ 2015-12-07 10:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Rodrigo Vivi

This simple test checks if PSR is enabled when it should.
Minimal and fastest check possible.

To make it faster for BAT we first check if it is enabled and return
Success. We just do the dpms_on in case psr is not enabled. So it was
probably because display went off maybe in idle. Even for this case
the test case is fast enough: ~ 1s.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 tests/kms_psr_sink_crc.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 8cd11a7..28ba5c2 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -227,6 +227,26 @@ static bool psr_possible(data_t *data)
 	return true;
 }
 
+static bool psr_enabled(data_t *data)
+{
+	int ret;
+	FILE *file;
+	char str[4];
+
+	file = igt_debugfs_fopen("i915_edp_psr_status", "r");
+	igt_require(file);
+
+	ret = fscanf(file, "Sink_Support: %s\n", str);
+	igt_assert_neq(ret, 0);
+	ret = fscanf(file, "Source_OK: %s\n", str);
+	igt_assert_neq(ret, 0);
+	ret = fscanf(file, "Enabled: %s\n", str);
+	igt_assert_neq(ret, 0);
+
+	fclose(file);
+	return strcmp(str, "yes") == 0;
+}
+
 static bool psr_active(data_t *data)
 {
 	int ret;
@@ -569,6 +589,22 @@ int main(int argc, char *argv[])
 		display_init(&data);
 	}
 
+	igt_subtest("psr_enabled_basic") {
+		if (psr_enabled(&data))
+			igt_success();
+		else {
+			/*
+			 * The only excuse to have PSR disabled at this point
+			 * is if dpms is off for some reason. So let's try to
+			 * force dpms on and check if that was the case.
+			 */
+			kmstest_set_connector_dpms(data.drm_fd,
+						   data.output->config.connector,
+						   DRM_MODE_DPMS_ON);
+			igt_assert(psr_enabled(&data));
+		}
+	}
+
 	for (op = PAGE_FLIP; op <= RENDER; op++) {
 		igt_subtest_f("primary_%s", op_str(op)) {
 			data.test_plane = PRIMARY;
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-12-10  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 10:06 [PATCH i-g-t 1/2] kms_psr_sink_crc: Introduce PSR BAT test Rodrigo Vivi
2015-12-07 10:06 ` [PATCH i-g-t 2/2] kms_psr_sink_crc: Add basic check for PSR active Rodrigo Vivi
2015-12-08 10:45   ` Daniel Vetter
2015-12-08 15:32     ` Rodrigo Vivi
2015-12-10  9:39       ` Daniel Vetter
2015-12-08 10:44 ` [PATCH i-g-t 1/2] kms_psr_sink_crc: Introduce PSR BAT test Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.