From 1ee01d91c7e9bb0922b112c11a374283e2ca454b Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 28 Oct 2018 13:37:26 +0000 Subject: wsi: deduplicate get_current_time() functions between display and x11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Engestrom Reviewed-by: Tapani Pälli --- src/vulkan/wsi/wsi_common_x11.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/vulkan/wsi/wsi_common_x11.c') diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 52d820869a8..0aa71ca6f2e 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -835,19 +835,9 @@ x11_handle_dri3_present_event(struct x11_swapchain *chain, } -static uint64_t wsi_get_current_time(void) -{ - uint64_t current_time; - struct timespec tv; - - clock_gettime(CLOCK_MONOTONIC, &tv); - current_time = tv.tv_nsec + tv.tv_sec*1000000000ull; - return current_time; -} - static uint64_t wsi_get_absolute_timeout(uint64_t timeout) { - uint64_t current_time = wsi_get_current_time(); + uint64_t current_time = wsi_common_get_current_time(); timeout = MIN2(UINT64_MAX - current_time, timeout); @@ -898,7 +888,7 @@ x11_acquire_next_image_poll_x11(struct x11_swapchain *chain, /* If a non-special event happens, the fd will still * poll. So recalculate the timeout now just in case. */ - uint64_t current_time = wsi_get_current_time(); + uint64_t current_time = wsi_common_get_current_time(); if (atimeout > current_time) timeout = atimeout - current_time; else -- cgit v1.2.3