igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] tests: Replace calls to igt_pipe_crc_drain + get_single with igt_pipe_crc_get_current()
Date: Tue, 24 Jul 2018 15:59:26 +0200	[thread overview]
Message-ID: <20180724135927.7926-2-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180724135927.7926-1-maarten.lankhorst@linux.intel.com>

This is a more race free of accomplishing the same.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_available_modes_crc.c |  3 +--
 tests/kms_cursor_legacy.c       |  3 +--
 tests/kms_plane.c               |  6 +-----
 tests/kms_plane_lowres.c        |  6 ++----
 tests/kms_plane_multiple.c      |  3 +--
 tests/kms_rotation_crc.c        | 13 +++++--------
 6 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index b70ef5d7d4c0..69a6a37d8ebd 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -400,8 +400,7 @@ test_one_mode(data_t* data, igt_output_t *output, igt_plane_t* plane,
 		igt_display_commit2(&data->display, data->commit);
 
 		if (do_crc) {
-			igt_pipe_crc_drain(data->pipe_crc);
-			igt_pipe_crc_get_single(data->pipe_crc, &current_crc);
+			igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &current_crc);
 
 			if (plane->type != DRM_PLANE_TYPE_CURSOR) {
 				if (!igt_check_crc_equal(&current_crc,
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 85340d43e5b6..82ceebcb0809 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1334,8 +1334,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 
 		igt_assert_eq(get_vblank(display->drm_fd, pipe, 0), vblank_start);
 
-		igt_pipe_crc_drain(pipe_crc);
-		igt_pipe_crc_get_single(pipe_crc, &test_crc);
+		igt_pipe_crc_get_current(display->drm_fd, pipe_crc, &test_crc);
 
 		igt_spin_batch_free(display->drm_fd, spin);
 
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index f9e123f0d1ea..3999dde8f694 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -419,11 +419,7 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
 	igt_plane_set_fb(plane, fb);
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
-
-	/* make sure the crc we get is for the new fb */
-	igt_wait_for_vblank(data->drm_fd, pipe);
-	igt_pipe_crc_drain(data->pipe_crc);
-	igt_pipe_crc_get_single(data->pipe_crc, crc);
+	igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, crc);
 
 	igt_remove_fb(data->drm_fd, &old_fb);
 }
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index d1e4b3ca536e..5e83ef5630b5 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -221,8 +221,7 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 	check_mode(&mode_lowres, mode2);
 
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
-	igt_pipe_crc_drain(pipe_crc);
-	igt_pipe_crc_get_single(pipe_crc, &crc_lowres);
+	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc, &crc_lowres);
 
 	igt_assert_plane_visible(data->drm_fd, pipe, false);
 
@@ -236,8 +235,7 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-	igt_pipe_crc_drain(pipe_crc);
-	igt_pipe_crc_get_single(pipe_crc, &crc_hires2);
+	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc, &crc_hires2);
 
 	igt_assert_plane_visible(data->drm_fd, pipe, true);
 
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index e61bc84624b3..a53be00141f0 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -276,8 +276,7 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 
 		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-		igt_pipe_crc_drain(data->pipe_crc);
-		igt_pipe_crc_get_single(data->pipe_crc, &crc);
+		igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc);
 
 		igt_assert_crc_equal(&data->ref_crc, &crc);
 
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6cb5858adb0f..b994cc5d24fe 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -235,8 +235,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	if (plane->type != DRM_PLANE_TYPE_CURSOR)
 		igt_plane_set_position(plane, data->pos_x, data->pos_y);
 	igt_display_commit2(display, COMMIT_ATOMIC);
-	igt_pipe_crc_drain(data->pipe_crc);
-	igt_pipe_crc_get_single(data->pipe_crc, &data->flip_crc);
+
+	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->flip_crc);
 
 	/*
 	  * Prepare the non-rotated flip fb.
@@ -259,8 +259,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 		igt_plane_set_position(plane, data->pos_x, data->pos_y);
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
-	igt_pipe_crc_drain(data->pipe_crc);
-	igt_pipe_crc_get_single(data->pipe_crc, &data->ref_crc);
+	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->ref_crc);
 
 	/*
 	 * Prepare the non-rotated reference fb.
@@ -310,8 +309,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 	igt_assert_eq(ret, 0);
 
 	/* Check CRC */
-	igt_pipe_crc_drain(data->pipe_crc);
-	igt_pipe_crc_get_single(data->pipe_crc, &crc_output);
+	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
 	igt_assert_crc_equal(&data->ref_crc, &crc_output);
 
 	/*
@@ -334,8 +332,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 			igt_assert_eq(ret, 0);
 		}
 		kmstest_wait_for_pageflip(data->gfx_fd);
-		igt_pipe_crc_drain(data->pipe_crc);
-		igt_pipe_crc_get_single(data->pipe_crc, &crc_output);
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
 		igt_assert_crc_equal(&data->flip_crc,
 				     &crc_output);
 	}
-- 
2.18.0

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

  reply	other threads:[~2018-07-24 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 13:59 [igt-dev] [PATCH i-g-t 1/3] lib/igt_debugfs: Add igt_pipe_crc_get_current() to get a crc Maarten Lankhorst
2018-07-24 13:59 ` Maarten Lankhorst [this message]
2018-08-14 15:18   ` [igt-dev] [PATCH i-g-t 2/3] tests: Replace calls to igt_pipe_crc_drain + get_single with igt_pipe_crc_get_current() Daniel Vetter
2018-08-14 15:36     ` Maarten Lankhorst
2018-07-24 13:59 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_nv12: Add nv12 specific tests Maarten Lankhorst
2018-07-26  6:55   ` Petri Latvala
2018-07-26  8:57     ` Maarten Lankhorst
2018-07-24 15:17 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] lib/igt_debugfs: Add igt_pipe_crc_get_current() to get a crc Patchwork
2018-07-24 18:21 ` [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=20180724135927.7926-2-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).