summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-06-14 09:11:35 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-19 13:45:29 -0400
commit8dc75c172567ce81819b75cd9714fc887174583b (patch)
tree84be44015187bc03daf88e57df179dfe05f48096 /drivers
parent077d4c6da3f27c7cb2096fed26eb8e8c77fca77f (diff)
gpu: nvgpu: only support TSC time correlation info
Remove the two other unnecessary options based on jiffies and gettimeofday, leaving only the time stamp counter clocksource. Jira NVGPU-83 Change-Id: I289951aba832eda36cb9cb68b7e41e6061ec3a03 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1503000 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/bus_gk20a.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/bus_gk20a.c b/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
index 7f0ca013..f23414b0 100644
--- a/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/bus_gk20a.c
@@ -128,44 +128,15 @@ int gk20a_read_ptimer(struct gk20a *g, u64 *value)
128 return -EBUSY; 128 return -EBUSY;
129} 129}
130 130
131static inline u64 get_cpu_timestamp_tsc(void)
132{
133 return ((u64) get_cycles());
134}
135
136static inline u64 get_cpu_timestamp_jiffies(void)
137{
138 return (get_jiffies_64() - INITIAL_JIFFIES);
139}
140
141static inline u64 get_cpu_timestamp_timeofday(void)
142{
143 struct timeval tv;
144
145 do_gettimeofday(&tv);
146 return timeval_to_jiffies(&tv);
147}
148
149int gk20a_get_timestamps_zipper(struct gk20a *g, 131int gk20a_get_timestamps_zipper(struct gk20a *g,
150 u32 source_id, u32 count, 132 u32 source_id, u32 count,
151 struct nvgpu_cpu_time_correlation_sample *samples) 133 struct nvgpu_cpu_time_correlation_sample *samples)
152{ 134{
153 int err = 0; 135 int err = 0;
154 unsigned int i = 0; 136 unsigned int i = 0;
155 u64 (*get_cpu_timestamp)(void) = NULL; 137
156 138 if (source_id != NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC) {
157 switch (source_id) { 139 nvgpu_err(g, "source_id %u not supported", source_id);
158 case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC:
159 get_cpu_timestamp = get_cpu_timestamp_tsc;
160 break;
161 case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_JIFFIES:
162 get_cpu_timestamp = get_cpu_timestamp_jiffies;
163 break;
164 case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TIMEOFDAY:
165 get_cpu_timestamp = get_cpu_timestamp_timeofday;
166 break;
167 default:
168 nvgpu_err(g, "invalid cpu clock source id\n");
169 return -EINVAL; 140 return -EINVAL;
170 } 141 }
171 142
@@ -180,7 +151,7 @@ int gk20a_get_timestamps_zipper(struct gk20a *g,
180 if (err) 151 if (err)
181 return err; 152 return err;
182 153
183 samples[i].cpu_timestamp = get_cpu_timestamp(); 154 samples[i].cpu_timestamp = (u64)get_cycles();
184 } 155 }
185 156
186end: 157end: