summaryrefslogtreecommitdiff
path: root/tests/kms_async_flips.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2021-04-28 01:22:33 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-04-29 02:02:49 +0300
commit126a3f6fc0e97786e2819085efc84e741093aed5 (patch)
tree4bfac8cdc0349968e3f0e5a1c7eafe9d77a56dff /tests/kms_async_flips.c
parent9ab0820dbd07781161c1ace6973ea222fd24e53a (diff)
tests/kms_async_flips: Fix flip timestamp checks
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. Cc: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Diffstat (limited to 'tests/kms_async_flips.c')
-rw-r--r--tests/kms_async_flips.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index e397a54b..a60eab68 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");
}