Skip to content

Improve CRC test robustness with stop-on-fail and cleanup helpers

Sowmiya S igt-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17lib/igt_pipe_crc: Add CRC stop-on-fail assertion and cleanup helperlib/igt_pipe_crc.c lib/igt_pipe_crc.h+54 -03 replies
2/17tests/intel/kms_big_fb: Use CRC stop-on-fail assertion and cleanup helpertests/intel/kms_big_fb.c+3 -20 replies
3/17tests/intel/kms_fbc_dirty_rect: Use CRC stop-on-fail assertion and cleanup helpertests/intel/kms_fbc_dirty_rect.c+9 -70 replies
4/17tests/intel/kms_flip_scaled_crc: Use CRC stop-on-fail assertion and cleanup helpertests/intel/kms_flip_scaled_crc.c+4 -130 replies
5/17tests/intel/kms_flip_tiling: Use CRC stop-on-fail assertion and cleanup helpertests/intel/kms_flip_tiling.c+4 -130 replies
6/17tests/intel/kms_pipe_stress: Use CRC stop-on-fail assertion and cleanup helpertests/intel/kms_pipe_stress.c+5 -30 replies
7/17tests/kms_async_flips: Use CRC stop-on-fail assertion and cleanup helpertests/kms_async_flips.c+3 -30 replies
8/17tests/kms_atomic: Use CRC stop-on-fail assertion and cleanup helpertests/kms_atomic.c+7 -90 replies
9/17tests/kms_cursor_crc: Use CRC stop-on-fail assertion and cleanup helpertests/kms_cursor_crc.c+14 -160 replies
10/17tests/kms_cursor_edge_walk: Use CRC stop-on-fail assertion and cleanup helpertests/kms_cursor_edge_walk.c+3 -30 replies
11/17tests/kms_cursor_legacy: Use CRC stop-on-fail assertion and cleanup helpertests/kms_cursor_legacy.c+5 -60 replies
12/17tests/kms_pipe_crc_basic: Use CRC stop-on-fail assertion and cleanup helpertests/kms_pipe_crc_basic.c+6 -90 replies
13/17tests/kms_plane: Use CRC stop-on-fail assertion and cleanup helpertests/kms_plane.c+8 -110 replies
14/17tests/kms_plane_alpha_blend: Use CRC stop-on-fail assertion and cleanup helpertests/kms_plane_alpha_blend.c+16 -150 replies
15/17tests/kms_plane_cursor: Use CRC stop-on-fail assertion and cleanup helpertests/kms_plane_cursor.c+3 -30 replies
16/17tests/kms_plane_multiple: Use CRC stop-on-fail assertion and cleanup helpertests/kms_plane_multiple.c+8 -120 replies
17/17tests/kms_rotation_crc: Use CRC stop-on-fail assertion and cleanup helpertests/kms_rotation_crc.c+13 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH i-g-t v1 00/17] Improve CRC test robustness with stop-on-fail and cleanup helpers

This patch series introduces two new helper functions to improve the robustness and maintainability of CRC-based tests throughout the IGT test suite.

CRC-based tests are critical for verifying display functionality, but improper handling of CRC failures can lead to:
- CRC buffer overflows when CRC collection continues after assertion failures
- Resource leaks from incomplete cleanup of pipe_crc objects
- Test hangs when pipe CRC remains active after failures
- Inconsistent cleanup patterns across different tests

Two new helper functions address these issues:

1. igt_assert_crc_equal_stop_on_fail(): Automatically stops CRC collection before assertion on mismatch, preventing buffer overflow and ensuring clean test termination when CRC values don't match.

2. igt_pipe_crc_cleanup(): Safely cleans up pipe_crc objects by:
- Checking if CRC collection is active before stopping
- Properly freeing allocated resources
- Clearing the caller's pointer to prevent use-after-free bugs
- Handling NULL/uninitialized pointers gracefully

These functions are designed to be used consistently across all CRC tests and in fixture teardown paths, ensuring reliable resource management and preventing cascading failures when CRC mismatches occur.

Sowmiya S (17):
lib/igt_pipe_crc: Add CRC stop-on-fail assertion and cleanup helper tests/intel/kms_big_fb: Use CRC stop-on-fail assertion and cleanup
helper
tests/intel/kms_fbc_dirty_rect: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_flip_scaled_crc: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_flip_tiling: Use CRC stop-on-fail assertion and
cleanup helper
tests/intel/kms_pipe_stress: Use CRC stop-on-fail assertion and
cleanup helper
tests/kms_async_flips: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_atomic: Use CRC stop-on-fail assertion and cleanup helper tests/kms_cursor_crc: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_cursor_edge_walk: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_cursor_legacy: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_pipe_crc_basic: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_plane: Use CRC stop-on-fail assertion and cleanup helper tests/kms_plane_alpha_blend: Use CRC stop-on-fail assertion and
cleanup helper
tests/kms_plane_cursor: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_plane_multiple: Use CRC stop-on-fail assertion and cleanup
helper
tests/kms_rotation_crc: Use CRC stop-on-fail assertion and cleanup
helper

 lib/igt_pipe_crc.c                | 50 +++++++++++++++++++++++++++++++
 lib/igt_pipe_crc.h                |  4 +++
 tests/intel/kms_big_fb.c          |  5 ++--
 tests/intel/kms_fbc_dirty_rect.c  | 16 +++++-----
 tests/intel/kms_flip_scaled_crc.c | 17 +++--------
 tests/intel/kms_flip_tiling.c     | 17 +++--------
 tests/intel/kms_pipe_stress.c     |  8 +++--
 tests/kms_async_flips.c           |  6 ++--
 tests/kms_atomic.c                | 16 +++++-----
 tests/kms_cursor_crc.c            | 30 +++++++++----------
 tests/kms_cursor_edge_walk.c      |  6 ++--
 tests/kms_cursor_legacy.c         | 11 ++++---
 tests/kms_pipe_crc_basic.c        | 15 ++++------
 tests/kms_plane.c                 | 19 +++++-------
 tests/kms_plane_alpha_blend.c     | 31 +++++++++----------
 tests/kms_plane_cursor.c          |  6 ++--
 tests/kms_plane_multiple.c        | 20 +++++--------
 tests/kms_rotation_crc.c          | 25 ++++++++--------
 18 files changed, 165 insertions(+), 137 deletions(-)
Signature · 1 line
2.43.0