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 <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/673689
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Konsta Holtta
2015-01-14 14:04:08 +02:00
committed by Dan Willemsen
parent f93a8cc36b
commit 3877adcd65
5 changed files with 256 additions and 3 deletions

View File

@@ -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