Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] [i-g-t] tests/kms_cursor_crc: Fix test intermittent failures on AMD gpu
@ 2023-10-02 13:41 Hersen Wu
  2023-10-02 14:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Hersen Wu @ 2023-10-02 13:41 UTC (permalink / raw)
  To: igt-dev, rodrigo.siqueira, aurabindo.pillai, alex.hung,
	hamza.mahfooz, sunpeng.li
  Cc: Hersen Wu, markyacoub

Wait for two more vblanks before reading crc on AMD gpu.

Without waiting for two vblanks, AMD cursor updates may not
synchronized to the same frame of pipe, crc generated may
not be reliable.

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
---
 tests/kms_cursor_crc.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index ba29ff65d..e3259e147 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -276,6 +276,15 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
 		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
 		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
 		igt_display_commit(display);
+
+		/* Wait for two more vblanks since cursor updates may not
+		 * synchronized to the same frame on AMD HW
+		 */
+		if (is_amdgpu_device(data->drm_fd))
+			igt_wait_for_vblank_count(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset,
+				data->vblank_wait_count);
+
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
 		igt_assert_crc_equal(&crc, hwcrc);
 	}
@@ -1079,7 +1088,11 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 
 		igt_require_pipe_crc(data.drm_fd);
 
-		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
+		/* Wait for two more vblanks since cursor updates may not
+		 * synchronized to the same frame on AMD HW
+		 */
+		data.vblank_wait_count =
+			(is_msm_device(data.drm_fd) || is_amdgpu_device(data.drm_fd)) ? 2 : 1;
 	}
 
 	data.cursor_max_w = cursor_width;
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [igt-dev] [PATCH] [i-g-t] tests/kms_cursor_crc: Fix test intermittent failures on AMD gpu
@ 2023-10-02 14:20 Hersen Wu
  2023-10-03  7:38 ` Juha-Pekka Heikkila
  2023-10-13 11:38 ` Kamil Konieczny
  0 siblings, 2 replies; 15+ messages in thread
From: Hersen Wu @ 2023-10-02 14:20 UTC (permalink / raw)
  To: igt-dev, juhapekka.heikkila, rodrigo.siqueira, aurabindo.pillai,
	alex.hung, hamza.mahfooz, sunpeng.li
  Cc: Hersen Wu, markyacoub

Wait for two more vblanks before reading crc on AMD gpu.

Without waiting for two vblanks, AMD cursor updates may not
synchronized to the same frame of pipe, crc generated may
not be reliable.

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
---
 tests/kms_cursor_crc.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index ba29ff65d..e3259e147 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -276,6 +276,15 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
 		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
 		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
 		igt_display_commit(display);
+
+		/* Wait for two more vblanks since cursor updates may not
+		 * synchronized to the same frame on AMD HW
+		 */
+		if (is_amdgpu_device(data->drm_fd))
+			igt_wait_for_vblank_count(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset,
+				data->vblank_wait_count);
+
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
 		igt_assert_crc_equal(&crc, hwcrc);
 	}
@@ -1079,7 +1088,11 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 
 		igt_require_pipe_crc(data.drm_fd);
 
-		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
+		/* Wait for two more vblanks since cursor updates may not
+		 * synchronized to the same frame on AMD HW
+		 */
+		data.vblank_wait_count =
+			(is_msm_device(data.drm_fd) || is_amdgpu_device(data.drm_fd)) ? 2 : 1;
 	}
 
 	data.cursor_max_w = cursor_width;
-- 
2.25.1

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

end of thread, other threads:[~2023-10-19  4:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02 13:41 [igt-dev] [PATCH] [i-g-t] tests/kms_cursor_crc: Fix test intermittent failures on AMD gpu Hersen Wu
2023-10-02 14:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-10-02 15:11 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-02 16:36 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02 14:20 [igt-dev] [PATCH] [i-g-t] " Hersen Wu
2023-10-03  7:38 ` Juha-Pekka Heikkila
2023-10-03 13:32   ` Wu, Hersen
2023-10-03 13:49     ` Wu, Hersen
2023-10-03 19:20     ` Juha-Pekka Heikkilä
2023-10-03 21:12       ` Wu, Hersen
2023-10-13 11:38 ` Kamil Konieczny
2023-10-13 11:49   ` Juha-Pekka Heikkila
2023-10-16 20:24     ` Wu, Hersen
2023-10-18 12:45   ` Wu, Hersen
2023-10-19  4:18     ` Illipilli, TejasreeX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox