summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/common/linux/timers.c12
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/timers.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/timers.c b/drivers/gpu/nvgpu/common/linux/timers.c
index 41b55543..d1aa641f 100644
--- a/drivers/gpu/nvgpu/common/linux/timers.c
+++ b/drivers/gpu/nvgpu/common/linux/timers.c
@@ -243,6 +243,18 @@ s64 nvgpu_current_time_ms(void)
243} 243}
244 244
245/** 245/**
246 * nvgpu_current_time_ns - Time in nanoseconds from a monotonic clock.
247 *
248 * Return a clock in nanosecond units. The start time of the clock is
249 * unspecified; the time returned can be compared with older ones to measure
250 * durations. The source clock does not jump when the system clock is adjusted.
251 */
252s64 nvgpu_current_time_ns(void)
253{
254 return ktime_to_ns(ktime_get());
255}
256
257/**
246 * nvgpu_hr_timestamp - Opaque 'high resolution' time stamp. 258 * nvgpu_hr_timestamp - Opaque 'high resolution' time stamp.
247 * 259 *
248 * Return a "high resolution" time stamp. It does not really matter exactly what 260 * Return a "high resolution" time stamp. It does not really matter exactly what
diff --git a/drivers/gpu/nvgpu/include/nvgpu/timers.h b/drivers/gpu/nvgpu/include/nvgpu/timers.h
index 2e260619..83dd8d78 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/timers.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/timers.h
@@ -109,6 +109,7 @@ void nvgpu_udelay(unsigned int usecs);
109 * Timekeeping. 109 * Timekeeping.
110 */ 110 */
111s64 nvgpu_current_time_ms(void); 111s64 nvgpu_current_time_ms(void);
112s64 nvgpu_current_time_ns(void);
112u64 nvgpu_hr_timestamp(void); 113u64 nvgpu_hr_timestamp(void);
113 114
114#endif 115#endif