public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Daniel Vetter <daniel@ffwll.ch>
Subject: [igt-dev] [PATCH i-g-t 1/2] tests/kms_plane: Keep testing pixel formats even if one fails
Date: Mon, 11 Mar 2019 15:32:21 +0200	[thread overview]
Message-ID: <20190311133222.10030-1-arkadiusz.hiler@intel.com> (raw)

In the pixel-format-pipe-*-planes* family of subtests currently we exit
early if there is any CRC mismatch, leaving all the remaining formats
untested.

Let's fix that by moving the assert till after all the iterations.

Also log each mismatch with its context in a single line so that it's
easy to look for.

Cc: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/kms_plane.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 91de4694..4cd0b565 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -462,7 +462,7 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
 	igt_remove_fb(data->drm_fd, &old_fb);
 }
 
-static void test_format_plane(data_t *data, enum pipe pipe,
+static bool test_format_plane(data_t *data, enum pipe pipe,
 			      igt_output_t *output, igt_plane_t *plane)
 {
 	igt_plane_t *primary;
@@ -472,12 +472,13 @@ static void test_format_plane(data_t *data, enum pipe pipe,
 	uint32_t format, ref_format;
 	uint64_t width, height;
 	igt_crc_t ref_crc[ARRAY_SIZE(colors)];
+	bool result = true;
 
 	/*
 	 * No clamping test for cursor plane
 	 */
 	if (data->crop != 0 && plane->type == DRM_PLANE_TYPE_CURSOR)
-		return;
+		return true;
 
 	mode = igt_output_get_mode(output);
 	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
@@ -487,7 +488,7 @@ static void test_format_plane(data_t *data, enum pipe pipe,
 	} else {
 		if (!plane->drm_plane) {
 			igt_debug("Only legacy cursor ioctl supported, skipping cursor plane\n");
-			return;
+			return true;
 		}
 		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_WIDTH, &width));
 		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height));
@@ -548,11 +549,19 @@ static void test_format_plane(data_t *data, enum pipe pipe,
 			 kmstest_pipe_name(pipe), plane->index);
 
 		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
+			bool crc_equal;
+
 			test_format_plane_color(data, pipe, plane,
 						format, width, height,
 						j, &crc, &fb);
 
-			igt_assert_crc_equal(&crc, &ref_crc[j]);
+			crc_equal = igt_check_crc_equal(&crc, &ref_crc[j]);
+			result &= crc_equal;
+
+			if (!crc_equal)
+				igt_warn("CRC mismatch with format " IGT_FORMAT_FMT " on %s.%u\n",
+					 IGT_FORMAT_ARGS(format),
+					 kmstest_pipe_name(pipe), plane->index);
 		}
 	}
 
@@ -567,6 +576,8 @@ static void test_format_plane(data_t *data, enum pipe pipe,
 
 	igt_remove_fb(data->drm_fd, &fb);
 	igt_remove_fb(data->drm_fd, &primary_fb);
+
+	return result;
 }
 
 static void
@@ -577,10 +588,14 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 	igt_display_require_output_on_pipe(&data->display, pipe);
 
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
+		bool result = true;
 		igt_plane_t *plane;
 
 		for_each_plane_on_pipe(&data->display, pipe, plane)
-			test_format_plane(data, pipe, output, plane);
+			result &= test_format_plane(data, pipe, output, plane);
+
+		igt_assert_f(result, "At least one CRC mismatch happened\n");
+
 
 		igt_output_set_pipe(output, PIPE_ANY);
 	}
-- 
2.20.1

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

             reply	other threads:[~2019-03-11 13:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 13:32 Arkadiusz Hiler [this message]
2019-03-11 13:32 ` [igt-dev] [PATCH i-g-t 2/2] Revert "tests: kms_plane: Disable XBGR8888" Arkadiusz Hiler
2019-03-11 14:13   ` Daniel Vetter
2019-03-11 14:55 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_plane: Keep testing pixel formats even if one fails Patchwork
2019-03-11 16:11 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-03-12 11:26 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_plane: Keep testing pixel formats even if one fails (rev2) Patchwork
2019-03-12 13:23 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311133222.10030-1-arkadiusz.hiler@intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox