Skip to content
Commit de7e8bd0 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Daniel Vetter
Browse files

drm: via: use ktime_get() instead of do_gettimeofday



We want to remove uses of do_gettimeofday() from the kernel since the
resulting timeval structure overflows in 2038. This is not a problem for
this particular use, but do_gettimeofday() is also not an appropriate
method for measuring time intervals, since it requires a conversion into
microseconds and is complicated to work with.

ktime_get() is a better replacement, as it works with the monontonic
kernel timebase and requires a minimum of computation.

I'm slightly changing the output from microseconds to nanoseconds here,
to avoid introducing a new division operation. This should be fine
since the value is only used for debugging.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171104212131.2939989-1-arnd@arndb.de
parent 0338f0d0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment