gpu: nvgpu: Improve accuracy of dGPU clk measurement

- This patch replaces "nvgpu_current_time_ms" with "nvgpu_hr_timestamp_us".
- "nvgpu_hr_timestamp_us" gives timestamp in microseconds and has better
accuracy than "nvgpu_current_time_ms" (which gives timestamp in millisecond)

Bug 200503143

Change-Id: I6a10e8e1b3e8ff842aa23f58bf2ba9344af232a6
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2125959
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vaibhav Kachore
2019-06-21 11:45:42 +05:30
committed by mobile promotions
parent 80a5b864d3
commit 318d6451e9
7 changed files with 52 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -127,3 +127,8 @@ int nvgpu_init_soc_vars(struct gk20a *g)
#endif
return 0;
}
u64 nvgpu_us_counter(void)
{
return (u64)nvgpu_current_time_us();
}