[PATCH i-g-t] tests/kms_cursor_legacy: add check for flip done

Arun R Murthy arun.r.murthy at intel.com
Wed Nov 16 05:06:52 UTC 2022


The first igt_display_commit2() in the subtest is expected to do modeset
and this has to be verified for succesfull completion, else the further
tests will tend to fail.

Signed-off-by: Arun R Murthy <arun.r.murthy at intel.com>
---
 tests/kms_cursor_legacy.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 6b75e98c..cdf83a0c 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -715,10 +715,11 @@ static void flip_vs_cursor(igt_display_t *display, enum flip_test mode, int nloo
 	struct drm_mode_cursor arg[2];
 	struct drm_event_vblank vbl;
 	struct igt_fb fb_info, cursor_fb, cursor_fb2, argb_fb;
-	unsigned vblank_start;
+	unsigned vblank_start, flags;
 	int target, cpu;
 	enum pipe pipe = find_connected_pipe(display, false);
 	volatile unsigned long *shared;
+	struct pollfd pfd = { display->drm_fd, POLLIN };
 	cpu_set_t mask, oldmask;
 	igt_output_t *output;
 	igt_plane_t *cursor;
@@ -734,7 +735,20 @@ static void flip_vs_cursor(igt_display_t *display, enum flip_test mode, int nloo
 
 	prepare_flip_test(display, mode, pipe, pipe, arg, &fb_info, &argb_fb, &cursor_fb2);
 
-	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+	flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
+	flags |= DRM_MODE_ATOMIC_NONBLOCK;
+	flags |= DRM_MODE_PAGE_FLIP_EVENT;
+
+	/*
+	 * Test that a cursor update after a nonblocking modeset
+	 * works as intended. It should block until the modeset completes.
+	 */
+
+	igt_output_set_pipe(output, pipe);
+	igt_plane_set_fb(cursor, NULL);
+	igt_display_commit_atomic(display, flags, NULL);
+	igt_assert_eq(0, poll(&pfd, 1, 0));
+	igt_assert_eq(0, pfd.revents);
 
 	if (nloops)
 		target = get_cursor_updates_per_vblank(display, pipe, &arg[0]);
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list