]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drm/vmwgfx: use monotonic event timestamps
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / vmwgfx / vmwgfx_fence.c
index d6b1c509ae019d1aae404ff5163506d5e819155e..55214d0da66e83e602ab356d06da52689da903f6 100644 (file)
@@ -897,11 +897,12 @@ static void vmw_event_fence_action_seq_passed(struct vmw_fence_action *action)
        spin_lock_irq(&dev->event_lock);
 
        if (likely(eaction->tv_sec != NULL)) {
-               struct timeval tv;
+               struct timespec64 ts;
 
-               do_gettimeofday(&tv);
-               *eaction->tv_sec = tv.tv_sec;
-               *eaction->tv_usec = tv.tv_usec;
+               ktime_get_ts64(&ts);
+               /* monotonic time, so no y2038 overflow */
+               *eaction->tv_sec = ts.tv_sec;
+               *eaction->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
        }
 
        drm_send_event_locked(dev, eaction->event);