[PATCH i-g-t] tests/kms_async_flips: Re-calculate min flips per frame

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Mar 15 08:42:52 UTC 2024


On Thu, Mar 14, 2024 at 11:24:37AM +0530, Bhanuprakash Modem wrote:
> As XE driver taking longer time for pinning, re-calculate to
> reduce the expected min flips per frame (by assuming the min
> pinning time as 1.2 ms). Otherwise test will fail, since we
> can't achieve those many flips per frame.

MIN_FLIPS_PER_FRAME==5. If xe can't even achieve that low number
then it's very broken.

> 
> Cc: Vandita Kulkarni <vandita.kulkarni at intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  tests/kms_async_flips.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 2895168f7..ec2d86f4e 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -238,6 +238,19 @@ static void test_async_flip(data_t *data)
>  	int ret, frame;
>  	long long int fps;
>  	struct timeval start, end, diff;
> +	int min_flips_per_frame;
> +
> +	/*
> +	 * FIXME: As pinning is taking moretime in XE, recalculate min frames
> +	 * per frame (by considering the pinning time as 1.2 ms)
> +	 */
> +	min_flips_per_frame = 1000 / (data->refresh_rate * 1.2);
> +	igt_require(min_flips_per_frame);
> +
> +	if (min_flips_per_frame > MIN_FLIPS_PER_FRAME)
> +		min_flips_per_frame = MIN_FLIPS_PER_FRAME;
> +
> +	igt_info("Expected min flips per frame: %d\n", min_flips_per_frame);
>  
>  	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>  
> @@ -296,10 +309,10 @@ static void test_async_flip(data_t *data)
>  		timersub(&end, &start, &diff);
>  
>  		if (data->alternate_sync_async) {
> -			igt_assert_f(data->flip_interval < 1000.0 / (data->refresh_rate * MIN_FLIPS_PER_FRAME),
> +			igt_assert_f(data->flip_interval < 1000.0 / (data->refresh_rate * min_flips_per_frame),
>  				     "Flip interval not significantly smaller than vblank interval\n"
>  				     "Flip interval: %lfms, Refresh Rate = %dHz, Threshold = %d\n",
> -				     data->flip_interval, data->refresh_rate, MIN_FLIPS_PER_FRAME);
> +				     data->flip_interval, data->refresh_rate, min_flips_per_frame);
>  		}
>  
>  		frame++;
> @@ -307,7 +320,7 @@ static void test_async_flip(data_t *data)
>  
>  	if (!data->alternate_sync_async) {
>  		fps = frame * 1000 / RUN_TIME;
> -		igt_assert_f((fps / 1000) > (data->refresh_rate * MIN_FLIPS_PER_FRAME),
> +		igt_assert_f((fps / 1000) > (data->refresh_rate * min_flips_per_frame),
>  			     "FPS should be significantly higher than the refresh rate\n");
>  	}
>  }
> -- 
> 2.43.2

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list