From 8dc75c172567ce81819b75cd9714fc887174583b Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 14 Jun 2017 16:11:35 +0300 Subject: 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 Reviewed-on: http://git-master/r/1503000 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: svccoveritychecker --- drivers/gpu/nvgpu/gk20a/bus_gk20a.c | 37 ++++--------------------------------- include/uapi/linux/nvgpu.h | 2 -- 2 files changed, 4 insertions(+), 35 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) 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: diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 00081c64..065aaece 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -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 */ -- cgit v1.2.2