All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [CI 1/2] tests/kms_psr_sink_crc: Do not test sink crc
@ 2018-07-03 23:29 Dhinakaran Pandiyan
  2018-07-03 23:29 ` [igt-dev] [CI 2/2] tests/kms_psr_sink_crc: Test PSR source HW status Dhinakaran Pandiyan
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Dhinakaran Pandiyan @ 2018-07-03 23:29 UTC (permalink / raw)
  To: igt-dev; +Cc: Dhinakaran Pandiyan

eDP sink crc reads use vblank interrupts that cause PSR exit and
therefore makes them unsuitable for PSR testing.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 tests/kms_psr_sink_crc.c | 56 ++++++++----------------------------------------
 1 file changed, 9 insertions(+), 47 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 28818e25..d36be7dd 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -28,12 +28,8 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
-
 #include "intel_bufmgr.h"
 
-#define CRC_BLACK "000000000000"
-#define CRC_LEN 12
-
 enum operations {
 	PAGE_FLIP,
 	MMAP_GTT,
@@ -220,36 +216,9 @@ static bool wait_psr_entry(data_t *data)
 	return false;
 }
 
-static void get_sink_crc(data_t *data, char *crc)
-{
-	if (igt_interactive_debug)
-		return;
-
-	igt_require_f(igt_sysfs_read(data->debugfs_fd, "i915_sink_crc_eDP1",
-				     crc, CRC_LEN) == CRC_LEN,
-		      "Sink CRC is unreliable on this machine. Try manual debug with --interactive-debug=no-crc\n");
-	igt_debug("sink CRC: %.*s\n", CRC_LEN, crc);
-
-	/* Black screen is always invalid */
-	igt_assert(strncmp(crc, CRC_BLACK, CRC_LEN));
-}
-
-static bool is_green(char *crc)
-{
-	const char *mask = "0000FFFF0000";
-	uint32_t *p = (uint32_t *)crc, *mask_p = (uint32_t *)mask;
-	if (igt_interactive_debug)
-		return false;
-
-	/* Check R and B components are 0 and G is non-zero */
-	return *p == *mask_p && *(p + 2) == *(mask_p + 2) &&
-	       (*(p + 1) & *(mask_p + 1)) != 0;
-}
-
-static void assert_or_manual(bool condition, const char *expected)
+static inline void manual(const char *expected)
 {
-	igt_debug_manual_check("no-crc", expected);
-	igt_assert(igt_interactive_debug || condition);
+	igt_debug_manual_check("all", expected);
 }
 
 static bool drrs_disabled(data_t *data)
@@ -266,18 +235,14 @@ static void run_test(data_t *data)
 	uint32_t handle = data->fb_white.gem_handle;
 	igt_plane_t *test_plane = data->test_plane;
 	void *ptr;
-	char ref_crc[CRC_LEN];
-	char crc[CRC_LEN];
 	const char *expected = "";
 
 	/* Confirm that screen became Green */
-	get_sink_crc(data, ref_crc);
-	assert_or_manual(is_green(ref_crc), "screen GREEN");
+	manual("screen GREEN");
 
 	/* Confirm screen stays Green after PSR got active */
 	igt_assert(wait_psr_entry(data));
-	get_sink_crc(data, ref_crc);
-	assert_or_manual(is_green(ref_crc), "screen GREEN");
+	manual("screen GREEN");
 
 	/* Setting a secondary fb/plane */
 	igt_plane_set_fb(test_plane, &data->fb_white);
@@ -285,19 +250,17 @@ static void run_test(data_t *data)
 
 	/* Confirm it is not Green anymore */
 	igt_assert(wait_psr_entry(data));
-	get_sink_crc(data, ref_crc);
 	if (test_plane->type == DRM_PLANE_TYPE_PRIMARY)
-		assert_or_manual(!is_green(ref_crc), "screen WHITE");
+		manual("screen WHITE");
 	else
-		assert_or_manual(!is_green(ref_crc), "GREEN background with WHITE box");
+		manual("GREEN background with WHITE box");
 
 	switch (data->op) {
 	case PAGE_FLIP:
 		/* Only in use when testing primary plane */
 		igt_assert(drmModePageFlip(data->drm_fd, data->crtc_id,
 					   data->fb_green.fb_id, 0, NULL) == 0);
-		get_sink_crc(data, crc);
-		assert_or_manual(is_green(crc), "screen GREEN");
+		manual("screen GREEN");
 		expected = "still GREEN";
 		break;
 	case MMAP_GTT:
@@ -340,8 +303,7 @@ static void run_test(data_t *data)
 		expected = "screen GREEN";
 		break;
 	}
-	get_sink_crc(data, crc);
-	assert_or_manual(strncmp(ref_crc, crc, CRC_LEN) != 0, expected);
+	manual(expected);
 }
 
 static void test_cleanup(data_t *data) {
@@ -442,7 +404,7 @@ static int opt_handler(int opt, int opt_index, void *_data)
 int main(int argc, char *argv[])
 {
 	const char *help_str =
-	       "  --no-psr\tRun test without PSR to check the CRC test logic.";
+	       "  --no-psr\tRun test without PSR.";
 	static struct option long_options[] = {
 		{"no-psr", 0, 0, 'n'},
 		{ 0, 0, 0, 0 }
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-07-04  5:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03 23:29 [igt-dev] [CI 1/2] tests/kms_psr_sink_crc: Do not test sink crc Dhinakaran Pandiyan
2018-07-03 23:29 ` [igt-dev] [CI 2/2] tests/kms_psr_sink_crc: Test PSR source HW status Dhinakaran Pandiyan
2018-07-04  0:29   ` [igt-dev] [CI v2 " Dhinakaran Pandiyan
2018-07-04  0:05 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/2] tests/kms_psr_sink_crc: Do not test sink crc Patchwork
2018-07-04  0:54 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/2] tests/kms_psr_sink_crc: Do not test sink crc (rev2) Patchwork
2018-07-04  5:23 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [CI,1/2] tests/kms_psr_sink_crc: Do not test sink crc Patchwork
2018-07-04  5:52 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [CI,1/2] tests/kms_psr_sink_crc: Do not test sink crc (rev2) Patchwork

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.