[igt-dev] [PATCH i-g-t] tests/kms_flip: Update logic to calculate test duration

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri May 6 14:08:52 UTC 2022


look ok to me

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>

On 6.5.2022 7.15, Karthik B S wrote:
> Few of the subtests are intended to run only for one iteration with
> duration of 0. But because of the existing logic to calculate duration,
> even these subtests are running in loop for 0.5s. This is causing excessive
> logging in the nonexisting-fb subtests.
> 
> Added check to use duration calculation logic only if duration is
> non-zero in the first place.
> 
> Signed-off-by: Karthik B S <karthik.b.s at intel.com>
> ---
>   tests/kms_flip.c | 14 ++++++++++----
>   1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> index ce452dc8..773e6597 100755
> --- a/tests/kms_flip.c
> +++ b/tests/kms_flip.c
> @@ -1537,8 +1537,11 @@ static int run_test(int duration, int flags)
>   	}
>   
>   	igt_require(modes);
> -	duration = duration * 1000 / modes;
> -	duration = max(500, duration);
> +
> +	if (duration) {
> +		duration = duration * 1000 / modes;
> +		duration = max(500, duration);
> +	}
>   
>   	/* Find any connected displays */
>   	for (i = 0; i < resources->count_connectors; i++) {
> @@ -1605,8 +1608,11 @@ static int run_pair(int duration, int flags)
>   	/* If we have fewer than 2 connected outputs then we won't have any
>   	 * configuration at all. So skip in that case. */
>   	igt_require_f(modes, "At least two displays required\n");
> -	duration = duration * 1000 / modes;
> -	duration = max(duration, 500);
> +
> +	if (duration) {
> +		duration = duration * 1000 / modes;
> +		duration = max(duration, 500);
> +	}
>   
>   	/* Find a pair of connected displays */
>   	for (i = 0; i < resources->count_connectors; i++) {



More information about the igt-dev mailing list