[igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: reduce repetitive work per round
Karthik B S
karthik.b.s at intel.com
Wed Jan 6 03:56:34 UTC 2021
On 1/5/2021 4:43 PM, Juha-Pekka Heikkila wrote:
> 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 at gmail.com>
LGTM.
Reviewed-by: Karthik B S <karthik.b.s at intel.com>
> ---
> tests/kms_plane_scaling.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index 89b82416d..c63eb428f 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);
> }
More information about the igt-dev
mailing list