[Intel-gfx] [PATCH i-g-t 3/8] kms_frontbuffer_tracking: Allow pipe crc or sink crc individually.

Rodrigo Vivi rodrigo.vivi at intel.com
Thu Nov 5 10:53:29 PST 2015


Sink CRC should be enough by itself to validate PSR. Also sometimes
the error might be on the CRC calculations themselves. So let's give
the flexibility to use either individually.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 tests/kms_frontbuffer_tracking.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 606d0a9..d879493 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -232,7 +232,8 @@ struct draw_pattern_info pattern4;
 /* Command line parameters. */
 struct {
 	bool check_status;
-	bool check_crc;
+	bool check_pipe_crc;
+	bool check_sink_crc;
 	bool fbc_check_compression;
 	bool fbc_check_last_action;
 	bool no_edp;
@@ -244,7 +245,8 @@ struct {
 	int shared_fb_y_offset;
 } opt = {
 	.check_status = true,
-	.check_crc = true,
+	.check_pipe_crc = true,
+	.check_sink_crc = true,
 	.fbc_check_compression = true,
 	.fbc_check_last_action = true,
 	.no_edp = false,
@@ -1578,15 +1580,17 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags)
 	int flags__ = (flags);						\
 	struct both_crcs crc_;						\
 									\
-	if (!opt.check_crc || (flags__ & DONT_ASSERT_CRC))		\
+	if (flags__ & DONT_ASSERT_CRC)					\
 		break;							\
 									\
 	collect_crcs(&crc_);						\
 	print_crc("Calculated CRC:", &crc_);				\
 									\
 	igt_assert(wanted_crc);						\
-	igt_assert_crc_equal(&crc_.pipe, &wanted_crc->pipe);		\
-	assert_sink_crc_equal(&crc_.sink, &wanted_crc->sink);		\
+	if (opt.check_pipe_crc)						\
+		igt_assert_crc_equal(&crc_.pipe, &wanted_crc->pipe);	\
+	if (opt.check_sink_crc)						\
+		assert_sink_crc_equal(&crc_.sink, &wanted_crc->sink);	\
 } while (0)
 
 #define do_status_assertions(flags_) do {				\
@@ -2926,7 +2930,16 @@ static int opt_handler(int option, int option_index, void *data)
 		opt.check_status = false;
 		break;
 	case 'c':
-		opt.check_crc = false;
+		opt.check_pipe_crc = false;
+		opt.check_sink_crc = false;
+		break;
+	case 'S':
+		opt.check_pipe_crc = false;
+		opt.check_sink_crc = true;
+		break;
+	case 'P':
+		opt.check_pipe_crc = true;
+		opt.check_sink_crc = false;
 		break;
 	case 'o':
 		opt.fbc_check_compression = false;
@@ -2974,6 +2987,8 @@ static int opt_handler(int option, int option_index, void *data)
 const char *help_str =
 "  --no-status-check           Don't check for enable/disable status\n"
 "  --no-crc-check              Don't check for CRC values\n"
+"  --sink-crc-only             Check for Sink CRC only. Don't check for Pipe CRC value\n"
+"  --pipe-crc-only             Check for Pipe CRC only. Don't check for Sink CRC value\n"
 "  --no-fbc-compression-check  Don't check for the FBC compression status\n"
 "  --no-fbc-action-check       Don't check for the FBC last action\n"
 "  --no-edp                    Don't use eDP monitors\n"
@@ -3097,6 +3112,8 @@ int main(int argc, char *argv[])
 	struct option long_options[] = {
 		{ "no-status-check",          0, 0, 's'},
 		{ "no-crc-check",             0, 0, 'c'},
+		{ "sink-crc-only",            0, 0, 'S'},
+		{ "pipe-crc-only",            0, 0, 'P'},
 		{ "no-fbc-compression-check", 0, 0, 'o'},
 		{ "no-fbc-action-check",      0, 0, 'a'},
 		{ "no-edp",                   0, 0, 'e'},
-- 
2.4.3



More information about the Intel-gfx mailing list