diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c index c0db897aa..eadb7e3d4 100644 --- a/src/backends/native/meta-onscreen-native.c +++ b/src/backends/native/meta-onscreen-native.c @@ -231,12 +231,6 @@ notify_view_crtc_presented (MetaRendererView *view, meta_onscreen_native_swap_drm_fb (onscreen); } -static int64_t -timeval_to_microseconds (const struct timeval *tv) -{ - return ((int64_t) tv->tv_sec) * G_USEC_PER_SEC + tv->tv_usec; -} - static void page_flip_feedback_flipped (MetaKmsCrtc *kms_crtc, unsigned int sequence, @@ -258,7 +252,7 @@ page_flip_feedback_flipped (MetaKmsCrtc *kms_crtc, kms_device = meta_kms_crtc_get_device (kms_crtc); if (meta_kms_device_uses_monotonic_clock (kms_device)) { - presentation_time_us = timeval_to_microseconds (&page_flip_time); + presentation_time_us = meta_timeval_to_microseconds (&page_flip_time); flags |= COGL_FRAME_INFO_FLAG_HW_CLOCK; } else diff --git a/src/core/util-private.h b/src/core/util-private.h index d6af275b3..0568c6850 100644 --- a/src/core/util-private.h +++ b/src/core/util-private.h @@ -26,6 +26,7 @@ #define META_UTIL_PRIVATE_H #include +#include #include "meta/util.h" #include "meta/common.h" @@ -44,6 +45,12 @@ char * meta_generate_random_id (GRand *rand, void meta_init_debug_utils (void); +static inline int64_t +meta_timeval_to_microseconds (const struct timeval *tv) +{ + return ((int64_t) tv->tv_sec) * G_USEC_PER_SEC + tv->tv_usec; +} + #define META_POINT_IN_RECT(xcoord, ycoord, rect) \ ((xcoord) >= (rect).x && \ (xcoord) < ((rect).x + (rect).width) && \