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>
This commit is contained in:
Konsta Holtta
2017-06-14 16:11:35 +03:00
committed by mobile promotions
parent 077d4c6da3
commit 8dc75c1725
2 changed files with 3 additions and 34 deletions

View File

@@ -128,44 +128,15 @@ int gk20a_read_ptimer(struct gk20a *g, u64 *value)
return -EBUSY;
}
static inline u64 get_cpu_timestamp_tsc(void)
{
return ((u64) get_cycles());
}
static inline u64 get_cpu_timestamp_jiffies(void)
{
return (get_jiffies_64() - INITIAL_JIFFIES);
}
static inline u64 get_cpu_timestamp_timeofday(void)
{
struct timeval tv;
do_gettimeofday(&tv);
return timeval_to_jiffies(&tv);
}
int gk20a_get_timestamps_zipper(struct gk20a *g,
u32 source_id, u32 count,
struct nvgpu_cpu_time_correlation_sample *samples)
{
int err = 0;
unsigned int i = 0;
u64 (*get_cpu_timestamp)(void) = NULL;
switch (source_id) {
case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC:
get_cpu_timestamp = get_cpu_timestamp_tsc;
break;
case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_JIFFIES:
get_cpu_timestamp = get_cpu_timestamp_jiffies;
break;
case NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TIMEOFDAY:
get_cpu_timestamp = get_cpu_timestamp_timeofday;
break;
default:
nvgpu_err(g, "invalid cpu clock source id\n");
if (source_id != NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC) {
nvgpu_err(g, "source_id %u not supported", source_id);
return -EINVAL;
}
@@ -180,7 +151,7 @@ int gk20a_get_timestamps_zipper(struct gk20a *g,
if (err)
return err;
samples[i].cpu_timestamp = get_cpu_timestamp();
samples[i].cpu_timestamp = (u64)get_cycles();
}
end:

View File

@@ -427,8 +427,6 @@ struct nvgpu_gpu_get_buffer_info_args {
#define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_MAX_COUNT 16
#define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC 1
#define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_JIFFIES 2
#define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TIMEOFDAY 3
struct nvgpu_gpu_get_cpu_time_correlation_sample {
/* gpu timestamp value */