From 6b35cb05b7822174bf037da7229154004df4f229 Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Tue, 12 Apr 2016 22:33:36 +0300 Subject: gpu: nvgpu: Implement NVGPU_GPU_IOCTL_GET_GPU_TIME Implement NVGPU_GPU_IOCTL_GET_GPU_TIME for reading the GPU time. Bug 1395833 Change-Id: I7ddc7c28ff0c9a336cc0dcd820b15fb0fea714d0 Signed-off-by: Sami Kiminki Reviewed-on: http://git-master/r/1125630 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- include/uapi/linux/nvgpu.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/uapi/linux/nvgpu.h') diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index d84c5440..cf89b9d8 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -377,6 +377,14 @@ struct nvgpu_gpu_get_cpu_time_correlation_info_args { __u32 source_id; }; +struct nvgpu_gpu_get_gpu_time_args { + /* raw GPU counter (PTIMER) value */ + __u64 gpu_timestamp; + + /* reserved for future extensions */ + __u64 reserved; +}; + #define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \ _IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args) #define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \ @@ -426,8 +434,11 @@ struct nvgpu_gpu_get_cpu_time_correlation_info_args { #define NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO \ _IOWR(NVGPU_GPU_IOCTL_MAGIC, 24, \ struct nvgpu_gpu_get_cpu_time_correlation_info_args) +#define NVGPU_GPU_IOCTL_GET_GPU_TIME \ + _IOWR(NVGPU_GPU_IOCTL_MAGIC, 25, \ + struct nvgpu_gpu_get_gpu_time_args) #define NVGPU_GPU_IOCTL_LAST \ - _IOC_NR(NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO) + _IOC_NR(NVGPU_GPU_IOCTL_GET_GPU_TIME) #define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \ sizeof(struct nvgpu_gpu_get_cpu_time_correlation_info_args) -- cgit v1.2.2