From 3877adcd656e8e4329e2c4250119de2256f30730 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 14 Jan 2015 14:04:08 +0200 Subject: gpu: nvgpu: add hw perfmon buffer mapping ioctls Map/unmap buffers for HWPM and deal with its instance block, the minimum work required to run the HWPM via regops from userspace. Bug 1517458 Bug 1573150 Change-Id: If14086a88b54bf434843d7c2fee8a9113023a3b0 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/673689 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- include/uapi/linux/nvgpu.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 1e438775..ebeacf9b 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -432,10 +432,26 @@ struct nvgpu_dbg_gpu_suspend_resume_all_sms_args { #define NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_ALL_SMS \ _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 6, struct nvgpu_dbg_gpu_suspend_resume_all_sms_args) +struct nvgpu_dbg_gpu_perfbuf_map_args { + __u32 dmabuf_fd; /* in */ + __u32 reserved; + __u64 mapping_size; /* in, size of mapped buffer region */ + __u64 offset; /* out, virtual address of the mapping */ +}; + +struct nvgpu_dbg_gpu_perfbuf_unmap_args { + __u64 offset; +}; + +#define NVGPU_DBG_GPU_IOCTL_PERFBUF_MAP \ + _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 7, struct nvgpu_dbg_gpu_perfbuf_map_args) +#define NVGPU_DBG_GPU_IOCTL_PERFBUF_UNMAP \ + _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 8, struct nvgpu_dbg_gpu_perfbuf_unmap_args) + #define NVGPU_DBG_GPU_IOCTL_LAST \ - _IOC_NR(NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_ALL_SMS) + _IOC_NR(NVGPU_DBG_GPU_IOCTL_PERFBUF_UNMAP) #define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \ - sizeof(struct nvgpu_dbg_gpu_exec_reg_ops_args) + sizeof(struct nvgpu_dbg_gpu_perfbuf_map_args) /* * /dev/nvhost-gpu device -- cgit v1.2.2