diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-02-02 13:34:25 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-02-12 13:13:18 +0100 |
commit | 7d48c0252c384d18318de89c54817bdfe9c832fc (patch) | |
tree | d946502a4d2a9039d5dd500a797d27bfd5920aa1 /tests/kms_cursor_legacy.c | |
parent | d311e9aaa6ca137391b590d8093e53af7059ee0c (diff) |
lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v4.
Collecting CRC may result in a modeset and extra vblank waits. On some
tests this will increase the runtime a lot, so it makes sense to
keep it enabled, and only collect the most recent CRC when needed.
Changes since v1:
- Fix read_crc semantics. (Ville)
Changes since v2:
- Remove EAGAIN assert, can be reached from drain_crc.
Changes since v3:
- Do not infinitely loop in igt_pipe_crc_drain().
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com> #v2
Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
Diffstat (limited to 'tests/kms_cursor_legacy.c')
-rw-r--r-- | tests/kms_cursor_legacy.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 5011e78e..d0a28b3c 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -1276,7 +1276,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) enum pipe pipe = find_connected_pipe(display, false); igt_pipe_t *pipe_connected = &display->pipes[pipe]; igt_plane_t *plane_primary = igt_pipe_get_plane_type(pipe_connected, DRM_PLANE_TYPE_PRIMARY); - igt_crc_t crcs[2]; + igt_crc_t crcs[2], test_crc; if (atomic) igt_require(display->is_atomic); @@ -1290,7 +1290,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); - pipe_crc = igt_pipe_crc_new_nonblock(display->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO); + pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO); set_cursor_on_pipe(display, pipe, &cursor_fb); igt_display_commit2(display, COMMIT_UNIVERSAL); @@ -1322,9 +1322,6 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) /* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */ for (int i = 1; i >= 0; i--) { igt_spin_t *spin; - igt_crc_t *received_crcs = NULL; - int ncrcs; - static const int max_crcs = 8; spin = igt_spin_batch_new(display->drm_fd, 0, 0, fb_info[1].gem_handle); @@ -1336,7 +1333,8 @@ 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); - ncrcs = igt_pipe_crc_get_crcs(pipe_crc, max_crcs, &received_crcs); + igt_pipe_crc_drain(pipe_crc); + igt_pipe_crc_get_single(pipe_crc, &test_crc); igt_spin_batch_free(display->drm_fd, spin); @@ -1349,16 +1347,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic) igt_plane_set_fb(plane_primary, &fb_info[0]); igt_display_commit2(display, COMMIT_UNIVERSAL); - /* - * We collect the crc nonblockingly, and should have at least 1 - * but not so many crcs that we overflow. Last CRC is the only - * one we care about here. Other CRCs may have been from before - * the cursor update and can contain garbage. - */ - igt_assert(ncrcs > 0 && ncrcs < max_crcs); - - igt_assert_crc_equal(&crcs[i], &received_crcs[ncrcs - 1]); - free(received_crcs); + igt_assert_crc_equal(&crcs[i], &test_crc); } igt_remove_fb(display->drm_fd, &fb_info[1]); |