Skip to contentSkip to conversation

tests/kms_sink_crc_basic: Basic test to verify Sink CRC debugfs.

PATCH New Rodrigo Vivi 2 participants 7 messages Jan 23, 2014 – Feb 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tests/kms_sink_crc_basic: Basic test to verify Sink CRC debugfs.

---
 tests/Android.mk           |   1 +
 tests/Makefile.sources     |   1 +
 tests/kms_sink_crc_basic.c | 201 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 203 insertions(+)
 create mode 100644 tests/kms_sink_crc_basic.c
tests/Android.mk +1 -0
index c65f94c..fa9e9d7 100644
@@ -98,6 +98,7 @@ skip_tests_list := \
     kms_fbc_crc \
     kms_render \
     kms_setmode \
+    kms_sink_crc_basic \
     pm_pc8 \
     gem_seqno_wrap \
     gem_render_copy \
tests/Makefile.sources +1 -0
index c586bd3..5fe68ae 100644
@@ -60,6 +60,7 @@ TESTS_progs_M = \
 	kms_pipe_crc_basic \
 	kms_render \
 	kms_setmode \
+	kms_sink_crc_basic \
 	pm_lpsp \
 	pm_pc8 \
 	prime_self_import \
tests/kms_sink_crc_basic.c new file +201 -0

201 lines not on this page · raw message

Signature · 6 lines
1.8.1.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/3 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.

v2: Wait psr enable with timeout and more subtest added.

---
 tests/Android.mk         |   1 +
 tests/Makefile.sources   |   1 +
 tests/kms_psr_sink_crc.c | 508 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 510 insertions(+)
 create mode 100644 tests/kms_psr_sink_crc.c
tests/Android.mk +1 -0
index fa9e9d7..81906be 100644
@@ -95,6 +95,7 @@ skip_tests_list := \
     kms_cursor_crc \
     kms_flip \
     kms_pipe_crc_basic \
+    kms_psr_sink_crc \
     kms_fbc_crc \
     kms_render \
     kms_setmode \
tests/Makefile.sources +1 -0
index 5fe68ae..fdb1e41 100644
@@ -58,6 +58,7 @@ TESTS_progs_M = \
 	kms_fbc_crc \
 	kms_flip \
 	kms_pipe_crc_basic \
+	kms_psr_sink_crc \
 	kms_render \
 	kms_setmode \
 	kms_sink_crc_basic \
tests/kms_psr_sink_crc.c new file +508 -0

508 lines not on this page · raw message

Signature · 6 lines
1.8.1.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 1/1 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.

v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
add Baytrail per-pipe tests.

---
 tests/Android.mk         |   1 +
 tests/Makefile.sources   |   1 +
 tests/kms_psr_sink_crc.c | 514 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 516 insertions(+)
 create mode 100644 tests/kms_psr_sink_crc.c
tests/Android.mk +1 -0
index fa9e9d7..81906be 100644
@@ -95,6 +95,7 @@ skip_tests_list := \
     kms_cursor_crc \
     kms_flip \
     kms_pipe_crc_basic \
+    kms_psr_sink_crc \
     kms_fbc_crc \
     kms_render \
     kms_setmode \
tests/Makefile.sources +1 -0
index 5fe68ae..fdb1e41 100644
@@ -58,6 +58,7 @@ TESTS_progs_M = \
 	kms_fbc_crc \
 	kms_flip \
 	kms_pipe_crc_basic \
+	kms_psr_sink_crc \
 	kms_render \
 	kms_setmode \
 	kms_sink_crc_basic \
tests/kms_psr_sink_crc.c new file +514 -0

514 lines not on this page · raw message

Signature · 6 lines
1.8.1.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 1/1 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.

v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
add Baytrail per-pipe tests.
v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need
of inactivate on set_domain, what was semantically wrong.

---
 tests/Android.mk         |   1 +
 tests/Makefile.sources   |   1 +
 tests/kms_psr_sink_crc.c | 515 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 517 insertions(+)
 create mode 100644 tests/kms_psr_sink_crc.c
tests/Android.mk +1 -0
index fa9e9d7..81906be 100644
@@ -95,6 +95,7 @@ skip_tests_list := \
     kms_cursor_crc \
     kms_flip \
     kms_pipe_crc_basic \
+    kms_psr_sink_crc \
     kms_fbc_crc \
     kms_render \
     kms_setmode \
tests/Makefile.sources +1 -0
index 5fe68ae..fdb1e41 100644
@@ -58,6 +58,7 @@ TESTS_progs_M = \
 	kms_fbc_crc \
 	kms_flip \
 	kms_pipe_crc_basic \
+	kms_psr_sink_crc \
 	kms_render \
 	kms_setmode \
 	kms_sink_crc_basic \
tests/kms_psr_sink_crc.c new file +515 -0

515 lines not on this page · raw message

Signature · 6 lines
1.8.1.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH] tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.

Quoted 5 lines · Rodrigo Vivi

v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
add Baytrail per-pipe tests.
v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need
of inactivate on set_domain, what was semantically wrong.

Like I've said in the other thread, iirc v3 is the right test. At least it's the same logic as we have in the fbc test, so if we change this we need to do some funny history digging and adjust it in both places. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw

PATCH 1/1 tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.

v2: Wait psr enable with timeout and more subtest added.
v3: Add wait for v_blank leeting test more reliable and preparing to
add Baytrail per-pipe tests.
v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need
of inactivate on set_domain, what was semantically wrong.
v5: Adding more test cases to cover mmap_gtt with and without followed by
busy ioctl and also without busy and waiting 10 seconds between set_domain and actual write.

---
 tests/Android.mk         |   1 +
 tests/Makefile.sources   |   1 +
 tests/kms_psr_sink_crc.c | 535 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 537 insertions(+)
 create mode 100644 tests/kms_psr_sink_crc.c
tests/Android.mk +1 -0
index fa9e9d7..81906be 100644
@@ -95,6 +95,7 @@ skip_tests_list := \
     kms_cursor_crc \
     kms_flip \
     kms_pipe_crc_basic \
+    kms_psr_sink_crc \
     kms_fbc_crc \
     kms_render \
     kms_setmode \
tests/Makefile.sources +1 -0
index 5fe68ae..fdb1e41 100644
@@ -58,6 +58,7 @@ TESTS_progs_M = \
 	kms_fbc_crc \
 	kms_flip \
 	kms_pipe_crc_basic \
+	kms_psr_sink_crc \
 	kms_render \
 	kms_setmode \
 	kms_sink_crc_basic \
tests/kms_psr_sink_crc.c new file +535 -0

535 lines not on this page · raw message

Signature · 6 lines
1.8.1.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 3/3 test/pm_psr: Add Baytrail simple pm_psr test.

In reply to Rodrigo Vivi

Different from core PSR implementation (i.e. Haswell and Broadwell) Baytrail PSR can be enabled even when source is ok because it provides way to inactivate PSR whenever any screen updated is done. Baytrail also doesn't provide any kind of Performance Counters.

---
 tests/pm_psr.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 97 insertions(+), 17 deletions(-)
tests/pm_psr.c +97 -17
index def8e12..d75ef9e 100644
@@ -30,21 +30,23 @@
 #include <string.h>
 #include <unistd.h>
 #include "drmtest.h"
+#include "igt_debugfs.h"
 
-#define SLEEP_DURATION 5000 // in milliseconds
+typedef struct {
+	int drm_fd;
+	igt_debugfs_t debugfs;
+	int devid;
+} data_t;
 
-static int get_perf(const char *path)
+static int get_perf(data_t *data)
 {
 	int ret, perf;
 	bool sink, source, enabled;
 	FILE *file;
 	char str[4];
 
-	file = fopen(path, "r");
-	if (file == NULL) {
-		fprintf(stderr, "Couldn't open %s (%d)\n", path, errno);
-		abort();
-	}
+	file = igt_debugfs_fopen(&data->debugfs, "i915_edp_psr_status", "r");
+	igt_require(file);
 
 	ret = fscanf(file, "Sink_Support: %s\n", str);
 	if (ret == 0)
@@ -78,23 +80,101 @@ static int get_perf(const char *path)
 	return perf;
 }
 
-igt_simple_main
+static bool psr_supported(data_t *data)
 {
-	int ret, perf1, perf2;
-	int device = drm_get_card();
-	char *path;
+	int ret;
+	FILE *file;
+	char str[4];
+	bool sink, source;
 
-	igt_skip_on_simulation();
+	file = igt_debugfs_fopen(&data->debugfs, "i915_edp_psr_status", "r");
+	igt_require(file);
+
+	ret = fscanf(file, "Sink_Support: %s\n", str);
+	if (ret == 0)
+	    igt_skip("i915_edp_psr_status format not supported by this test case\n");
+	sink = strcmp(str, "yes") == 0;
+
+	ret = fscanf(file, "Source_OK: %s\n", str);
+	igt_assert(ret != 0);
+	source = strcmp(str, "yes") == 0;
+
+	fclose(file);
+	return sink && source;
+}
+
+static bool psr_enabled(data_t *data)
+{
+	int ret;
+	FILE *file;
+	char str[4];
+
+	file = igt_debugfs_fopen(&data->debugfs, "i915_edp_psr_status", "r");
+	igt_require(file);
+
+	ret = fscanf(file, "Sink_Support: %s\n", str);
+	igt_assert(ret != 0);
+
+	ret = fscanf(file, "Source_OK: %s\n", str);
+	igt_assert(ret != 0);
+
+	ret = fscanf(file, "Enabled: %s\n", str);
+	igt_assert(ret != 0);
+
+	fclose(file);
+	return strcmp(str, "yes") == 0;
+}
+
+static bool wait_psr_entry(data_t *data, int timeout)
+{
+	while (timeout--) {
+		if (psr_enabled(data))
+			return true;
+		sleep(1);
+	}
+	return false;
+}
+
+/* Baytrail doesn't provide a performance counter for PSR */
+/* PSR on Baytrail can be disabled/inactive even when source is ok. */
+static void vlv_test(data_t *data)
+{
+	if (!psr_supported(data))
+		igt_skip("This platform or current configuration don't support PSR.\n");
 
-	ret = asprintf(&path, "/sys/kernel/debug/dri/%d/i915_edp_psr_status", device);
-	igt_assert(ret != -1);
+	if (!wait_psr_entry(data, 10)) {
+		fprintf(stderr, " Unable to enter PSR state.\n It can either be disabled by kernel parameter or it simply failed.\n Make sure there is no screen update happening on eDP, not even a small blinking cursor.\n");
+		igt_fail(1);
+	}
+}
 
-	perf1 = get_perf(path);
-	sleep(SLEEP_DURATION / 1000);
-	perf2 = get_perf(path);
+/* Haswell and Broadwell */
+static void core_test(data_t *data)
+{
+	int perf1, perf2;
+
+	perf1 = get_perf(data);
+	sleep (5);
+	perf2 = get_perf(data);
 
 	if (perf1 == perf2) {
 	    fprintf(stderr, "Unable to enter PSR state again\n");
 	    igt_fail(1);
 	}
 }
+
+igt_simple_main
+{
+	data_t data = {};
+
+	igt_skip_on_simulation();
+
+	data.drm_fd = drm_open_any();
+	data.devid = intel_get_drm_devid(data.drm_fd);
+	igt_debugfs_init(&data.debugfs);
+
+	if (IS_HASWELL(data.devid) || IS_BROADWELL(data.devid))
+		core_test(&data);
+	else if (IS_VALLEYVIEW(data.devid))
+		vlv_test(&data);
+}
Signature · 1 line
1.8.1.2