Revert "Revert "gpu: nvgpu: Improve accuracy of dGPU clk measurement""

This reverts commit ffda24df36.

Bug 2637525
Bug 200530176

Change-Id: I542e51ea340f344768f9a3a090164964372fb5d2
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2148174
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vaibhav Kachore
2019-07-04 16:47:15 +05:30
committed by mobile promotions
parent 93ebeac3bd
commit e8c53b4e81
7 changed files with 52 additions and 9 deletions

View File

@@ -242,6 +242,18 @@ s64 nvgpu_current_time_ms(void)
return ktime_to_ms(ktime_get());
}
/**
* nvgpu_current_time_us - Time in microseconds from a monotonic clock.
*
* Return a clock in microsecond units. The start time of the clock is
* unspecified; the time returned can be compared with older ones to measure
* durations. The source clock does not jump when the system clock is adjusted.
*/
s64 nvgpu_current_time_us(void)
{
return ktime_to_us(ktime_get());
}
/**
* nvgpu_current_time_ns - Time in nanoseconds from a monotonic clock.
*
@@ -254,6 +266,18 @@ s64 nvgpu_current_time_ns(void)
return ktime_to_ns(ktime_get());
}
/**
* nvgpu_hr_timestamp_us - Time in microseconds from a monotonic clock.
*
* Return a clock in microsecond units. The start time of the clock is
* unspecified; the time returned can be compared with older ones to measure
* durations. The source clock does not jump when the system clock is adjusted.
*/
u64 nvgpu_hr_timestamp_us(void)
{
return nvgpu_us_counter();
}
/**
* nvgpu_hr_timestamp - Opaque 'high resolution' time stamp.
*