diff options
author | Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> | 2021-01-05 13:13:43 +0200 |
---|---|---|
committer | Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> | 2021-01-08 13:11:08 +0200 |
commit | 77a72b9fa5a1dd57e3f8cbde360d1097804615e8 (patch) | |
tree | 94db454ba3c96b4469499c8eabbda8fe968a9bbf /tests/kms_plane_scaling.c | |
parent | b29c09ca390f864ba71d30144606849496a5ade6 (diff) |
tests/kms_plane_scaling: reduce repetitive work per round
create needed planes only when needed and not destroying them in between.
This reduces execution time for clipping clamping dynamic tests on my ICL
from 75s to 29s
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
Diffstat (limited to 'tests/kms_plane_scaling.c')
-rw-r--r-- | tests/kms_plane_scaling.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c index 89b82416..c63eb428 100644 --- a/tests/kms_plane_scaling.c +++ b/tests/kms_plane_scaling.c @@ -483,19 +483,8 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output) } static void -__test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode, - uint32_t f1, uint32_t f2) +__test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode) { - cleanup_fbs(d); - - igt_create_pattern_fb(d->drm_fd, - mode->hdisplay, mode->vdisplay, f1, - LOCAL_I915_FORMAT_MOD_X_TILED, &d->fb[1]); - - igt_create_pattern_fb(d->drm_fd, - mode->hdisplay, mode->vdisplay, f2, - LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[2]); - igt_plane_set_fb(d->plane1, &d->fb[1]); igt_plane_set_fb(d->plane2, &d->fb[2]); @@ -549,6 +538,10 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpu igt_vec_init(&tested_formats2, sizeof(uint32_t)); + igt_create_pattern_fb(d->drm_fd, + mode->hdisplay, mode->vdisplay, f1, + LOCAL_I915_FORMAT_MOD_X_TILED, &d->fb[1]); + for (int j = 0; j < d->plane2->drm_plane->count_formats; j++) { unsigned f2 = d->plane2->drm_plane->formats[j]; @@ -556,8 +549,15 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpu !can_scale(d, f2)) continue; - __test_scaler_with_clipping_clamping_scenario(d, mode, f1, f2); + igt_create_pattern_fb(d->drm_fd, + mode->hdisplay, mode->vdisplay, f2, + LOCAL_I915_FORMAT_MOD_Y_TILED, + &d->fb[2]); + + __test_scaler_with_clipping_clamping_scenario(d, mode); + igt_remove_fb(d->drm_fd, &d->fb[2]); } + igt_remove_fb(d->drm_fd, &d->fb[1]); igt_vec_fini(&tested_formats2); } |