[igt-dev] [PATCH i-g-t] tests/kms_async_flips: Fix flip timestamp checks

Karthik B S karthik.b.s at intel.com
Thu Apr 29 05:37:53 UTC 2021


On 4/28/2021 3:55 AM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Check the flip timestamp from the event (not the time we got the
> event) against the vblank timestamps. Also if things are going
> well we should expect the flip timestamp to in fact match the
> first vblank timestamp, so allow them to be equal.

Hi,

During the initial implementation, the timestamp returned by the kernel 
was vblank timestamp and we were not sending back the flip timestamp.

So we were calculating the time in the event rather than using the event 
timestamp.

Is this now updated to return the flip timestamp? If not, we would 
always have flip time stamp same as the previous vblank time stamp?

Thanks,

Karthik.B.S

>
> Cc: Karthik B S <karthik.b.s at intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>   tests/kms_async_flips.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index e397a54b874f..a60eab688024 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -89,7 +89,7 @@ static void flip_handler(int fd_, unsigned int sequence, unsigned int tv_sec,
>   
>   	last_ms = cur_ms;
>   
> -	data->flip_timestamp_us = ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
> +	data->flip_timestamp_us = tv_sec * 1000000l + tv_usec;
>   }
>   
>   static void wait_flip_event(data_t *data)
> @@ -282,7 +282,7 @@ static void test_timestamp(data_t *data)
>   	igt_info("vbl1_timestamp = %ldus\nflip_timestamp = %ldus\nvbl2_timestamp = %ldus\n",
>   		 vbl_time, data->flip_timestamp_us, vbl_time1);
>   
> -	igt_assert_f(vbl_time < data->flip_timestamp_us && vbl_time1 > data->flip_timestamp_us,
> +	igt_assert_f(vbl_time <= data->flip_timestamp_us && vbl_time1 > data->flip_timestamp_us,
>   		     "Async flip time stamp is expected to be in between 2 vblank time stamps\n");
>   }
>   




More information about the igt-dev mailing list