summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2021-01-09 21:10:12 +0200
committerJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2021-01-12 19:53:58 +0200
commit2a2b3418f7458dfa1fac255cc5c71603f617690a (patch)
tree58f309bda9f0ddd99f3d0af301b2472d5f7ee3ed /tests/kms_rotation_crc.c
parentd9bc7773043d11d37ae5b03bf18979541a9c7ef4 (diff)
tests/kms_rotation_crc: fix crc buffer overflow for slow platforms
on bad tiling tests there was nothing reading running crcs which could fill up crc ringbuffer. Fix this by draining crc buffer per round. Also unify all platforms execution path by taking reference crcs per pipe. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index be27103f..33a97cca 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -272,11 +272,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
*/
igt_require(igt_display_has_format_mod(display, pixel_format, tiling));
- /*
- * HSW will need to have those CRCs calculated each time, it
- * seems to behave different from other platforms.
- */
- if (!data->crc_rect[rect].valid || IS_HASWELL(data->devid)) {
+ if (!data->crc_rect[rect].valid) {
/*
* Create a reference software rotated flip framebuffer.
*/
@@ -345,6 +341,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
if (test_bad_format) {
+ igt_pipe_crc_drain(data->pipe_crc);
igt_assert_eq(ret, -EINVAL);
return;
}
@@ -408,10 +405,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
igt_display_t *display = &data->display;
igt_output_t *output;
enum pipe pipe;
- int c;
-
- for (c = 0; c < num_rectangle_types; c++)
- data->crc_rect[c].valid = false;
if (plane_type == DRM_PLANE_TYPE_CURSOR)
igt_require(display->has_cursor_plane);
@@ -420,7 +413,10 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
for_each_pipe_with_valid_output(display, pipe, output) {
igt_plane_t *plane;
- int i, j;
+ int i, j, c;
+
+ for (c = 0; c < num_rectangle_types; c++)
+ data->crc_rect[c].valid = false;
if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
continue;