summaryrefslogtreecommitdiff
path: root/tests/i915/kms_flip_tiling.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2021-10-13 21:21:31 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-10-18 16:54:27 +0300
commit51792e987da03ba2a6faf5857c12f1d173c87def (patch)
tree74cfecd6f4fc79c64b0f320e746da5a59fe28c04 /tests/i915/kms_flip_tiling.c
parentf4df3a41ff1c04dfe049b78bd108110ba72f42a7 (diff)
tests/i915/kms_flip_tiling: Keep CRC running all the time
Don't start/stop the CRC capture at every step. This speeds up the test significantly. We also avoid blinking off the pipe obviously, and we also make sure to keep the old fbs around to avoid pointless extra commits due to rmfb turning off the plane whe the current fb vanishes. The whole test is now ~16s on glk looping over all possible ordered modifier pairs. Could probably restrict this to a single pipe as well, further cutting that down by almost another 2/3. But eg. on GLK not all pipes have all the modifiers so could perhaps lose a bit of coverrage that way. And we're only few seconds slower than the starting point when the test only checked a subset of modifier pairs rather than the full set. So perhaps acceptable. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/i915/kms_flip_tiling.c')
-rw-r--r--tests/i915/kms_flip_tiling.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/i915/kms_flip_tiling.c b/tests/i915/kms_flip_tiling.c
index 56b787c1..91365799 100644
--- a/tests/i915/kms_flip_tiling.c
+++ b/tests/i915/kms_flip_tiling.c
@@ -47,16 +47,19 @@ static void pipe_crc_free(data_t *data)
if (!data->pipe_crc)
return;
+ igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = NULL;
}
static void pipe_crc_new(data_t *data, int pipe)
{
- pipe_crc_free(data);
+ if (data->pipe_crc)
+ return;
data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
igt_assert(data->pipe_crc);
+ igt_pipe_crc_start(data->pipe_crc);
}
static int try_commit(igt_display_t *display)
@@ -68,14 +71,12 @@ static int try_commit(igt_display_t *display)
static void
test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t modifier[2])
{
+ struct igt_fb old_fb[2] = { data->fb[0], data->fb[1] };
drmModeModeInfo *mode;
igt_plane_t *primary;
igt_crc_t reference_crc, crc;
int fb_id, ret;
- pipe_crc_new(data, pipe);
- igt_output_set_pipe(output, pipe);
-
mode = igt_output_get_mode(output);
primary = igt_output_get_plane(output, 0);
@@ -98,7 +99,8 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t mo
igt_require_f(try_commit(&data->display) == 0,
"commit failed with " IGT_MODIFIER_FMT "\n",
IGT_MODIFIER_ARGS(modifier[1]));
- igt_pipe_crc_collect_crc(data->pipe_crc, &reference_crc);
+ pipe_crc_new(data, pipe);
+ igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &reference_crc);
/* Commit the first fb. */
igt_plane_set_fb(primary, &data->fb[0]);
@@ -118,8 +120,11 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t mo
kmstest_wait_for_pageflip(data->drm_fd);
/* Get a crc and compare with the reference. */
- igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
+ igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &crc);
igt_assert_crc_equal(&reference_crc, &crc);
+
+ igt_remove_fb(data->drm_fd, &old_fb[0]);
+ igt_remove_fb(data->drm_fd, &old_fb[1]);
}
static void test_cleanup(data_t *data, enum pipe pipe, igt_output_t *output)
@@ -131,7 +136,6 @@ static void test_cleanup(data_t *data, enum pipe pipe, igt_output_t *output)
igt_plane_set_fb(primary, NULL);
pipe_crc_free(data);
igt_output_set_pipe(output, PIPE_ANY);
- igt_display_commit(&data->display);
igt_remove_fb(data->drm_fd, &data->fb[0]);
igt_remove_fb(data->drm_fd, &data->fb[1]);
@@ -161,6 +165,7 @@ igt_main
for_each_pipe_with_valid_output(&data.display, pipe, output) {
igt_plane_t *plane;
+ pipe_crc_free(&data);
igt_output_set_pipe(output, pipe);
plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
@@ -184,9 +189,9 @@ igt_main
igt_fb_modifier_name(modifier[0]),
igt_fb_modifier_name(modifier[1]))
test_flip_tiling(&data, pipe, output, modifier);
- test_cleanup(&data, pipe, output);
}
}
+ test_cleanup(&data, pipe, output);
}
}