summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi/wsi_common_x11.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-10-28 13:37:26 +0000
committerEric Engestrom <[email protected]>2019-03-11 10:49:36 +0000
commit1ee01d91c7e9bb0922b112c11a374283e2ca454b (patch)
tree18f192f0f8e59b5085474f43ea50cddd415586c3 /src/vulkan/wsi/wsi_common_x11.c
parent7bb34ecff9833e0b490e90ab04fdaa6342eadc1b (diff)
wsi: deduplicate get_current_time() functions between display and x11
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common_x11.c')
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c14
1 files changed, 2 insertions, 12 deletions
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