gpu: nvgpu: IOCTL to suspend/resume context

Add below IOCTL to suspend/resume a context
NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_CONTEXTS:

Suspend sequence :
- disable ctxsw
- loop through list of channels
- if channel is ctx resident, suspend all SMs
- otherwise, disable channel/TSG
- enable ctxsw

Resume sequence :
- disable ctxsw
- loop through list of channels
- if channel is ctx resident, resume all SMs
- otherwise, enable channel/TSG
- enable ctxsw

Bug 200156699

Change-Id: Iacf1bf7877b67ddf87cc6891c37c758a4644b014
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1120332
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Deepak Nibade
2015-12-21 15:21:49 +05:30
committed by Terje Bergstrom
parent dfac8ce704
commit b63c4bced5
6 changed files with 196 additions and 32 deletions

View File

@@ -738,8 +738,22 @@ struct nvgpu_dbg_gpu_unbind_channel_args {
_IOW(NVGPU_DBG_GPU_IOCTL_MAGIC, 17, struct nvgpu_dbg_gpu_unbind_channel_args)
#define NVGPU_DBG_GPU_SUSPEND_ALL_CONTEXTS 1
#define NVGPU_DBG_GPU_RESUME_ALL_CONTEXTS 2
struct nvgpu_dbg_gpu_suspend_resume_contexts_args {
__u32 action;
__u32 is_resident_context;
__s32 resident_context_fd;
__u32 padding;
};
#define NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_CONTEXTS \
_IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 18, struct nvgpu_dbg_gpu_suspend_resume_contexts_args)
#define NVGPU_DBG_GPU_IOCTL_LAST \
_IOC_NR(NVGPU_DBG_GPU_IOCTL_UNBIND_CHANNEL)
_IOC_NR(NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_CONTEXTS)
#define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \
sizeof(struct nvgpu_dbg_gpu_perfbuf_map_args)