All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_plane: fix pixel format (-clamping) tests
@ 2020-10-26 13:08 Juha-Pekka Heikkila
  2020-10-27 16:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Juha-Pekka Heikkila @ 2020-10-26 13:08 UTC (permalink / raw)
  To: igt-dev

cdclk caused modesets mid test will mess up crc sequence
where two consecutive frames will get same crc. If there come
modeset restart round for given set as modeset will anyway
happen only on first color.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_plane.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index e42c71cd9..4ce859fba 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -560,9 +560,11 @@ static void capture_format_crcs(data_t *data, enum pipe pipe,
 	struct drm_event_vblank ev;
 	int i;
 
+restart_round:
 	for (i = 0; i < data->num_colors; i++) {
 		const color_t *c = &data->colors[i];
 		struct igt_fb old_fb = *fb;
+		int ret;
 
 		prepare_format_color(data, pipe, plane, format, modifier,
 				     width, height, encoding, range, c, fb);
@@ -593,10 +595,22 @@ static void capture_format_crcs(data_t *data, enum pipe pipe,
 			 * to be prepared in parallel while the current fb
 			 * awaits to be latched.
 			 */
-			igt_display_commit_atomic(&data->display,
-						  DRM_MODE_ATOMIC_ALLOW_MODESET |
-						  DRM_MODE_ATOMIC_NONBLOCK |
-						  DRM_MODE_PAGE_FLIP_EVENT, NULL);
+			ret = igt_display_try_commit_atomic(&data->display,
+							    DRM_MODE_ATOMIC_NONBLOCK |
+							    DRM_MODE_PAGE_FLIP_EVENT, NULL);
+			if (ret) {
+				/*
+				 * there was needed modeset for pixel format.
+				 * modeset here happen only on first color of
+				 * given set so restart round as modeset will
+				 * mess up crc frame sequence.
+				 */
+				igt_display_commit_atomic(&data->display,
+							  DRM_MODE_ATOMIC_ALLOW_MODESET,
+							  NULL);
+				igt_remove_fb(data->drm_fd, &old_fb);
+				goto restart_round;
+			}
 		} else {
 			/*
 			 * Last moment to grab the previous crc
@@ -815,8 +829,10 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 
 		igt_plane_set_fb(plane, &test_fb);
 
-		ret = igt_display_try_commit_atomic(&data->display, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
-
+		ret = igt_display_try_commit_atomic(&data->display,
+						    DRM_MODE_ATOMIC_TEST_ONLY |
+						    DRM_MODE_ATOMIC_ALLOW_MODESET,
+						    NULL);
 		if (!ret) {
 			width = test_fb.width;
 			height = test_fb.height;
-- 
2.28.0

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

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

end of thread, other threads:[~2020-10-30 13:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 13:08 [igt-dev] [PATCH i-g-t] tests/kms_plane: fix pixel format (-clamping) tests Juha-Pekka Heikkila
2020-10-27 16:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-10-27 21:21 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-10-27 23:04 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-28  7:39   ` Juha-Pekka Heikkila
2020-10-28 16:46     ` Vudum, Lakshminarayana
2020-10-28 16:22 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2020-10-29 12:43 ` [igt-dev] [PATCH i-g-t] " Kahola, Mika
2020-10-29 18:23   ` Juha-Pekka Heikkila
2020-10-30  9:07     ` Kahola, Mika
2020-10-30 13:40       ` Juha-Pekka Heikkila

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.