summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index e106c479..58c8e9ad 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -50,6 +50,10 @@ struct acr_gm20b;
50#include "cde_gk20a.h" 50#include "cde_gk20a.h"
51#include "debug_gk20a.h" 51#include "debug_gk20a.h"
52 52
53/* PTIMER_REF_FREQ_HZ corresponds to a period of 32 nanoseconds.
54 32 ns is the resolution of ptimer. */
55#define PTIMER_REF_FREQ_HZ 31250000
56
53struct cooling_device_gk20a { 57struct cooling_device_gk20a {
54 struct thermal_cooling_device *gk20a_cooling_dev; 58 struct thermal_cooling_device *gk20a_cooling_dev;
55 unsigned int gk20a_freq_state; 59 unsigned int gk20a_freq_state;
@@ -901,6 +905,10 @@ void gk20a_user_deinit(struct platform_device *dev);
901 905
902extern void gk20a_debug_dump_device(struct platform_device *pdev); 906extern void gk20a_debug_dump_device(struct platform_device *pdev);
903 907
908static inline u32 ptimer_scalingfactor10x(u32 ptimer_src_freq)
909{
910 return (u32)(((u64)(PTIMER_REF_FREQ_HZ * 10)) / ptimer_src_freq);
911}
904static inline u32 scale_ptimer(u32 timeout , u32 scale10x) 912static inline u32 scale_ptimer(u32 timeout , u32 scale10x)
905{ 913{
906 if (((timeout*10) % scale10x) >= (scale10x/2)) 914 if (((timeout*10) % scale10x) >= (scale10x/2))