From 823ba424568848c1863c6f4b798bbbf0428a9a05 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 8 Jun 2016 12:28:25 +0530 Subject: gpu: nvgpu: Add uapi support for NVGPU_GPU_IOCTL_GET_ENGINE_INFO Implement NVGPU_GPU_IOCTL_GET_ENGINE_INFO for retrieving the list of supported engines and their corresponding run list id:s. JIRA DNVGPU-25 Change-Id: I8703388660190f7dcb509c0676f283ca4b820b6f Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1160939 Reviewed-by: Sami Kiminki Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom --- include/uapi/linux/nvgpu.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 03173339..9d649536 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -394,6 +394,33 @@ struct nvgpu_gpu_get_gpu_time_args { __u64 reserved; }; +struct nvgpu_gpu_get_engine_info_item { + +#define NVGPU_GPU_ENGINE_ID_GR 0 +#define NVGPU_GPU_ENGINE_ID_GR_COPY 1 +#define NVGPU_GPU_ENGINE_ID_ASYNC_COPY 2 + __u32 engine_id; + + __u32 engine_instance; + + /* runlist id for opening channels to the engine, or -1 if + * channels are not supported */ + __s32 runlist_id; + + __u32 reserved; +}; + +struct nvgpu_gpu_get_engine_info_args { + /* [in] Buffer size reserved by userspace. + * + * [out] Full kernel buffer size. Multiple of sizeof(struct + * nvgpu_gpu_get_engine_info_item) + */ + __u32 engine_info_buf_size; + __u32 reserved; + __u64 engine_info_buf_addr; +}; + #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 \ @@ -446,8 +473,11 @@ struct nvgpu_gpu_get_gpu_time_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_GET_ENGINE_INFO \ + _IOWR(NVGPU_GPU_IOCTL_MAGIC, 26, \ + struct nvgpu_gpu_get_engine_info_args) #define NVGPU_GPU_IOCTL_LAST \ - _IOC_NR(NVGPU_GPU_IOCTL_GET_GPU_TIME) + _IOC_NR(NVGPU_GPU_IOCTL_GET_ENGINE_INFO) #define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \ sizeof(struct nvgpu_gpu_get_cpu_time_correlation_info_args) -- cgit v1.2.2