[igt-dev] [PATCH i-g-t v2] tests/kms_plane_cursor: Change API for collecting the CRC for AMDGPU

Aurabindo Pillai aurabindo.pillai at amd.com
Wed Oct 19 19:45:07 UTC 2022


On AMD hw, igt_pipe_crc_get_current() alone does not work correctly, but
igt_pipe_crc_collect_crc() does. The latter is more robust and reports
the expected crc.

This is because cursor updates are not synchronized to
the frame in the same atomic commit and can get deferred to the next.
Until cursor updates are synchronized with the frame, use
igt_pipe_crc_collect_crc() for the side effect of skipping 2 frames
within the driver thereby giving expected CRC values

Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
---
 tests/kms_plane_cursor.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index e9abfd78..94c1fb64 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -150,8 +150,12 @@ static void test_cursor_pos(data_t *data, int x, int y, unsigned int flags)
 	igt_plane_set_fb(data->cursor, NULL);
 	igt_display_commit_atomic(&data->display, 0, NULL);
 
-	igt_pipe_crc_start(data->pipe_crc);
-	igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &ref_crc);
+	if (!is_amdgpu_device(data->drm_fd)) {
+		igt_pipe_crc_start(data->pipe_crc);
+		igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &ref_crc);
+	} else {
+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
+	}
 
 	draw_color(pfb, 1.0, 1.0, 1.0);
 
@@ -169,8 +173,12 @@ static void test_cursor_pos(data_t *data, int x, int y, unsigned int flags)
 	igt_plane_set_position(data->cursor, x, y);
 	igt_display_commit_atomic(&data->display, 0, NULL);
 
-	igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &test_crc);
-	igt_pipe_crc_stop(data->pipe_crc);
+	if (!is_amdgpu_device(data->drm_fd)) {
+		igt_pipe_crc_start(data->pipe_crc);
+		igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &test_crc);
+	} else {
+		igt_pipe_crc_collect_crc(data->pipe_crc, &test_crc);
+	}
 
 	igt_assert_crc_equal(&ref_crc, &test_crc);
 }
-- 
2.38.0



More information about the igt-dev mailing list